From e311d6dbe2676726f521424e6d902b132a54d4c6 Mon Sep 17 00:00:00 2001 From: trimstray Date: Mon, 1 Apr 2019 15:15:59 +0200 Subject: [PATCH] added new one-liners - signed-off-by: trimstray --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 7daa631..582ec93 100644 --- a/README.md +++ b/README.md @@ -1328,6 +1328,12 @@ awk '{ if($7 > 1048576) print $7/1048576 "MB" " " $9 " " $1 }' | \ sort -n -u | tail | column -t ``` +###### Get the path of a process + +```bash +lsof -p | grep cwd +``` + ___ ##### 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 ``` +###### Show all processes by name with ps main header + +```bash +ps -lfC nginx +``` + ___ ##### Tool: [find](https://en.wikipedia.org/wiki/Find_(Unix)) @@ -1993,6 +2005,15 @@ exec /sbin/init 6 exec /sbin/init ``` +###### Get the path of a process + +```bash +# Alternatives: +# - pwdx command +# - lsof command +readlink -f /proc//exe +``` + ##### Tool: [curl](https://curl.haxx.se) ```bash