I need to send a kill -1 to a process

Got questions? Go ahead: Ask me anything!

Anonymous asks:

I need to send a kill -1 to a process but I can not get the pid from a file as it's location is different on some systems

On Linux systems, that's very simple. You said your executable is "dnsmasq", so you can simply do:

killall -s 1 dnsmasq

If this isn't a Linux system or if you need the capture the PID for other reasons, do something like:

THEPID=`ps -ef|grep  dnsmasq    |grep -v grep`

and reference $THEPID wherever you need to.

See also Murder and Mayhem - How to kill user's processes and Understanding Kill.

Got something to add? Send me email.

(OLDER) <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> I need to send a kill -1 to a process

Increase ad revenue 50-250% with Ezoic

More Articles by

Find me on Google+

© Anthony Lawrence

Kerio Samepage

Have you tried Searching this site?

Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

The man who receives five thousand dollars a year wants six thousand dollars a year, and the man who owns eight or nine hundred thousand dollars will want a hundred thousand dollars more to make it a million, while the man who has his millions will want everything he can lay his hands on and then raise his voice against the poor devil who wants ten cents more a day. (Samuel Gompers)

This post tagged:

© Copyright 2019 aplawrence.com.