Skip to content

Instantly share code, notes, and snippets.

@questionlp
Created June 8, 2022 01:43
Show Gist options
  • Save questionlp/39fad395feffd73dc53875da047f9a46 to your computer and use it in GitHub Desktop.
Save questionlp/39fad395feffd73dc53875da047f9a46 to your computer and use it in GitHub Desktop.
Compiling TBTL Singing Clips

The following commands will connect FLAC files that contain the phrase "Singing" and "sing-songy" in the file name and copy them into the current directory.

find ~/Dropbox/TBTL -type f -name '*Singing *.flac' -exec cp "{}" . \;
find ~/Dropbox/TBTL -type f -name '*sing-songy*.flac' -exec cp "{}" . \;

To generate a text file containing a list of collected files, run:

ls -1 > _files.txt

One way to randomize the list of files is to use the sort command with the random -R flag.

sort -R < _files.txt > _files_randomized.txt

In case sort does not produce a properly randomized list, use the shuf tool that is included in GNU coreutils (available through Homebrew by running brew install coreutils):

shuf _files.txt > _files_randomized_shuf.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment