tree、find、tail命令重要实战

tree -L 1 -d

ln -s ext msn  创建软连接

ls -lF| sed -n‘/^d/p’

ls -lF|awk ‘/^d’

ls -lrt  按时间倒着排

vi /etc/profile 加 alias grep=’grep --color=auto’

. /etc/profile 改颜色

Find /oldboy/test/ -type f -name “access*.log” -mtime -7   最近7天

Find /oldboy/test/ -type f -name “access*.log” -mtime +7  7天以前

Find /oldboy/test/ -type f -name “access*.log” -mtime +7|xarg rm -f

Find /oldboy/test/ -type f -name “access*.log” -mtime +7 -exec rm -f {} \;

          -mtime 修改时间

          -ctime change过的文档

          -atime access过的文档

 

tail -f /var/log/messages  跟踪文件结尾变化

tail  /var/log/messages

tail -F /var/log/messages

posted on 2016-07-11 13:28  王波波的波  阅读(378)  评论(0编辑  收藏  举报