hide ps myself

This commit is contained in:
Root THC
2025-04-04 11:58:55 +01:00
parent fdc65c9346
commit e1ce009abe
+5 -2
View File
@@ -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} 😘"