Link to home
Start Free TrialLog in
Avatar of Los Angeles1
Los Angeles1

asked on

Linux, kill command

I am using RHEL 6.4

In Unix based OS's, you perform something like

    ps -ef | grep appname

Open in new window


This command returns a PID, from which you perform something like

   kill -9  9999

Open in new window


This is simple enough, but sometimes I am in a hurry,

Is there a command or a script that can ferform something like

   killapp   appname

Open in new window


without the necessary PID lookup, turning it into a single command instead of two ?

Thanks
SOLUTION
Avatar of Pepe2323
Pepe2323

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or just write a simple wrapper script that does the ps for you, filtering the pid(s), adding a simple check that asks you a question in case it finds more than one pid.