查询内核信息
uname -a
cat /etc/os-release
cat /etc/*release
cat /etc/issue
lsb_release -a
读取磁盘大小
df -h
查询当前目录文件大小
du -h --max-depth=1 ./ | sort -h
du -sh ./* | sort -h
显示目录的磁盘使用情况
du -sh .
显示内存占用情况
free -h
查找并列出目录中按大小排序前10的最大文件
find ./ -type f -exec ls -lh {} +| awk '{ print $5, $9 }'| sort -hr | head -n 10
显示当前目录及其子目录中最大的10个文件
du -ah . | sort -rh | grep '^ *[0-9\.]\+G'| head -n 10
递归搜索目录中文件中的特定字符串
grep -r "search_string" /path/to/directory
显示日志文件的最后 100 行
tail -n 100 /path/to/logfile.log
监控日志文件的实时更新
tail -f /path/to/logfile.log
生成Linux公钥钥
ssh-keygen -t rsa
ssh-copy-id root@192.168.0.42
时间校对
ntpdate ntp.aliyun.com