The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 17,543ā€…    Votes:  15ā€…    āœ… Solution
Tags: scripts   sed   tail  
Link: šŸ” See Original Question on Ask Ubuntu ā§‰ šŸ”—

URL: https://askubuntu.com/q/862804
Title: Which is faster to delete first line in file... sed or tail?
ID: /2016/12/20/Which-is-faster-to-delete-first-line-in-file/Which-is-faster-to-delete-first-line-in-file...-sed-or-tail_
Created: December 20, 2016    Edited:  April 13, 2017
Upload: September 15, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


In this answer (How can I remove the first line of a file with sed?) there are two ways to delete the first record in a file:

sed '1d' $file >> headerless.txt

** ā€”ā€”ā€”ā€”ā€”- OR ā€”ā€”ā€”ā€”ā€”-**

tail -n +2 $file >> headerless.txt

Personally I think the tail option is cosmetically more pleasing and more readable but probably because Iā€™m sed-challenged.

Which method is fastest?

ā‡§ Why is this 'eject' icon showing next to my drive? Crontab not working @reboot with macchanger  ā‡©