如何使用 bash/sed 腳本刪除文本文件的第一行? - How can I remove the first line of a text file using bash/sed script?

問題:

I need to repeatedly remove the first line from a huge text file using a bash script.我需要使用 bash 腳本從巨大的文本文件中重複刪除第一行。

Right now I am using sed -i -e "1d" $FILE - but it takes around a minute to do the deletion.現在我正在使用sed -i -e "1d" $FILE - 但是刪除大約需要一分鐘。

Is there a more efficient way to accomplish this?有沒有更有效的方法來實現這一目標?


解決方案:

參考一: https://en.stackoom.com/question/1QJX
參考二: https://stackoom.com/question/1QJX
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章