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. 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
  4. #AriesRashifal2020, #TaurusRashifal2020, #GeminiRashifal2020, # CancerRashifal2020, #LeoRashifal2020, #VirgoRashifal2020, #LibraRashifal2020, #ScorpioRashifal2020, #SagittariusRashifal2020, #CapricornRashifal2020, #AquariusRashifal2020, #PiscesRashifal2020
    #meshrashifal2020, #vrshabhRashifal2020, #mithunRashifal2020, #karkRashifal2020, #singhRashifal2020, #kanyaRashifal2020, #tulaRashifal2020, #vrshchikRashifal2020, #dhanuraashiRashifal2020, #makarRashifal2020, #kumbhRashifal2020, #meenRashifal2020
    Regarding form: Astroindusoot
    Information website: https://astroindusoot.com/dailyhoroscope
    Call & What’s App No On +91-9068311666.

    ReplyDelete
  5. Astroindusoot provides online astrology consultation in India. Through astroindusoot Astrology get astrological solution for love, career, health, marriage etc. Astroindusoot on-line is a leading astrology prediction platform. Here you can consult with India s best astrologers, Vastu consultants or numerologists over a call. Our mission is to provide exceptional services at a minimum price. Get predictions related to love, marriage, career or finance from the comfort of your home with full privacy from our consultants.

    https://astroindusoot.com/

    ReplyDelete