2

Is there a way to list the contents of a folder via the command line in such a way that the audio files in mp3 format have the bit rate info? I tried ls -l but it doesn't work.

  • find <music_dir> -exec exiftool -AudioBitrate {}\; may do what you want if you have exiftool installed. – Warwick Aug 19 '14 at 1:08
  • I don't and it's not in the Fedora's repos. – Carl Vidal Aug 19 '14 at 1:10
  • Sorry, exiftool is indeed in the Fedora Repos. Already installed it, and your suggestion worked perfectly. Thank you. – Carl Vidal Aug 19 '14 at 3:41
3

With find and file:

find Music/Albert\ Ayler/Vibrations/ -name "*.flac" -exec file {} \;
Music/Albert Ayler/Vibrations/1.Ghosts.flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 5653620 samples
Music/Albert Ayler/Vibrations/4.Ghosts (2).flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 21096264 samples
Music/Albert Ayler/Vibrations/3.Holy Spirit.flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 22529220 samples
Music/Albert Ayler/Vibrations/5.Vibrations.flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 13225296 samples
Music/Albert Ayler/Vibrations/2.Children.flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 18213300 samples
Music/Albert Ayler/Vibrations/6.Mothers.flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 18814824 samples

You could further filter the output depending upon the fields you are interested in...

  • Nothing gets returned with this command. – Carl Vidal Aug 19 '14 at 1:24
  • Are your audio files in the flac format? If not, then no, this command won't return anything. You would need to replace the "*.flac" with the extensions of the files that you are interested in. E.g. if they end in mp3, then you would replace "*.flac" with "*.mp3" etc. – Warwick Aug 19 '14 at 1:31
  • @CarlVidal Did you adapt it for your needs? There is no reason it shouldn't work if it is pointed at the right directory. Change (or remove) the -name "*.flac" if necessary... – jasonwryan Aug 19 '14 at 1:32
  • Sorry, I was missing the asterisk. Now it returns some additional info about the files ("Audio file with ID3 version 2.3.0") but not the bit rate. Any idea to fix it? – Carl Vidal Aug 19 '14 at 1:36
  • @CarlVidal No: you'll need to edit your question and include information about the type of files you are working with. – jasonwryan Aug 19 '14 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.