Skip to content

Instantly share code, notes, and snippets.

@zdev0x
Last active October 21, 2021 03:19
Show Gist options
  • Select an option

  • Save zdev0x/50250d1f94a8f70df3042fc506f8b1ca to your computer and use it in GitHub Desktop.

Select an option

Save zdev0x/50250d1f94a8f70df3042fc506f8b1ca to your computer and use it in GitHub Desktop.
  1. Linux kill包含关键字所有进程

ps aux|grep keywords |awk '{print $2}'|xargs kill -9

  1. top命令
  • c 切换显示命令名称和完整命令行
  • l 切换显示平均负载和启动时间信息
  • m 切换显示内存信息
  • t 切换显示进程和CPU状态信息
  • M 根据驻留内存大小进行排序
  • P 根据CPU使用百分比大小进行排序
  • T 根据时间/累计时间进行排序
  • h 显示帮助画面,给出一些简短的命令总结说明
  • k 终止一个进程。
  • i 忽略闲置和僵死进程。这是一个开关式命令。
  • q 退出程序
  • r 重新安排一个进程的优先级别
  • S 切换到累计模式
  • s 改变两次刷新之间的延迟时间(单位为s),如果有小数,就换算成m s。输入0值则系统将不断刷新,默认值是5 s
  • f或者F 从当前显示中添加或者删除项目
  • o或者O 改变显示项目的顺序
  1. find命令

find . -type f -name "*.php" | xargs grep "6479"

  1. ps命令

ps -e -o 'pid,comm,args,pcpu,rsz,vsz,stime,user,uid' 其中rsz是是实际内存
ps -e -o 'pid,comm,args,pcpu,rsz,vsz,stime,user,uid' | grep oracle | sort -nrk5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment