查找某个时间段的日志,并导入到test.txt文件中
sed -n '/2018-01-08 14:38:51/,/2018-01-08 14:39:51/p' application.log > test.txt
查找日志前10条并导入到文件中
sed -n '10,20p' application.log > test.log
查看某个端口哪个使用
netstat -ap|grep 8063
查找大于100M的文件并删除
sudo find / -type f -size +100M
find / -name "*.log"
查看内存使用
free -m
sed -n '/2018-01-08 14:38:51/,/2018-01-08 14:39:51/p' application.log > test.txt
查找日志前10条并导入到文件中
sed -n '10,20p' application.log > test.log
查看某个端口哪个使用
netstat -ap|grep 8063
查找大于100M的文件并删除
sudo find / -type f -size +100M
find / -name "*.log"
查看内存使用
free -m
日志与系统管理技巧
本文介绍了如何通过命令行工具进行日志筛选、查看端口使用情况、查找并删除大文件以及检查内存使用等系统管理操作。
635

被折叠的 条评论
为什么被折叠?



