find 查找范围路径 根据指定目录递归的向下查找
如 find /home -name hello.txt 精确查找
find /home -name *.txt 模糊查找
按用户名 查找
find /home -user hadoop 按照 hadoop 这个用户来查找
按照文件大小来查找
find / -size +200M 大于
find / -size -200M 小于
find / -size -200M 等于
ls -lh 显示文件大小的时候 ,会更加容易读懂 单位
locate 快速定位文件位置 ,会事先创建一个数据库来实现定位, 无需遍历整个文件系统 ,查询快 , 但是 系统管理员需要定期 更新locate
第一次使用的时候 要执行 updatedb
which 可以查看某个命令在哪个目录下
如 [root@basic ~]# which ls
alias ls='ls --color=auto'
/usr/bin/ls
[root@basic ~]# which reboot
/usr/sbin/reboot
grep 过滤查找 ,通常和管道符 | 一起使用 ,一般是将前一个命令的处理结果传送给后面的指令处理
cat /home/hello.txt | grep "world" 在cat显示的hello.txt内容 中查找 yes
如果要显示行号 可以加 -n 参数 cat /home/hello.txt | grep -n "world"
还可以 grep -n "world" /home/hello.txt 反过来写不需要 管道符和 cat
忽略大小写 可以加上 -i 参数
2: 文件压缩和解压 指令gzip 只能将文件压缩为 .gz文件
gzip /home/hello.txt
gunzip 解压.gz 文件 gunzip xxx.gz
zip 压缩文件夹目录和文件 -r 表示递归压缩
zip -r my.zip /home 将home 目录压缩为一个 my.zip
unzip 解压.zip 文件 -d 表示指定解压到某个目录
upzip my.zip -d /opt/my 将 my.zip 解压到/opt/my
tar --help 查看查用的 打包命令参数
tar -zcvf xxxx.tar.gz /home/temp/hello.txt 将 /home/temp/hello.txt 将这个文件 压缩为 xxxx.tar.gz
tar -zxvf xxxx.tar.gz -C /opt/temp 将tar.gz 解压到 /opt/temp
3:组管理 和权限管理 (重点) 4: cron 定时任务 5: at 定时任务 6:磁盘 7:网络 8:进程 9:服务管理 10:动态监控 11:程序安装 12: 防火墙 13:其他查看虚拟机内核版本
[root@basic ~]# uname -a 内核版本
Linux basic 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@basic ~]# cat /etc/redhat-release centos 发行版本
CentOS Linux release 7.9.2009 (Core)
未完待续.......



