in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
-
in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
the bird will eat the file and leave it completely empty!
@rebane2001@infosec.exchange hmm I suppose thats because its writing nothing into the file but I dont understand the reason for the
:(I mean yeah it does make the face but from a commands perspective I mean)
Id assume it works without?
Im guessing:is ignored or perhaps written into the file? -
@rebane2001@infosec.exchange hmm I suppose thats because its writing nothing into the file but I dont understand the reason for the
:(I mean yeah it does make the face but from a commands perspective I mean)
Id assume it works without?
Im guessing:is ignored or perhaps written into the file?@ChaosKitsune @rebane2001 : is the no-op built-in in POSIX shells.
-
@rebane2001@infosec.exchange hmm I suppose thats because its writing nothing into the file but I dont understand the reason for the
:(I mean yeah it does make the face but from a commands perspective I mean)
Id assume it works without?
Im guessing:is ignored or perhaps written into the file?@ChaosKitsune@woem.men https://www.gnu.org/software/bash/manual/bash.html#index-_003a
the colon is a shell command that does nothing
it's often used to perform expansions with side-effects, like:: ${ARGUMENT:=default value} : ${MUST_BE_SET:?error message}
@rebane2001@infosec.exchange -
in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
the bird will eat the file and leave it completely empty!
@rebane2001 It works ๐คฏ
-
in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
the bird will eat the file and leave it completely empty!
@rebane2001 I feed my evil bird junk files twice a day so they don't get hungry and start eating files I need
-
@ChaosKitsune @rebane2001 : is the no-op built-in in POSIX shells.
@lambda @ChaosKitsune @rebane2001 does that like actually run the no-op in assembly//machine level ?? or actually do nothing and return 0 ??
-
in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
the bird will eat the file and leave it completely empty!
@rebane2001 thanks i was hungry

-
@lambda @ChaosKitsune @rebane2001 does that like actually run the no-op in assembly//machine level ?? or actually do nothing and return 0 ??
@pinkRhododendron @ChaosKitsune @rebane2001 the latter, there's no reason the *implementation* of the shell built-in would have to use an extra machine instruction that does nothing (though maybe the compiler sneakily inserts one anyway, e.g. for alignment reasons!)
-
in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
the bird will eat the file and leave it completely empty!
aah i shouldve called it the mischievous bird not evil!!
-
@rebane2001 It works ๐คฏ
@pinkRhododendron @rebane2001
I would have also created an alias for the hungry cat to echo out on console
Burp, mjao -
in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
the bird will eat the file and leave it completely empty!
@rebane2001 This is awesome for clearing out files. Some log files when you're trying to isolate. Love learning new commands. Thank you!
-
in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
the bird will eat the file and leave it completely empty!
@rebane2001 it doesn't eat worms `~`

```
$
~
bash: /home/user: Is a directory
``` -
in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
the bird will eat the file and leave it completely empty!
This post did not contain any content.
-
@ChaosKitsune@woem.men https://www.gnu.org/software/bash/manual/bash.html#index-_003a
the colon is a shell command that does nothing
it's often used to perform expansions with side-effects, like:: ${ARGUMENT:=default value} : ${MUST_BE_SET:?error message}
@rebane2001@infosec.exchange@dakkar @ChaosKitsune @rebane2001 also infinite cycles:
while :
do
<whatever>
Done -
@rebane2001 This is awesome for clearing out files. Some log files when you're trying to isolate. Love learning new commands. Thank you!
@cenobyte @rebane2001 I usually just use
truncateorecho "" > whateverbut this is a lot more terse. I like it. -
@dakkar @ChaosKitsune @rebane2001 also infinite cycles:
while :
do
<whatever>
Done@jcpandrade@mastodon.social ha! I tend to do
while truebecause it reads better to me
(yes, I know that involves a fork+exec, but if we cared about speed we wouldn't be writing shell)
@ChaosKitsune@woem.men @rebane2001@infosec.exchange -
@rebane2001@infosec.exchange hmm I suppose thats because its writing nothing into the file but I dont understand the reason for the
:(I mean yeah it does make the face but from a commands perspective I mean)
Id assume it works without?
Im guessing:is ignored or perhaps written into the file?@ChaosKitsune @rebane2001 : is a no-op with no output, which is then redirected to the file.
See: https://stackoverflow.com/questions/3224878/what-is-the-purpose-of-the-colon-gnu-bash-builtin -
@jcpandrade@mastodon.social ha! I tend to do
while truebecause it reads better to me
(yes, I know that involves a fork+exec, but if we cared about speed we wouldn't be writing shell)
@ChaosKitsune@woem.men @rebane2001@infosec.exchange@dakkar I used the true but... : is faster and easier to type... Just being lazy, I admit. @ChaosKitsune @rebane2001
-
in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
the bird will eat the file and leave it completely empty!
@rebane2001 The nice bird is named sudo rm -rf / -
@rebane2001 it doesn't eat worms `~`

```
$
~
bash: /home/user: Is a directory
```