Linux ps命令详解
2023-09-11 14:20:11 时间
ps命令是Process Status的缩写, 用来列出系统中当前运行的那些进程. ps命令列出的是当前那些进程的快照,就是执行ps命令的那个时刻的那些进程,如果想要动态的显示进程信息,就可以使用top命令
ps常见命令参数
********* simple selection ********* ********* selection by list ********* -A all processes -C by command name -N negate selection -G by real group ID (supports names) -a all w/ tty except session leaders -U by real user ID (supports names) -d all except session leaders -g by session OR by effective group name -e all processes -p by process ID T all processes on this terminal -s processes in the sessions given a all w/ tty, including other users -t by tty g OBSOLETE -- DO NOT USE -u by effective user ID (supports names) r only running processes U processes for specified users x processes w/o controlling ttys t by tty *********** output format ********** *********** long options *********** -o,o user-defined -f full --Group --User --pid --cols --ppid -j,j job control s signal --group --user --sid --rows --info -O,O preloaded -o v virtual memory --cumulative --format --deselect -l,l long u user-oriented --sort --tty --forest --version -F extra full X registers --heading --no-heading --context ********* misc options ********* -V,V show version L list format codes f ASCII art forest -m,m,-L,-T,H threads S children in sum -y change -l format -M,Z security data c true command name -c scheduling class -w,w wide output n numeric WCHAN,UID -H process hierarchy
常用的命令展示
ps -ef ps -aux 【列出目前所有的正在内存当中的程序】 ps -u root ps -l 【将目前属于您自己这次登入的 PID 与相关信息列示出来】
ps -axjf 【列出类似程序树的程序显示】
linux上进程有5种状态
1. 运行(正在运行或在运行队列中等待)
2. 中断(休眠中, 受阻, 在等待某个条件的形成或接受到信号)
3. 不可中断(收到信号不唤醒和不可运行, 进程必须等待直到有中断发生)
4. 僵死(进程已终止, 但进程描述符存在, 直到父进程调用wait4()系统调用后释放)
5. 停止(进程收到SIGSTOP, SIGSTP, SIGTIN, SIGTOU信号后停止运行运行)
ps工具标识进程的5种状态码
D 不可中断 uninterruptible sleep (usually IO)
R 运行 runnable (on run queue)
S 中断 sleeping
T 停止 traced or stopped
Z 僵死 a defunct (”zombie”) process
相关文章
- linux sort,uniq,cut,wc命令详解
- linux pmap命令
- linux学习之使用fdisk命令进行磁盘分区(八)
- linux命令
- Linux 定时任务 Crontab命令 详解
- linux shell 脚本攻略学习8---md5校验,sort排序,uniq命令详解
- Linux命令可以在后台运行,不随shell的关闭而关闭
- 【问题解决方案】Linux中命令useradd与adduser的区别
- linux命令中的字符串中间增加指令,例如路径中增加日期变量,实时获取当前的日期
- linux之dd命令
- linux的mount(挂载)命令详解
- Linux下获取详细硬件信息的工具:Dmidecode命令详解
- 重新点亮linux 命令树————网络管理[十一二]
- linux命令中的字符串中间增加指令,例如路径中增加日期变量,实时获取当前的日期
- Kali Linux系统apt命令详解
- Linux网络管理相关命令详解
- 【网址收藏】Linux 命令分类(debian Linux)
- Linux 0.11-用键盘输入一条命令-42
- 【Linux】linux经常使用基本命令
- Linux shell sed 命令详解
- L81.linux命令每日一练 -- 第11章 Linux系统管理命令 -- ethtool和mii-tool
- L50.linux命令每日一练 -- 第八章 Linux磁盘与文件系统管理命令 -- tune2fs和parted
- L49.linux命令每日一练 -- 第八章 Linux磁盘与文件系统管理命令 -- fdisk和partprobe
- L2.linux命令每日一练 -- 第一章 Linux命令行简介
- 实战|掌握Linux内存监视:free命令详解与使用技巧
- Linux基础命令-seq打印数字序列
- Linux软连接和硬链接
- Linux基础笔记10 | 文件查找命令 find 详解
- Linux云计算-07_Linux文件服务器之vsftpd服务器
- Linux下用 FFMPEG 采集 usb摄像头视频 和 摄像头内置麦克风音频 到RTMP服务 命令详解