Linux ps命令详解程序员
2023-06-13 09:20:05 时间
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 【列出类似程序树的程序显示】
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
2993.html
服务器部署程序员系统优化网站设置运维相关文章
- linux命令vi编辑文档详解程序员
- Linux-命令-用户账户管理-useradd-passwd-chage详解程序员
- Linux命令之chgrp详解程序员
- Linux命令之rpm详解程序员
- Linux下查看文件权限的技巧(linux查看文件的权限)
- 安装Linux上的Redis服务器(linux安装redis)
- Linux快速入门(linux入门书籍)
- 恢复Linux系统磁盘空间的方法(linux磁盘空间)
- Unlock The Power of Linux Calculator Command(linux计算器命令)
- 掌握Linux进程管理的命令行技能(查看linux进程命令)
- Linux记录:记住命令的技巧(linux记录命令)
- 深入了解Linux系统:h 命令(linux-h命令)
- 探索Linux下CD命令的神奇之处(linux中cd命令)
- Linux命令:深入掌握使用技巧(linux命令使用技巧)
- 在Linux中顺利登录服务器(linux登陆服务器)
- Linux命令探索:读取文件(linux命令读取文件)
- Linux的分支:从Kernel及其他Berry选择(linux的分支)
- 管理Linux下的用户名管理策略(linux的用户名)
- 轻松学会 Linux 打包技巧:快速打包你的应用程序(linux如何打包)
- Linux数据库启动命令:快速配置您的数据库服务!(linux数据库启动命令)
- 海外Linux技术走向:发展趋势与前景展望(海外linux)
- Linux下实现文件复制的拷贝命令详解(linux中拷贝命令)
- 打造独一无二的Linux终端配色方案:如何修改你的终端配色(linux终端配色)
- 掌握Linux扫描命令,轻松搞定网络安全问题(linux扫描命令)
- Linux网络命令配置指南,轻松掌握网络管理技巧(linux配置网络命令)
- Linux下复制文件的神奇命令(linux 的复制命令)