in linux you can use the evil bird emoticon (:>) to destroy files, eg `:> important_document.txt`
-
@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
``` -
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's a cool fact
-
@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?':' returns 0 (meaning true). I just checked and '>' clears the file with no input. So, yes, the ':' is just decorative.
-
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!
-
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 New "Press Alt+F4 to win" just dropped.
-
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!
Thanks! Iβve learned AND cemented
as evil bird -
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!
Very interesting. Never seen it in a long life of use of Unix.
Is there a "cheat sheet" of other unknown - at least by me
- such "wild" characters for file redirection ? -
Very interesting. Never seen it in a long life of use of Unix.
Is there a "cheat sheet" of other unknown - at least by me
- such "wild" characters for file redirection ?@tanavit > is pretty well known and : is a shell built-in similar to true, it's just the combination of the two that's uncommon