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

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Sign up for more great content!

>