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:

  1. top command : Display and update sorted information about processes.
  2. atop : Advanced System & Process Monitor.
  3. 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的更多相关文章

  1. Show tree of processes in linux

    pstree(1): tree of processes - Linux man pagehttps://linux.die.net/man/1/pstree How to view process ...

  2. What are long running processes?

    转自:https://blog.bernd-ruecker.com/what-are-long-running-processes-b3ee769f0a27 Some communities have ...

  3. 路由器逆向分析------Running Debian MIPS Linux in QEMU

    本文博客地址:http://blog.csdn.net/qq1084283172/article/details/70176583 下面的文章内容主要参考英文博客<Running Debian ...

  4. [原]Threads vs Processes in Linux 分析

    Linux中thread (light-weighted process) 跟process在實作上幾乎一樣. 最大的差異來自於,thread 會分享 virtual memory address s ...

  5. 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 ...

  6. Kill Processes in Linux

    Step 1: find processes to kill ps -ef | grep java Step 2: Kill the process based on process id kill ...

  7. 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 ...

  8. linux processes

    So that Linux can manage the processes in the system, each process is represented by a task_struct   ...

  9. Beginning Linux Programming 学习--chapter 11 Processes and Signals

     What's process--什么是进程? The UNIX standards, specifically IEEE Std 1003.1, 2004 Edition, defines a pr ...

随机推荐

  1. 数据库(学习整理)----2--关于Oracle用户权限的授权和收权

    知识点: 1.Oracle数据库中所用的用户等级是平级的!只是每个用户的权限不同而已! 2.在一个用户登录后,可以在自己的登录状态下访问其他用户的数据缓冲区.表.以及表的操作!(只要该用户用权限!) ...

  2. 召回率与准确率[ZZ]

    最近一直在做相关推荐方面的研究与应用工作,召回率与准确率这两个概念偶尔会遇到,知道意思,但是有时候要很清晰地向同学介绍则有点转不过弯来. 召回率和准确率是数据挖掘中预测.互联网中的搜索引擎等经常涉及的 ...

  3. Photon引擎开发实战(1)——Photon 简介

    Photon简介 Photon是一套使用广泛的socket server引擎,服务端底层C++编写,客户端C#编写,跨多平台,收费,效率可观的一款引擎.实用上前有九城游戏(原魔兽世界代理),现在笔者发 ...

  4. bootstrap上传表单的时候上传的数据默认是0 一定要小心

    bootstrap上传表单的时候上传的数据默认是0 一定要小心

  5. MySQL简单优化

    1:对 MySQL 优化是一个综合性的技术,主要包括:     a.标的设计合理(符合 3NF)     b.添加适当索引(index)(普通索引.主键索引.唯一索引 unique.全文索引)     ...

  6. 修改虚拟机linux硬盘的大小

    一.概述 Ubuntu用了一段时间,系统已从原来的4G增长到8G,导致虚拟磁盘不够用,需要修改虚拟硬盘的大小. 但是,修改虚拟机硬盘的大小不像修改内存那么简单,操作一个滑动条就轻松搞定.要知道虚拟硬盘 ...

  7. 目前最流行的网页自动运行EXE文件

    大家对木马都不陌生了,它可能要算是计算机病毒史上最厉害的了,相信会使木马的人千千万万,但是有很多人苦于怎么把木马发给对方,现在随着计算机的普及,在网络上我相信很少有人会再轻易的接收对方的文件了,所以网 ...

  8. 支付宝集成SDK 报错

    1.打开Demo中的错误 这是路径错误导致 解决办法:在Build Settings 中找到 Library Search Paths ,去掉其中的 /// 2.自己集成支付宝SDK时的错误 这个也是 ...

  9. cygwin使用

    Cygwin是一个在windows平台上运行的类UNIX模拟环境,是cygnus solutions公司开发的自由软件(该公司开发的著名工具还有eCos,不过现已被Redhat收购). 它对于学习UN ...

  10. 查看SQL Server数据库中各个表和视图的索引所占的空间大小

    ;with cte as ( (select t.name as TableName,i.name as IndexName, sum(row_count)as row_count, SUM (s.u ...