aze Posted December 21, 2002 Report Share Posted December 21, 2002 Hi all! How to get the pid of a running process? Quote Link to comment Share on other sites More sharing options...
Ronin Posted December 21, 2002 Report Share Posted December 21, 2002 ps aux? Quote Link to comment Share on other sites More sharing options...
aru Posted December 21, 2002 Report Share Posted December 21, 2002 several ways, my favorite is (replace 'cupsd' with the name of the program you want to know its pid): [arusabal@localhost ~]$ ps aux | awk '/[c]upsd/ {print $2}' 1043 [arusabal@localhost ~]$ see "man ps". If you dont use the "[c]" at the awk expression (same with grep...) you'll get two pids, one for cupsd and another for awk. There are dozens of variants of the above command. as root you can do: pidof name as normal user you'll need to invoque the full path of pidof: [arusabal@localhost ~]$ /sbin/pidof cupsd 1043 [arusabal@localhost ~]$ Quote Link to comment Share on other sites More sharing options...
aze Posted December 21, 2002 Author Report Share Posted December 21, 2002 Thank u guys! Another question (I don want open a new topic for this one): When I type man ... I don't know how to leave the man. How do I close the "man"? Thank you! Quote Link to comment Share on other sites More sharing options...
pmpatrick Posted December 21, 2002 Report Share Posted December 21, 2002 Press "q". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.