add 'system' section

1. Eliminate the zombie
2. Show memory usage
This commit is contained in:
Bonnie I-Man Ng 2019-07-09 10:49:04 +08:00 committed by GitHub
parent ef9141b0a3
commit 0f1f62f507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1244,6 +1244,22 @@ xcowsay
## System ## System
[[back to top](#handy-bash-one-liners)] [[back to top](#handy-bash-one-liners)]
##### Eliminate the zombie
```bash
# A zombie is already dead, so you cannot kill it. You can eliminate the zombie by killing its parent.
# First, find PID of the zombie
ps aux| grep 'Z'
# Next find the PID of zombie's parent
pstree -p -s <zombie_PID>
# Then you can kill its parent and you will notice the zombie is gone.
sudo kill 9 <parent_PID>
```
###### Show memory usage
```bash
free -c 10 -mhs 1
# print 10 times, at 1 second interval
```
##### Display CPU and IO statistics for devices and partitions. ##### Display CPU and IO statistics for devices and partitions.
```bash ```bash
# refresh every second # refresh every second