Show All Running Processes in Linux
ps由于历史的原因,所以很奇特,有些命令必须加"-",比如:
ps A
上面的写法是错误的
********* 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
[test@localhost smplayer]$ ps A
ERROR: Unsupported option (BSD syntax)
********* 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
How do I see all running process in Linux operating systems using command line or GUI options?
You need to use the ps
command. It provide information about the currently running processes,
including their process identification numbers (PIDs). Both Linux and
UNIX support the ps command to display information about all
running process. The ps command gives a snapshot of the current
processes. If you want a repetitive update of this status, use top,
atop, and/or htop command as described below.
Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | Yes |
Requirements | ps/top/htop |
Estimated completion time | 5 minutes |
Apart from ps command, you can also use the following commands to display info about processes on Linux:
- top command : Display and update sorted information about processes.
- atop : Advanced System & Process Monitor.
- htop : Interactive process viewer.
The ps command
Type the following ps command to display all running process:
# ps aux | less
Where,
- -A: select all processes
- a: select all processes on a terminal, including those of other users
- x: select processes without controlling ttys
Task: see every process on the system
# ps -A
# ps -e
上面两条命令是一样的
Task: See every process except those running as root
# ps -U root -u root -N
[test@localhost Documents]$ ps -U test|grep su
pts/ :: su
pts/ :: su
[test@localhost Documents]$ ps -u test|grep su
Task: See process run by user vivek
# ps -u vivek
Task: top command
The top program provides a dynamic real-time view of a running system. Type the top at command prompt:
# top
Output:

Fig.01: top command: Display Linux Tasks
To quit press q, for help press h.
Task: display a tree of processes
pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown.
$ pstree
Sample outputs:

Fig.02: pstree - Display a tree of processes
Task: Print a process tree using ps
# ps -ejH
# ps axjf
Task: Get info about threads
Type the following command:
# ps -ejH
# ps axjf
Task: Get info about threads
Type the following command:
Show All Running Processes in Linux的更多相关文章
- Show tree of processes in linux
pstree(1): tree of processes - Linux man pagehttps://linux.die.net/man/1/pstree How to view process ...
- What are long running processes?
转自:https://blog.bernd-ruecker.com/what-are-long-running-processes-b3ee769f0a27 Some communities have ...
- 路由器逆向分析------Running Debian MIPS Linux in QEMU
本文博客地址:http://blog.csdn.net/qq1084283172/article/details/70176583 下面的文章内容主要参考英文博客<Running Debian ...
- [原]Threads vs Processes in Linux 分析
Linux中thread (light-weighted process) 跟process在實作上幾乎一樣. 最大的差異來自於,thread 會分享 virtual memory address s ...
- check running processes in Ubuntu
Check processes If you want to see what processes are running use the command ps -ef If you want to ...
- Kill Processes in Linux
Step 1: find processes to kill ps -ef | grep java Step 2: Kill the process based on process id kill ...
- How do I Find Out Linux CPU Utilization?
From:http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html Whenever a Linux sys ...
- linux processes
So that Linux can manage the processes in the system, each process is represented by a task_struct ...
- Beginning Linux Programming 学习--chapter 11 Processes and Signals
What's process--什么是进程? The UNIX standards, specifically IEEE Std 1003.1, 2004 Edition, defines a pr ...
随机推荐
- Java中I/O的分析
Java中I/O的原理: 在java程序中,对于数据的输入/输出操作以”流“的方式进行的. 流是内存中一组有序数据序列 Java将数据从源读入到内存当中,形成了流,然后这些流可以写到目的地. Java ...
- Object-C — KVO & oc通知
键值观察(KVO)是基于键值编码的一种技术. 利用键值观察可以注册成为一个对象的观察者,在该对象的某个属性变化时收到通知. 被观察对象需要编写符合KVC标准的存取方法,编写键值观察分为以下三步: (1 ...
- js实现文件上传,删除效果
效果图: 刚开始: 点击按钮"选择更多后",可以添加很多选择文件: 点击按钮"删除"后: 实现代码: <!DOCTYPE html><html ...
- max取得数组的最大值
var arr = [1,2,3,4,5,2,2,4,52,5,6,5,4,4]; var maxNum = Math.max.apply(Math,arr); var maxIndex = arr. ...
- 在Windows下用MingW 4.5.2编译OpenCV 2.3.0
需要的工具:1.安装QT SDK环境2.安装CMake for Windows3.OpenCV最新Windows源码步骤:1.将QT SDK安装目录下的{QtSDK}\mingw\bin添加到系统环境 ...
- 网上流行的add(2)(3)(4)
网上有很多其他的各样的算法.其实这题就可以用javascript属性arguments.callee来实现,代码如下: function add(x){ var result=0; return fu ...
- yii2源码学习笔记(十六)
Module类的最后代码 /** * Registers sub-modules in the current module. * 注册子模块到当前模块 * Each sub-module shoul ...
- C#隐私信息(银行账户,身份证号码,名字)中间部分特殊字符替换(*)
最近做到一个关于银行的一个功能模块,需要将隐私信息银行账号中间部分用*代替,于是写下了,如下代码: /// <summary> /// 将传入的字符串中间部分字符替换成特殊字符 /// & ...
- hadoop 学习笔记 (十) mapreduce2.0
MapReduce的特色---不擅长的方面 >实时计算 像mysql一样,在毫秒级或者秒级内返回结果 >流式计算 Mapreduce的输入数据时静态的,不能动态变化 MapReduce自身 ...
- Contest20140709 testA 树型DP
testA 输入文件: testA.in 输出文件testA.out 时限5000ms 问题描述: 一棵树N个节点,每条边有一个距W,现在定义SUM为所有dist(X,Y)的和1<=X<Y ...