Last active
November 28, 2017 14:44
-
-
Save T1T4N/f26f1fd98cc55c16137c0527a8f344d5 to your computer and use it in GitHub Desktop.
Command that adds a "-i" file in every subdirectory to prevent "rm -rf *" expansion
This file contains hidden or 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
# rm -rf * will treat -i as an option and ask for deletion | |
find . -maxdepth 1 -type d -iname "*" -exec touch {}/-i \; -exec chflags hidden {}/-i \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment