fix command #last and add new commands for #System and #Others

This commit is contained in:
bonnie ng 2024-08-29 19:39:32 +00:00
parent 80c5012f38
commit 3199d638ae

View file

@ -1552,9 +1552,17 @@ stat filename.txt
ps aux
```
##### List processes by top memory usage
```bash
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head
```
##### Display a tree of processes
```bash
pstree
# or
ps aux --forest
```
##### Find maximum number of processes
@ -1960,7 +1968,7 @@ ldconfig -p
ldd /bin/ls
```
##### Check user login
##### Check the most recent login of all users
```bash
lastlog
```
@ -2273,7 +2281,12 @@ sar -f /var/log/sa/sa31|tail
journalctl --file ./log/journal/a90c18f62af546ccba02fa3734f00a04/system.journal --since "2020-02-11 00:00:00"
```
##### Show a listing of last logged in users.
##### Show a listing of last logged in users
```bash
last
```
##### Show a listing of unsuccessful (bad) login attempts
```bash
lastb
```
@ -2918,6 +2931,11 @@ cat >>myfile
let me add sth here
# exit with ctrl+d
# or
cat << EoF >> filename
> add something here
> EoF
# or using tee
tee -a myfile
let me add sth else here
@ -3287,6 +3305,12 @@ scp -r directoryname user@ip:/path/to/send
# :(){:|:&};:
```
##### Trigger kernel crash
```bash
# Don't try this at home!
echo c > /proc/sysrq-trigger
```
##### Use the last argument
```bash
!$