Thursday, September 15, 2011

Alias to find process id of a running process

This is an example for those who believe in saving time.
You can create your own aliases to save your time from typing long commands again and again.
Create alias
# alias p_id='echo -n '\''process name:'\'';read a;ps -e | grep firefox | cut -d '\'' '\'' -f 2'
Execute it
# p_id
process name:[name of the running process]
[output will be the process id]

5 comments:

  1. Quick fix:

    [me@myboxen ~]# alias p_id='echo -n '\''process name:'\'';read a;ps -e | grep $a | cut -d '\'' '\'' -f 2'

    [me@myboxen ~]# p_id
    process name:httpd
    6818
    6835
    6836
    6837
    6838
    6839
    6840
    6841
    6842


    But why not just use the pidof command?

    [me@myboxen ~]# pidof httpd
    6842 6841 6840 6839 6838 6837 6836 6835 6818

    ReplyDelete
  2. I found your post really helpful. Thanks for posting such informative content. Keep posting.
    joomla extensions

    ReplyDelete
  3. Visit To All Types Of Printers Technical Supports | Call Now +1-855-517-2433

    Solution Visit To Technical Supports For Hp Printer | +1-855-517-2433

    Solution Visit To Technical Supports For Canon Printers | +1-855-517-2433

    Solution Visit To Canon Printing Problems and Solution | +1-855-517-2433

    Solution Visit To Canon Printing Problems and Solution | +1-855-517-2433

    Solution Visit To Technical Supports For Hp Printer | Call Now +1-855-517-2433

    Solution Visit To Technical Supports For Dell Printer | Call Now +1-855-517-2433
    Solution Visit To Technical Supports For Hp Printer | +1-855-517-2433

    Solution Visit To Technical Supports For Canon Printers | +1-855-517-2433

    Solution Visit To Canon Printing Problems and Solution | +1-855-517-2433

    Solution Visit To Canon Printing Problems and Solution | +1-855-517-2433

    Solution Visit To Technical Supports For Hp Printer | Call Now +1-855-517-2433

    Solution Visit To Technical Supports For Dell Printer | Call Now +1-855-517-2433
    Solution Visit To Technical Supports For Hp Printer | +1-855-517-2433

    Solution Visit To Technical Supports For Canon Printers | +1-855-517-2433

    Solution Visit To Canon Printing Problems and Solution | +1-855-517-2433

    Solution Visit To Canon Printing Problems and Solution | +1-855-517-2433

    Solution Visit To Technical Supports For Hp Printer | Call Now +1-855-517-2433

    Solution Visit To Technical Supports For Dell Printer | Call Now +1-855-517-2433
    Solution Visit To Technical Supports For Hp Printer | +1-855-517-2433

    Solution Visit To Technical Supports For Canon Printers | +1-855-517-2433

    Solution Visit To Canon Printing Problems and Solution | +1-855-517-2433

    Solution Visit To Canon Printing Problems and Solution | +1-855-517-2433

    Solution Visit To Technical Supports For Hp Printer | Call Now +1-855-517-2433

    Solution Visit To Technical Supports For Dell Printer | Call Now +1-855-517-2433

    ReplyDelete
  4. Configuration of Brother Printer is the main problem that a user has to deal with. One wrong setting can either stop printer from working or it can hamper the quality of printouts you get. If you want to configure your printer settings as per your requirement then we recommend you to take assistance from experts at +1-866-569-8043.
    Brother Printer Helpline Number

    ReplyDelete
  5. Norton.com/setup | www.norton.com/setup | Norton setup product key, install Norton | activation your product. Norton.com/setup 1844-516-0689 Download & Install Norton antivirus Product Visit activation website www.notroncomsetupactivation.com . Norton Setup Help & Norton Customer support will help you resolve any Malware/virus related issues remotely Call Toll Free Number + 1844-516-0689.For any help regarding Norton Antivirus you can directly call on Norton Antivirus Phone Number + 1844-516-0689.Toll-Free to get instant solution Norton.com/setup+ 1844-516-0689.Call us at ourNorton 360 by Symantec Helpline Number+ 1844-516-0689.to experience the quick and bestNorton.com/setupHelpline Number+ 1844-516-0689. norton.com/setup + 1844-516-0689. www.norton.com/setup l login.norton.com/setup l norton activation key setup l.....

    ReplyDelete