Advertisement
flycat

Head, tail examples

Feb 17th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.17 KB | None | 0 0
  1. # First 2 lines of file
  2. head -n 2 <file>
  3.  
  4. # Last 2 lines of file
  5. tail -n 2 <file>
  6.  
  7. # File w/o first 2 lines
  8. tail -n +3 <file>
  9.  
  10. # File w/o last 2 lines
  11. head -n -2 <file>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement