Linux, programming, computers and life

September 12, 2007

delete first and last lines from a file using sed

Filed under: CLI, programming, awk

I tried do do it using awk, but i did not find an easy way to determine the last line in file. So sed did the trick:

cat myFile | sed '1 {d}; $ {d}' > myNewFile

Technorati Tags: , , ,

Get free blog up and running in minutes with Blogsome
Theme designed by Gary Rogers