Use
ps -o ppid=
ps -o ppid= 2076
returns 2054
, which you can easily use in a script etc. ps -o ppid= -C foo
gives the PPID of process with command foo
. You can also use the old fashioned ps | grep
: ps -eo ppid,comm | grep '[f]oo'
.ps -f 2072
returns UID PID PPID C STIME TTY STAT TIME CMD izx 2076 2054 0 07:16 ? S 0:00 /usr/lib/pulseaudio/pulse/gconf-helper
pstree
relation is: pstree -s -p 2076
: init(1)───pulseaudio(2054)───gconf-helper(2076)
OR
Step 2:-
echo $PPID
if you need the command from this parent pid:
cat /proc/$PPID/comm
if you need the full command line (with all options):
cat /proc/$PPID/cmdline
$PPID
is defined by the shell, it’s the PID of the parent process/proc/
, you have some dirs with the PID of each processes. Then, if you cat /proc/$PPID/comm
, you echo the command name of the PIDThat’s it for now !
This is not an ad-vocation by any means for TP-link branding, however a real life…
First of all we need to hit the kernel version on any Android device. You…
Use resolvectl status instead. It's like something deprecates and suddenly things get broken! In systemd…
Geeky question: This is what people and friends have tried: rsync -arv --exclude "/home/john/.ccache:/home/ben/build" /home/john…
You might encounter this error which appears to be very common on Debian based Distro's…
PS: This article is for only Kali Linux users, that too having a Broadcom Wireless…