问题原文
原帖链接 · Roger · CC BY-SA 3.0
I need to search something in a huge log-file (over 14 GB). I'm pretty sure it's in the last 4 GB or so.
Is there a way to skip the first X GB to speed things up?
已采纳解答
原帖链接 · user9517 · CC BY-SA 3.0
I guess you could use tail to only output that last 4GB or so by using the -c switch
-c, --bytes=[+]NUM
output the last NUM bytes; or use -c +NUM to output starting with byte NUM of each file
You could probably do something with dd too by setting bs=1 and skiping to the offset you want to start e.g.
dd if=file bs=1024k skip=12g | grep something
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
