Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: How to get the process Id

by vinoth.ree (Monsignor)
on Jul 29, 2015 at 08:28 UTC ( #1136721=note: print w/replies, xml ) Need Help??

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 (Prior) 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."

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1136721]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2020-07-07 08:29 GMT
Find Nodes?
    Voting Booth?

    No recent polls found