問題:
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