How to Use Awk to Remove the First Line of a File

Printer-friendly versionPDF version
How to Use Awk to Remove the First Line of a File

Awk is a versatile pattern scanning application, installed by default on most Linux distributions. If you have Ubuntu, Debian, or openSUSE, it's already installed. You can use Awk to easily remove the first line or row of a text file. To do so, just run the following one-liner command. Make sure to specify the source file, and the file you want the processed data to go to:

awk '{if(NR>1)print}' source_file.txt > processed_file.txt

 

Post new comment