Super User is a question and answer site for computer enthusiasts and power users. 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'm interested in why head works as it works with given parameters, i.e. head -3 produces the same output as head -n 3?

share|improve this question
up vote 4 down vote accepted

From the Coreutils info pages for head (accessible through info coreutils 'head invocation'):

For compatibility head also supports an obsolete option syntax -COUNTOPTIONS, which is recognized only if it is specified first. COUNT is a decimal number optionally followed by a size letter (b, k, m) as in -c, or l to mean count by lines, or other option letters (cqv). Scripts intended for standard hosts should use -c COUNT or -n COUNT instead.

This is why the syntax is equivalent. man head doesn't tell you this, by the way.

share|improve this answer

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.