Operating System - Linux
1752591 Members
2976 Online
108788 Solutions
New Discussion юеВ

Cut first 3 lines of a file?

 
SOLVED
Go to solution
Coolmar
Esteemed Contributor

Cut first 3 lines of a file?

How can I remove/cut the first three lines out of a file?

Thanks,
4 REPLIES 4
Rick Garland
Honored Contributor
Solution

Re: Cut first 3 lines of a file?

1 way is to pipe thru sed
cat $FILE | sed -e '1,3d'

James R. Ferguson
Acclaimed Contributor

Re: Cut first 3 lines of a file?

Hi:

# sed -ne '4,$p' file

...prints a file minus the first three lines (numbered from *one*.

Regards!

...JRF...
Coolmar
Esteemed Contributor

Re: Cut first 3 lines of a file?

Thanks!
Denver Osborn
Honored Contributor

Re: Cut first 3 lines of a file?

awk 'NR > 3' file

-denver