Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a set of videos in the folder. I would like to get the info about this videos using ffmpeg -i command and save the output to file.

So I wrote the line:

find . -type f -exec ffmpeg -i {} \; > log.txt

But surprisingly, the log is empty! What am I missing here?

share|improve this question
up vote 5 down vote accepted

I think what might be happening here is that ffmpeg is sending its output to stderr, in which case what you want is just:

find . -type f -exec ffmpeg -i {} \; 2>log.txt

I don't have ffmpeg in my distro to test with, but this has been verified with avconv from libav (should still be the same in this respect).

share|improve this answer

set the output inside the exec

find . -type f -exec ffmpeg -i {} \; > log.txt

breno@stormtrooper:/tmp$ find . -type f -exec ls {} >> /tmp/test.log \;
find: `./pulse-PKdhtXMmr18n`: Permission denied
breno@stormtrooper:/tmp$ ls
hsperfdata_breno  pulse-PKdhtXMmr18n  ssh-SLDpHf9PBb5g  t2  test.log
breno@stormtrooper:/tmp$ cat test.log 
share|improve this answer
find . -type f -exec ls {} >> /tmp/test.log \; is exactly the same as find . -type f -exec ls {} \; >> /tmp/test.log. It's a simple command, the redirection can be anywhere on the line. – Gilles Jan 29 '14 at 23:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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