Software >
Process ID
Table of Contents [hide]
Executing a command and learning it’s PID ∞
xterm & variable=$! echo $variable
Learning a PID ∞
Maybe you can use wmctrl
ps ∞
(ps)
ps ax ps alx
kill and pidof ∞
kill `pidof xterm`
kill -0 $SOMEPID 2> /dev/null if [ $? != 0 ]; then echo "It's not there" fi
Fails:
if [ ! ps -C "$processname" > /dev/null ]; then # exists fi if [ ! `ps -p $processnumber > /dev/null` ]; then # exists fi
In Bash and Zsh ∞
echo $$
Also $PPID
Do this to learn your process too!
ps -fp $$
in Ruby ∞
(Ruby)
$$
xtoolwait ∞
xtoolwait -pid <application>
