差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
it:server:shell_command [2022-08-13 05:27] – [systemctl] goldentianyait:server:shell_command [2023-10-12 19:05] (当前版本) – [文件命令] goldentianya
行 58: 行 58:
 find /home -name *.jpg find /home -name *.jpg
 find . -type f -empty find . -type f -empty
 +find ./ -type f -name "*0325*" // 文件名中含有 0325 的文件
 </code> </code>
 +
 +查找并删除
 +  find . -type f -name "*.DS_Store*" -exec rm -f {} \;
  
 {{tag>文件系统}} {{tag>文件系统}}
行 163: 行 167:
 </code> </code>
  
 +===== Htop =====
  
 +交互命令 (([[https://cloud.tencent.com/developer/article/1115041|htop 详解]]))
 +  * shift + m 按内存大小排序
 +    * M:按照内存使用百分比排序,对应MEM%列;
 +    * P:按照CPU使用百分比排序,对应CPU%列;
 +    * T:按照进程运行的时间排序,对应TIME+列;
 +    * K:隐藏内核线程;
 +    * H:隐藏用户线程;
 +  * shift + h 收缩线程
 +  * q         退出
 +
 +===== 端口映射 =====
 +
 +<code>
 +// 查看已经连接的服务端口(ESTABLISHED)
 +netstat -a
 +// 查看所有的服务端口(LISTEN,ESTABLISHED)
 +netstat -ap
 +// 查看指定端口,可以结合grep命令:
 +netstat -ap | grep 8080
 +// 也可以使用lsof命令:
 +lsof -i:8888
 +// 若要关闭使用这个端口的程序,使用kill + 对应的pid
 +kill -9 PID号
 +</code>
 +
 +===== CURL RESTfull =====
 +用CURL 发送 post 命令
 +
 +参数 -d 指定数据
 +  curl -X POST -d "name=John&age=30" https://example.com/api
 +  
 +还可以指定数据类型
 +<code bash>
 +curl -X POST -H "Content-Type: application/json" -d '{"name":"John","age":30}' https://example.com/api
 +</code>
 +
 +发送邮件
 +<code>
 +curl --url "smtps://smtp.example.com:465" \
 +     --ssl-reqd \
 +     --mail-from "[email protected]" \
 +     --mail-rcpt "[email protected]" \
 +     --user "username:password" \
 +     --upload-file - <<EOF
 +
 +Subject: Test Email
 +From: [email protected]
 +To: [email protected]
 +
 +Dies ist eine Test-E-Mail, die von curl gesendet wurde.
 +EOF
 +</code>
it/server/shell_command.1660368422.txt.gz · 最后更改: 2022-08-13 05:27 由 goldentianya
回到顶部
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0