mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-12-22 08:16:36 +00:00
fix command #last and add new commands for #System and #Others
This commit is contained in:
parent
80c5012f38
commit
3199d638ae
28
README.md
28
README.md
@ -1552,9 +1552,17 @@ stat filename.txt
|
|||||||
ps aux
|
ps aux
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### List processes by top memory usage
|
||||||
|
```bash
|
||||||
|
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head
|
||||||
|
```
|
||||||
|
|
||||||
##### Display a tree of processes
|
##### Display a tree of processes
|
||||||
```bash
|
```bash
|
||||||
pstree
|
pstree
|
||||||
|
|
||||||
|
# or
|
||||||
|
ps aux --forest
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Find maximum number of processes
|
##### Find maximum number of processes
|
||||||
@ -1960,7 +1968,7 @@ ldconfig -p
|
|||||||
ldd /bin/ls
|
ldd /bin/ls
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Check user login
|
##### Check the most recent login of all users
|
||||||
```bash
|
```bash
|
||||||
lastlog
|
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"
|
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
|
```bash
|
||||||
lastb
|
lastb
|
||||||
```
|
```
|
||||||
@ -2918,6 +2931,11 @@ cat >>myfile
|
|||||||
let me add sth here
|
let me add sth here
|
||||||
# exit with ctrl+d
|
# exit with ctrl+d
|
||||||
|
|
||||||
|
# or
|
||||||
|
cat << EoF >> filename
|
||||||
|
> add something here
|
||||||
|
> EoF
|
||||||
|
|
||||||
# or using tee
|
# or using tee
|
||||||
tee -a myfile
|
tee -a myfile
|
||||||
let me add sth else here
|
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
|
##### Use the last argument
|
||||||
```bash
|
```bash
|
||||||
!$
|
!$
|
||||||
|
Loading…
Reference in New Issue
Block a user