Created
April 14, 2016 17:07
-
-
Save amckenna/86495f2fb268eec9c8879fbc1302167e to your computer and use it in GitHub Desktop.
protecting against rm -rf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✔ ~ | |
10:04 $ cd Downloads/ | |
✔ ~/Downloads | |
10:04 $ mkdir temp | |
✔ ~/Downloads | |
10:04 $ cd temp/ | |
✔ ~/Downloads/temp | |
10:04 $ ls | |
✘-1 ~/Downloads/temp | |
10:04 $ touch -- -@ | |
✔ ~/Downloads/temp | |
10:04 $ ls | |
total 0 | |
-rw-r--r-- 1 a staff 0B Apr 14 10:04 -@ | |
✔ ~/Downloads/temp | |
10:04 $ touch {1..4} | |
✔ ~/Downloads/temp | |
10:04 $ ls | |
total 0 | |
-rw-r--r-- 1 a staff 0B Apr 14 10:04 -@ | |
-rw-r--r-- 1 a staff 0B Apr 14 10:04 1 | |
-rw-r--r-- 1 a staff 0B Apr 14 10:04 2 | |
-rw-r--r-- 1 a staff 0B Apr 14 10:04 3 | |
-rw-r--r-- 1 a staff 0B Apr 14 10:04 4 | |
✔ ~/Downloads/temp | |
10:04 $ rm -rf * | |
rm: invalid option -- '@' | |
Try 'rm ./-@' to remove the file ‘-@’. | |
Try 'rm --help' for more information. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment