Created
April 5, 2018 06:51
-
-
Save sarathlal-old/c2dd5ca0152566d60c183d3e6ac89ac2 to your computer and use it in GitHub Desktop.
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
find . ! -name 'file.txt' -type f -exec rm -f {} + | |
will remove all regular files (recursively, including hidden ones) except file.txt. To remove directories, change -type f to -type d and add -r option to rm. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment