我正在 OSX(unix) 环境中编写一个 shell 脚本。我有一个名为 test.properties
的文件具有以下内容:cat test.properties
得到以下输出:
//This file is intended for
//blah blah purposes
123
使用
cat
命令,我怎样才能只得到文件的最后一行?
最佳答案
请勿使用 cat
. tail
完全适用于这个用例:
$ tail -1 ./test.properties
关于macos - 如何使用cat命令获取文件的最后一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40108569/