diff --git a/blog.md b/blog.md new file mode 100644 index 0000000..47bdd6d --- /dev/null +++ b/blog.md @@ -0,0 +1,40 @@ +# ps Command Examples + +## How to use ps command + +here's the syntax of the ps command:- + +``` +ps [options] +``` + +Here, +* ` [options] ` is used to fine-tune the output of the ps command as per your needs such as you can use the `-u` flag and append a username to it and display processes specific to that user. + +|Option|Description| +|--------------------|-----------------------------------------------------------------------------| +|`-e`|Show all processes, including those not associated with a terminal.| +|`-f`|Show full process information, including arguments.| +|`-u `|Show processes owned by a specific user.| +|`-x`|Show processes without a controlling terminal.| +|`-o `|Specify output format (PID, user, command, CPU usage, memory usage).| +|`--sort=`|Sort output by different parameters.| + + +
When we run mormal `ps` command without any options, it will only show the processes attached to the current terminal:
+![alt text](image.png) +

+ +## Some other ps commands ++ To get detailed information about each process + ``` + ps -ux + ``` + ![alt text](image-1.png) +

++ To show the running processes of every user + ``` + ps -ux + ``` + ![alt text](image-2.png) + diff --git a/image-1.png b/image-1.png new file mode 100644 index 0000000..4479180 Binary files /dev/null and b/image-1.png differ diff --git a/image-2.png b/image-2.png new file mode 100644 index 0000000..a3f5ae7 Binary files /dev/null and b/image-2.png differ diff --git a/image.png b/image.png new file mode 100644 index 0000000..3feed07 Binary files /dev/null and b/image.png differ