mirror of
https://github.com/trimstray/the-book-of-secret-knowledge
synced 2024-12-27 09:58:30 +01:00
added new one-liners
- signed-off-by: trimstray <trimstray@gmail.com>
This commit is contained in:
parent
142cebc6c9
commit
e311d6dbe2
1 changed files with 21 additions and 0 deletions
21
README.md
21
README.md
|
@ -1328,6 +1328,12 @@ awk '{ if($7 > 1048576) print $7/1048576 "MB" " " $9 " " $1 }' | \
|
||||||
sort -n -u | tail | column -t
|
sort -n -u | tail | column -t
|
||||||
```
|
```
|
||||||
|
|
||||||
|
###### Get the path of a process
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lsof -p <PID> | grep cwd
|
||||||
|
```
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
##### Tool: [ps](https://en.wikipedia.org/wiki/Ps_(Unix))
|
##### Tool: [ps](https://en.wikipedia.org/wiki/Ps_(Unix))
|
||||||
|
@ -1344,6 +1350,12 @@ ps awwfux | less -S
|
||||||
ps hax -o user | sort | uniq -c | sort -r
|
ps hax -o user | sort | uniq -c | sort -r
|
||||||
```
|
```
|
||||||
|
|
||||||
|
###### Show all processes by name with ps main header
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ps -lfC nginx
|
||||||
|
```
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
##### Tool: [find](https://en.wikipedia.org/wiki/Find_(Unix))
|
##### Tool: [find](https://en.wikipedia.org/wiki/Find_(Unix))
|
||||||
|
@ -1993,6 +2005,15 @@ exec /sbin/init 6
|
||||||
exec /sbin/init
|
exec /sbin/init
|
||||||
```
|
```
|
||||||
|
|
||||||
|
###### Get the path of a process
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Alternatives:
|
||||||
|
# - pwdx command
|
||||||
|
# - lsof command
|
||||||
|
readlink -f /proc/<PID>/exe
|
||||||
|
```
|
||||||
|
|
||||||
##### Tool: [curl](https://curl.haxx.se)
|
##### Tool: [curl](https://curl.haxx.se)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
Loading…
Reference in a new issue