mirror of
https://github.com/hackerschoice/thc-tips-tricks-hacks-cheat-sheet.git
synced 2026-07-10 12:48:36 +02:00
hide ps myself
This commit is contained in:
+5
-2
@@ -431,9 +431,12 @@ command -v netstat >/dev/null && {
|
||||
}
|
||||
|
||||
echo -e "${CDR}>>>>> Process List${CN}"
|
||||
# Dont display kernel threads
|
||||
# Don't display kernel threads
|
||||
# BusyBox only supports "ps w"
|
||||
{ ps --ppid 2 -p 2 --deselect flwww || ps alxwww || ps w;} 2>/dev/null | head -n 500
|
||||
# Hide ws if piped into bash (ppid=$PPID) or if sourced (ppid=$$).
|
||||
HIDE_PPID=$PPID
|
||||
[ "$HIDE_PPID" -eq 1 ] && HIDE_PPID=$$
|
||||
{ ps --ppid 2,${HIDE_PPID:-0} -p 2,$$ --deselect flwww || ps alxwww || ps w;} 2>/dev/null | head -n 500
|
||||
|
||||
# use "|head -n-1" to not display this line
|
||||
echo -e "${CW}>>>>> 📖 Please help to make this tool better - https://thc.org/ops${CN} 😘"
|
||||
|
||||
Reference in New Issue
Block a user