摘要: # 保留最后 10000 行tail -n 10000 /path/to/test.log > /tmp/temp.log \&& mv /tmp/temp.log /path/to/test.log 原理是将大的日志文件取最后10000行放到一个临时文件, 然后将临时文件覆盖掉大的日志文件。 阅读全文
posted @ 2025-04-08 10:53 w6h5n 阅读(130) 评论(0) 推荐(0)
摘要: 备份的数据有点多,需要保留30天内的数据 1 预览文件,先确认 find . -type f -mtime +30 2 确认后执行删除(任选其一) find . -type f -mtime +30 -delete 或者 find . -type f -mtime +30 -exec rm {} \ 阅读全文
posted @ 2025-04-08 09:48 w6h5n 阅读(546) 评论(0) 推荐(0)
摘要: 在centos7中可以使用Conda在不破坏系统环境的情况下安装python多个环境,这里记录安装Python3.10的过程。 1 安装wget yum install wget 2 下载Miniconda安装脚本 wget https://repo.anaconda.com/miniconda/M 阅读全文
posted @ 2025-04-08 08:49 w6h5n 阅读(763) 评论(0) 推荐(0)