APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

I need to send a kill -1 to a process


Some material is very old and may be incorrect today

© July 2015 Anthony Lawrence

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.


If you found something useful today, please consider a small donation.



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


Inexpensive and informative Apple related e-books:

Take Control of Preview

Take Control of the Mac Command Line with Terminal, Second Edition

Take Control of Numbers

Take Control of iCloud

Take Control of OS X Server





More Articles by © Anthony Lawrence





Printer Friendly Version

Have you tried Searching this site?

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


Printer Friendly Version





What do such machines really do? They increase the number of things we can do without thinking. Things we do without thinking — there's the real danger. (Frank Herbert)




Linux posts

Troubleshooting posts


This post tagged:

Bash

Forum

Scripting

Shell



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode