lipc1 doc: ps command
This commit is contained in:
65
Linux/LPIC1/16-ps.md
Normal file
65
Linux/LPIC1/16-ps.md
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
# ⚙️ PS Command
|
||||||
|
|
||||||
|
The `ps` (process status) command is used to **view running processes** on a Linux system. It’s useful for monitoring and troubleshooting tasks.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧾 Basic Usage
|
||||||
|
|
||||||
|
### 🔍 Show tasks in the current shell
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ps
|
||||||
|
```
|
||||||
|
|
||||||
|
### 🔍 Show tasks in the current shell with **full info**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ps -f
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🌍 View System-Wide Processes
|
||||||
|
|
||||||
|
### 📋 Show **all** processes
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ps -A
|
||||||
|
# or
|
||||||
|
ps -e
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 👤 Show tasks by **specific user**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ps -u <username>
|
||||||
|
```
|
||||||
|
|
||||||
|
📌 Replace `<username>` with the actual user name.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 📊 Show **detailed info for all** tasks
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ps aux
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📘 Output Fields Explained
|
||||||
|
|
||||||
|
| Column | Description |
|
||||||
|
| --------- | -------------------------------------------------- |
|
||||||
|
| `USER` | Owner of the process (often `root` or your user) |
|
||||||
|
| `PID` | Process ID |
|
||||||
|
| `%CPU` | CPU usage percentage |
|
||||||
|
| `%MEM` | Memory usage percentage |
|
||||||
|
| `STAT` | Process state: `R` (running), `S` (sleeping), etc. |
|
||||||
|
| `START` | Time when the process started |
|
||||||
|
| `TIME` | Total CPU time used |
|
||||||
|
| `COMMAND` | Command that started the process |
|
||||||
|
|
||||||
Reference in New Issue
Block a user