Created
January 15, 2016 13:35
-
-
Save robert-spurrier/0860aea215b39f8ac20b to your computer and use it in GitHub Desktop.
Copy a given number of random directories to another directory
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
| # Script I use to copy random albums to my mp3 player | |
| # OS X, requires GNU coreutils | |
| ls "$1" | gsort -R | tail -n $3 | while read file; do | |
| cd "$1"; cp -R "$file" $2 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment