Difference between revisions of "Ps"

From Linuxintro
imported>ThorstenStaerk
(New page: ps is a command to list all processes. You can invoke it like this: ps ps -A ps -ef ps -auxf)
 
imported>ThorstenStaerk
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
ps is a [[command]] to list all processes. You can invoke it like this:
+
ps is a [[command]] to list all [[processes]]. You can invoke it like this:
 
  ps
 
  ps
 
  ps -A
 
  ps -A
 
  ps -ef
 
  ps -ef
 
  ps -auxf
 
  ps -auxf
 +
 +
= Usecases =
 +
* Show all running processes:
 +
ps auxf | grep -E "^[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +R"
 +
* Show the top cpu-consuming processes:
 +
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
 +
* Show ''since when'' a process is running:
 +
ps -ef
 +
[...]
 +
root    12228 23543  0 '''''10:27''''' pts/10  00:00:00 /bin/bash
 +
[...]
 +
 +
= See also =
 +
* [http://www.manpagez.com/man/1/ps/ ps' man page]

Latest revision as of 08:43, 24 April 2014

ps is a command to list all processes. You can invoke it like this:

ps
ps -A
ps -ef
ps -auxf

Usecases

  • Show all running processes:
ps auxf | grep -E "^[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +R"
  • Show the top cpu-consuming processes:
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
  • Show since when a process is running:
ps -ef 
[...]
root     12228 23543  0 10:27 pts/10   00:00:00 /bin/bash
[...]

See also