差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
it:server:shell_command [2022-07-15 13:03] – [文件命令] goldentianya | it:server:shell_command [2023-10-12 19:05] (当前版本) – [文件命令] goldentianya | ||
---|---|---|---|
行 35: | 行 35: | ||
uname -a # 显示所有信息 | uname -a # 显示所有信息 | ||
Linux pi 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l GNU/Linux | Linux pi 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l GNU/Linux | ||
+ | cat / | ||
+ | # Linux version 5.4.0-77-generic (buildd@lgw01-amd64-028) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021 | ||
</ | </ | ||
行 56: | 行 58: | ||
find /home -name *.jpg | find /home -name *.jpg | ||
find . -type f -empty | find . -type f -empty | ||
+ | find ./ -type f -name " | ||
</ | </ | ||
+ | |||
+ | 查找并删除 | ||
+ | find . -type f -name " | ||
{{tag> | {{tag> | ||
行 145: | 行 151: | ||
</ | </ | ||
+ | ===== systemctl ===== | ||
+ | <code bash> | ||
+ | # 列出所有已经加载的systemd units | ||
+ | systemctl | ||
+ | systemctl | grep docker.service | ||
+ | # 列出所有service | ||
+ | systemctl list-units --type=service | ||
+ | systemctl --type=service | ||
+ | # | ||
+ | systemctl list-units --type=service --state=active | ||
+ | # 列出所有正在运行的服务 | ||
+ | systemctl list-units --type=service --state=running | ||
+ | systemctl list-units --type service --state running, | ||
+ | systemctl list-unit-files --state=enabled | ||
+ | </ | ||
+ | ===== Htop ===== | ||
+ | |||
+ | 交互命令 (([[https:// | ||
+ | * shift + m 按内存大小排序 | ||
+ | * M:按照内存使用百分比排序,对应MEM%列; | ||
+ | * P:按照CPU使用百分比排序,对应CPU%列; | ||
+ | * T:按照进程运行的时间排序,对应TIME+列; | ||
+ | * K:隐藏内核线程; | ||
+ | * H:隐藏用户线程; | ||
+ | * shift + h 收缩线程 | ||
+ | * q | ||
+ | |||
+ | ===== 端口映射 ===== | ||
+ | |||
+ | < | ||
+ | // 查看已经连接的服务端口(ESTABLISHED) | ||
+ | netstat -a | ||
+ | // 查看所有的服务端口(LISTEN,ESTABLISHED) | ||
+ | netstat -ap | ||
+ | // 查看指定端口,可以结合grep命令: | ||
+ | netstat -ap | grep 8080 | ||
+ | // 也可以使用lsof命令: | ||
+ | lsof -i:8888 | ||
+ | // 若要关闭使用这个端口的程序,使用kill + 对应的pid | ||
+ | kill -9 PID号 | ||
+ | </ | ||
+ | |||
+ | ===== CURL RESTfull ===== | ||
+ | 用CURL 发送 post 命令 | ||
+ | |||
+ | 参数 -d 指定数据 | ||
+ | curl -X POST -d " | ||
+ | | ||
+ | 还可以指定数据类型 | ||
+ | <code bash> | ||
+ | curl -X POST -H " | ||
+ | </ | ||
+ | |||
+ | 发送邮件 | ||
+ | < | ||
+ | curl --url " | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Subject: Test Email | ||
+ | From: [email protected] | ||
+ | To: [email protected] | ||
+ | |||
+ | Dies ist eine Test-E-Mail, | ||
+ | EOF | ||
+ | </ |