Article 5F2EC trying to use mediainfo | grep with find command

trying to use mediainfo | grep with find command

by
breadbin
from LinuxQuestions.org on (#5F2EC)
Hi there, I am organising my music files and would like to run a command that will go into each sub-directory and output the bit-rate of the mp3. I can output the bit rate ok but not for multiple files in multiple folders. And so I try to use the 'find' command to do this.

I can use

Code:mediainfo * | grep "Bit rate"and it will output the bit rate for all the files in that folder. ideally I would like to run it from the top folder, display the name of the folder, the name of each song and the bitrate.

Code:find -type f -exec mediainfo {} \;will output the mediainfo for each file too but the trouble starts when I try and use grep piped from the output to find the line with "Bit rate". I can't figure the command line out. I have tried wrapping different things in "", I tried adding another -exec for grep, more curly brackets for grep. I'm sure it's dead easy and probably just needs a quote or something to make it work.

This is what I thought should work but it doesn't obviously:)

Code:find -type f -exec mediainfo {} | grep "Bit rate" \;Any help would be appreciated. I could probably do it easier with mpg123 or some other utility which doesn't need the grep part but I would like to use grep and learn something. Thanks.latest?d=yIl2AUoC8zA latest?i=r360syFQEFM:StSOHvTcq7c:F7zBnMy latest?i=r360syFQEFM:StSOHvTcq7c:V_sGLiP latest?d=qj6IDK7rITs latest?i=r360syFQEFM:StSOHvTcq7c:gIN9vFwr360syFQEFM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments