Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tailing everything but the first line 3

Status
Not open for further replies.

Petemush

Technical User
Jun 21, 2002
255
GB
Hello again!

Does anyone know how to return an entire file apart from the first line? Like using tail?

So I have a file:

1233
125457
123214235
213123

and I want the following returned:

125457
123214235
213123

Cheers,
 
The awk way:
awk 'NR>1' /path/to/file
The tail way:
tail +2l /path/to/file

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
bigoldbulldog's first is simply elegant.
the second, need sed knowledge...

:) guggach
 
Thanks everyone for that, and there was me thinking there wasn't even one way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top