Last active
August 29, 2015 14:23
-
-
Save tsur/f189c55b0dbc8c627f93 to your computer and use it in GitHub Desktop.
Delete all files not ending
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
# Using find | |
find . -type f -not -name "*.js" -exec rm {} +; # recursively | |
find . -type f -not -name "*.js" -maxdepth 1 -exec rm {} +; # Only current dir | |
# Using rm | |
shopt -s extglob | |
rm **/!(*.js) # recursively | |
rm !(*.js) # Only current dir | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment