http://qs321.pair.com?node_id=1136721


in reply to How to get the process Id

After you started the command in the background you can use ps aux | grep tcpdumpcommand and get the process id of the process, first field is name of the owner who started the process, second filed is the process id(PID).


All is well. I learn by answering your questions...

Replies are listed 'Best First'.
Re^2: How to get the process Id
by pme (Monsignor) on Jul 29, 2015 at 11:06 UTC
    If yours is not the only running tcpdump 'ps aux | grep tcpdump' returns more than one line. Luckily shell has $! variable that holds the last child PID. See bash for the details.
Re^2: How to get the process Id
by Utilitarian (Vicar) on Jul 29, 2015 at 09:09 UTC
    Note that that's ps -ef unless bsd/bsd-compatible ps is installed.

    ETA: Never mind, Linux box, bsd compatible mode built in

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."