[root@localhost /]# find /chenyandan/xiaochen/ -type d 按文件目录类型查找
/chenyandan/xiaochen/
/chenyandan/xiaochen/cyd
[root@localhost /]# find /chenyandan/xiaochen/ -type f 按文件查找
/chenyandan/xiaochen/a
/chenyandan/xiaochen/c
/chenyandan/xiaochen/b
[root@localhost /]# find /chenyandan/ -size +1M 按文件大小查找
/chenyandan/apache-tomcat-7.0.56/webapps/cms.war
/chenyandan/apache-tomcat-7.0.56/webapps/cms/WEB-INF/lib/druid-0.2.15.jar
/chenyandan/apache-tomcat-7.0.56/webapps/cms/WEB-INF/lib/aspectjweaver-1.6.11.jar
[root@localhost chenyandan]# find /chenyandan/ -mtime +1 ---目录下文件的“更改时间”在 1 天之前的绝对路径
[root@localhost chenyandan]# find . -mtime -1 ---目录下文件的“更改时间”在 1 天之内的绝对路径
[root@localhost /]# find /chenyandan/xiaochen/ -name laowang 根据名字查找
[root@localhost xiaochen]# find /chenyandan/xiaochen/ -name laol*
/chenyandan/xiaochen/laoliu “*”表示 0 个或多个字符匹配
[root@localhost /]# find / -name laol?? “?”表示单个字符匹配,
ps -ef|grep 服务名称/端口号 :查看服务是否开启或者查看指定的端口号
wc :统计文本中行数、字数、字符数
nl:显示多少行行号,并且每行内容也显示
ln 创建链接文件 [ln -s 软连接(解决对路径);ln -d 硬连接(只能针对文件,不能对目录操作)
more、less分页显示文本文件内容
head、tail 显示文件头、尾的内容
例:从第3000行开始显示,显示1000行。即显示3000-3999行
cat filename | tail -n +3000 | head -n 1000
显示1000行到3000行
cat filename | head -n 3000 | tail -n +1000
分解:
tail -n 1000 : 显示最后1000行
tail -n +1000:从1000行开始显示,显示1000行以后的
head -n 1000:显示前面1000行
date 显示时间
date -s '2016-09-01 11:27:00' :root 用户修改系统时间