Created
May 11, 2020 09:13
-
-
Save joybh98/bf8799da7b22f39609aa35b6d9f60629 to your computer and use it in GitHub Desktop.
Move/Copy first/last n files to subdirectory
This file contains 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
# First n files | |
$ find . -maxdepth 1 -type f |head -n|xargs cp -t "$destdir" | |
# Last n files | |
$ find . -mindepth 1 -type f |head -n|xargs cp -t "$destdir" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment