Created
April 3, 2017 20:48
-
-
Save rogovski/97e649ddfe5bf6c592db6f42ea0e59f1 to your computer and use it in GitHub Desktop.
shell snippets
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
| # remove all files in the current directory with 'copy' in the name | |
| ls | grep .*copy | xargs rm | |
| # remove files - works with whitespace in filename | |
| find -type f -name '*.sql' -mtime +15 -print0 | xargs -0 rm | |
| # replace white space in file names with underscore | |
| for f in *\ *; do mv "$f" "${f// /_}"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment