Skip to content

added blog #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions blog.md
Original file line number Diff line number Diff line change
@@ -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 <username>`|Show processes owned by a specific user.|
|`-x`|Show processes without a controlling terminal.|
|`-o <PID/USER/CMD/%CPU/%MEM>`|Specify output format (PID, user, command, CPU usage, memory usage).|
|`--sort=<parameter>`|Sort output by different parameters.|


<br>When we run mormal `ps` command without any options, it will only show the processes attached to the current terminal:<br>
![alt text](image.png)
<br><br>

## Some other ps commands
+ To get detailed information about each process
```
ps -ux
```
![alt text](image-1.png)
<br><br>
+ To show the running processes of every user
```
ps -ux
```
![alt text](image-2.png)

Binary file added image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.