shell 文本文件的倒数行(尾部几行)

tail -n 3 file 显示文件内容的最后3行

  • -n <行数> 显示文件的尾部 n 行内容

tail 命令更多选项

  • -f 循环读取
  • -q 不显示处理信息
  • -v 显示详细的处理信息
  • -c<数目> 显示的字节数
  • –pid=PID 与-f合用,表示在进程ID,PID死掉之后结束
  • -q, –quiet, –silent 从不输出给出文件名的首部
  • -s, –sleep-interval=S 与-f合用,表示在每次反复的间隔休眠S秒

macOS 如何关闭自启动的后台服务进程

删除如下三个目录中的 .plist 文件,或转移到一个备份文件夹里。

  • ~/Library/LaunchAgents/
  • ~/Library/LaunchAgents/
  • ~/Library/LaunchDaemons/

Quote from ravbug.com:

OS to automatically run and re-launch headless background processes.
There are at minimum three such folders on macOS. They are: /Library/LaunchAgents, ~/Library/LaunchAgents/, and /Library/LaunchDaemons