linux - 对大文件的操作(86G) big file

访问量: 5

refer to:

我希望把一个巨大的文件的第一行删掉。

豆包给的方法;

sed

sed -i '1d' /opt/app/source_file/Zynga_BF/data/Zynga.com.sql

awk

awk 'NR>1' /opt/app/source_file/Zynga_BF/data/Zynga.com.sql > /opt/app/source_file/Zynga_BF/data/Zynga.com.sql.new
mv /opt/app/source_file/Zynga_BF/data/Zynga.com.sql.new /opt/app/source_file/Zynga_BF/data/Zynga.com.sql

tail 

tail -n +2 /opt/app/source_file/Zynga_BF/data/Zynga.com.sql > /opt/app/source_file/Zynga_BF/data/Zynga.com.sql.new
mv /opt/app/source_file/Zynga_BF/data/Zynga.com.sql.new /opt/app/source_file/Zynga_BF/data/Zynga.com.sql

都没有特别直接的修改。

sed 完成该操作,花费了30分钟。

订阅/RSS Feed

Subscribe