在Debian系统中,使用nohup
命令运行程序时,日志通常会被输出到名为nohup.out
的文件中。如果你想要过滤这个日志文件中的内容,可以使用grep
命令。以下是一些常见的过滤示例:
grep '关键字' nohup.out
grep -v '关键字' nohup.out
grep -n '关键字' nohup.out
tail -f nohup.out | grep '关键字'
grep '2021-10-01' nohup.out
grep '[0-9]' nohup.out
你可以根据需要组合多个grep
选项和参数来实现更复杂的过滤需求。