Last active
October 16, 2019 13:39
-
-
Save dizzersee/eb058db92ec3708f27d48e527043ee11 to your computer and use it in GitHub Desktop.
Move biggest files to another dir
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
##### Some linux commands to move biggest files | |
# Move 6 biggest files of current dir to "bigfiles" dir | |
ls --sort=size | head -n 6 | xargs -I{} cp {} ../bigfiles | |
# Only files with filename length of 14: | |
ls --sort=size ./?????????????? | head -n 595 | xargs -I{} cp {} ../bigfiles | |
# Move 500 biggest files but starting at offset 12000 (means 500 biggest files after the 12000th biggest file) | |
ls --sort=size ./?????????????? | tail -n +12000 | head -n 500 | xargs -I{} cp {} ../bigfiles | |
# Number of files in dir | |
ls -l . | egrep -c '^-' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment