原帖由 sandermansxj 于 2009-10-15 11:42 发表
# 删除文件中的最后10行
sed -e :a -e '$d;N;2,10ba' -e 'P;D' # 方法1
sed -n -e :a -e '1,10!{P;N;D;};N;ba' # 方法2
原帖由 lucash 于 2009-10-15 16:45 发表
找到了是这个
dd of=urfile seek=1 bs=$(($(stat -c%s urfile)-$(tail -1 urfile|wc -c)))
原帖由 r2007 于 2009-10-15 20:51 发表
#!/usr/bin/perl
use strict;
use warnings;
# For the SEEK_* constants
use Fcntl qw(:seek);
use File::ReadBackwards;
my $LINES = 10; # Change to 125_000 or whatever
my $File = shif ...
原帖由 Shell_HAT 于 2009-10-15 21:15 发表
这里:
http://bbs.chinaunix.net/viewthread.php?tid=1459945
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |