Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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 found this script on the arch wiki which prefixes an ffmpeg command like this

< /dev/null ffmpeg -i "$a" -qscale:a 0 "${a[@]/%flac/mp3}"

I understand the ffmpeg command, it is the < /dev/null part. Is it supposed to redirect the verbose output to /dev/null/?

share|improve this question
up vote 11 down vote accepted

No... it is reading from /dev/null. command < input and < input command are equivalent.

(So are > output command and command > output, by the way.)

share|improve this answer
Well now I am more confused. Why would it read from /dev/null, when it /dev/null only yields EOF. Why not just use EOF? – cheezsteak Mar 11 '14 at 17:03
Redirecting stdin from /dev/null is the easiest way to get an immediate EOF. How else would you do it? – Blacklight Shining Mar 11 '14 at 17:23
@PhilipWales, what's EOF? Redirecting input from /dev/null makes sure every read returns nothing. Alternative, shorter but less efficient is :|ffmpeg ... – Stéphane Chazelas Mar 11 '14 at 17:24
@PhilipWales Redirecting input to /dev/null seems overkill, but it is a common technique to prevent the program from accidentally reading something from the keyboard buffer. E.g. say you have a program that will abort a lengthy operation if it receives an Escape from the keyboard. In most terminals Function-keys generate Escape-seqeuences... Reading from /dev/null will then prevent an unintended abort by a clumsy user pressing the wrong key by accident. – Tonny Mar 11 '14 at 23:33
@Tonny: How is it overkill? – Keith Thompson Mar 12 '14 at 0:38

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.