开发者

Unix command to copy last line of file to another file

Please provide a command to append an ex开发者_如何学Goisting file by taking a last line of another file.


tail -n 1 $file1 >> $file2

Though most systems also support

tail -1 $file1 >> $file2


tail $file1 -n 1 >> $file2

Or,

tail -1 $file1 >> $file2

If you want it to work with sudo:

tail -1 $file1 | tee -a $file2
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜