How Do You Skip the First Two Lines in Unix?
Contents

How do you skip the first few lines in Unix?

That is, if you want to skip N lines, you start printing line N+1. Example: $ tail -n +11 /tmp/myfile

How do I skip a line in bash?

Using head to get the first lines of a stream, and tail to get the last lines in a stream is intuitive. But if you need to skip the first few lines of a stream, then you use tail “-n +k” syntax. And to skip the last lines of a stream head “-n -k” syntax.

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest