I’m upscaling some audio and the website asked me to state how many minutes I’d need:
In a code block, the one-liner looks like this:
find | grep mp3$ | xargs -L 1 mp3-minutes | math-sum
This one-liner does the following:
The find command lists all the files and directories in the current location.
The output of find is then piped to grep mp3$ which filters and retains only the lines ending with mp3.
The filtered list of mp3 files is then piped to xargs -L 1 mp3-minutes which executes the mp3-minutes command on each mp3 file to find the duration in minutes of each file.
The resulting list of durations is then piped to math-sum which sums up all the durations to give a total.
Lets break down each stage with partial outputs.
The find command
It lists all files and directories recursively in a directory. The output includes both file and directory names.
Partial Output:
.
./3_Vayikra
./3_Vayikra/7_Kedoshim
./3…