bash: for – looping over and processing files in current directory
A one liner to go over all the files (can filter by file type) and apply a process.
The example below shows all audio files in WAV format (*.wav) to be converted to MP3 with ffmpeg:
1 | for f in *.wav; do ffmpeg -i $f $f.mp3; done; |
The example below show a listing of all files:
1 | for f in *; do echo $f; done; |