If you need to easily remove or keep the line at the beginning of the file you should use awk , it`s a powerful tool for simple or complex text manipulation.

1

Here is an example to show you how to REMOVE the line 1 to 4 of a file.
cat file | awk 'NR>4'

2

Here is an example to show you how to KEEP the line 1 to 4 of a file.
cat file | awk 'NR<=4'
NR in awk means : Number of Rows.

About the Author

Stephane Morin

Sign up for more great content!