How do I remove the first line from a file?
Answer
Then, we’ll test each solution on our big input file to remove the first line.
…
To benchmark their performance, we’ll use the time command:
Answer
Then, we’ll test each solution on our big input file to remove the first line.
…
To benchmark their performance, we’ll use the time command:
- The sed solution: time sed ‘1d’ big. txt > /dev/null.
- The awk solution: time awk ‘NR>1’ big. txt > /dev/null.
- The tail solution: time tail -n +2 big. txt > /dev/null.