4 ms·
> If you want to try a fun little experiment, type this command into your colleague's shell and see what happens (and how long it takes): > mkdir ./~ $ t
by twic 12y ago
> If you want to try a fun little experiment, type this command into your colleague's shell and see what happens (and how long it takes):
> mkdir ./~
$ time mkdir ./~
real 0m0.007s
user 0m0.000s
sys 0m0.004s
I don't get it. What's fun about this experiment?
- alanpost 12y agoThe user will ls their home directory, see this file, and attempt to rm it. The shell will instruct rm to remove their home directory instead.
- twic 12y agoAh. I feel a bit stupid for taking that so literally. So, when i delete a directory, whenever possible, i use the rmdir command. rmdir refuses to delete a directory which isn't empty. It's a really handy safety check. If a colleague dropped a tilde directory on me, the process would go: Well, i'll just delete that. $ rmdir ~ rmdir: /home/twic: Directory not empty Oh bugger, of course. Better quote it.' $ rmdir '~' Right, now i will proceed to give my colleague a Chinese burn.