df -h 显示云盘总大小
pm2 list 查看运行中的守护进程
pm2 restart 0 重启某个进程
rm -rf 删除文件夹
//查找包含
find /path/to/directory -type f -mtime +7 -delete 按照时间删除文件
find -type f -name "*.php"
/public -name "*.js" | xargs grep -n "yt.js"
//查找大小
du -m -s -- *|sort -rn | head 前十个
du -s -- *|sort -rn (防止目录中有-开头的)
du -sh *|sort -h
caddy命令
# 重载配置文件
sudo systemctl daemon-reload
# 设置 caddy 开机自启
sudo systemctl enable caddy.service
# 查看是否启动成功,这里因为没启动应该显示 Active: inactive (dead)
sudo systemctl status caddy
# 启动 caddy
sudo systemctl start caddy
# 过十秒钟左右再次查看 caddy 状态
sudo systemctl status caddy
# 重启命令
sudo systemctl restart caddy
# 停止命令
sudo systemctl stop caddy
netstat -ntlp //查看当前所有tcp端口·
netstat -ntulp |grep 80 //查看所有80端口使用情况·
netstat -an | grep 3306 //查看所有3306端口使用情况·
find -name .. 查找命令
grep -rn "hello,world!" ** : 表示当前目录所有文件,也可以是某个文件名
nginx -s reload 平滑重启nginx
reboot 重启服务器
uname -a (Linux查看版本当前操作系统内核信息)Linux localhost.localdomain 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 athlon i386 GNU/Linux
# cat /proc/version (Linux查看当前操作系统版本信息)
Linux version 2.4.20-8 (bhcompile@porky.devel.redhat.com)
(gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Thu Mar 13 17:54:28 EST 2003
# cat /etc/issue 或cat /etc/redhat-release(Linux查看版本当前操作系统发行版信息)
Red Hat Linux release 9 (Shrike)
# cat /proc/cpuinfo (Linux查看cpu相关信息,包括型号、主频、内核信息等)
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 1
model name : AMD A4-3300M APU with Radeon(tm) HD Graphics
stepping : 0
cpu MHz : 1896.236
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr
sse sse2 syscall mmxext lm 3dnowext 3dnow
bogomips : 3774.87
# getconf LONG_BIT (Linux查看版本说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit)
# lsb_release -a