Last active
August 29, 2015 14:15
-
-
Save myfavouritekk/d5b2fa93c952aea7cbd7 to your computer and use it in GitHub Desktop.
Dealing with large number of files
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
| # Quickly count, -f disable sorting, adding . and .. | |
| ls -f directory | wc -l | |
| # Quickly remove files | |
| rsync -a --delete empty_directory/ directory/ | |
| find directory -delete | |
| # Quickly copy files | |
| rsync -a source/ target/ | |
| # Copy list of files | |
| rsync -a --files-from=/path/to/file-list source target | |
| # Replace scp | |
| rsync -av --progress source remote:target/ | |
| rsync -av -e 'ssh -p port_number' source remote:target/ | |
| # Grep large files in parallel | |
| parallel --pipe grep 'pattern' < bigfile.txt | |
| parallel --pipe grep -f patterns.txt < bigfile.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment