wfxr
4/11/2017 - 3:34 AM

删除文件的最后6行

删除文件的最后6行

tac filename | sed '1,6d' | tac > filename
# or
tail -r filename | sed '1,6d' | tail -r > filename
# or
head -n -6 filename > filename # not work on osx