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!
-
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
-
@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
Thanks.
-
@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 it's a bash builtin
$ help :
:: :
Null command.No effect; the command does nothing.
Exit Status:
Always succeeds. -
@cenobyte @rebane2001 I usually just use
truncateorecho "" > whateverbut this is a lot more terse. I like it.@draeath @cenobyte @rebane2001
With echo "" you don't make an empty file though. It's a file with one octet (newline) then.
-
@draeath @cenobyte @rebane2001
With echo "" you don't make an empty file though. It's a file with one octet (newline) then.
@project1enigma @cenobyte @rebane2001 true unless you pass the argument not to add that... But at that point things are getting silly and there's definitely better ways. But in most of the things I work with, a truly empty file and a file with only a newline in it are close enough to equivalent.
-
@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 null command in the POSIX shell standard. It's a built-in that outputs nothing and exits immediately with a status of zero (effectively the same as /bin/true).
So the shell parses ':> afile' as "null command with output redirected to afile"
-
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 everpresent word snatcher is real...

-
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 would draw this if i had the energy to do so and also the art skills to draw that well enough to not have my perfectionist brain tear into me
-
R relay@relay.infosec.exchange shared this topic