When I do this (to capture info into a file.txt):

$ omxplayer -i sounds/Maniacal_Witches_Laugh-SoundBible.com-262127569.mp3 > file.txt
Input #0, mp3, from 'sounds/Maniacal_Witches_Laugh-SoundBible.com-262127569.mp3':
    title           : Maniacal Witches Laugh
    artist          : Maniacal Witches Laugh
    album           : Maniacal Witches Laugh
    genre           : Blues
  Duration: 00:00:02.56, start: 0.000000, bitrate: 83 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 82 kb/s
have a nice day ;)

...in the file I only get this:

$ cat file.txt 
have a nice day ;)

How can I get the whole output of the -i command into a file?

1 Answer 1


">" only captures stdout, to capture the errout stream as well you need "2>&1"

 omxplayer -i sounds/Maniacal_Witches_Laugh-SoundBible.com-262127569.mp3 >file.txt 2>&1 


omxplayer -i sounds/Maniacal_Witches_Laugh-SoundBible.com-262127569.mp3 2>&1 | tee file.txt
  • ? There is no error. The output in my question is stdout (hence 2>&1 redirects nothing).
    – Saran
    Oct 31, 2014 at 10:42
  • if it is not captured by ">" then by definition it is not stdout and the only other standard output stream is stderr stackoverflow.com/questions/6674327/redirect-all-output-to-file
    – rob
    Oct 31, 2014 at 13:13
  • The correct format is ...mp3 > file.txt 2>&1 or just ...mp3 2>&1 | <process_it_inline>. Correct your answer so I can accept it.
    – Saran
    Oct 31, 2014 at 13:47
  • sorry, should have read what I wrote before trying to defend it. answer updated.
    – rob
    Nov 3, 2014 at 8:22
  • Np. Important thing is: problem solved.
    – Saran
    Nov 3, 2014 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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