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
精彩评论