Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i am working on kill command in linux,so i want to know how it works when it is called to kill some process,
how process is assigned with pid and which file of process does kill attacks to terminate it
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
Kill is a kernel based command. It tells the Linux kernel to terminate a certain process, based on pid. If you want to know exactly how the program works, there are some good books written about the Linux kernel internals. One of them is called, "Inside The Linux Kernel".
Kill is a kernel based command. It tells the Linux kernel to terminate a certain process, based on pid. If you want to know exactly how the program works, there are some good books written about the Linux kernel internals. One of them is called, "Inside The Linux Kernel".
how a process gets a pid no and who assign it and if i m shutting down my pc by a command init 6 then a command killall comes,can i shut down my pc without using killall command and how
What ever command you use to shutdown a system will generate a killall command as all processes need to be stopped before the system completely shuts itself down.
When a process starts it's assign a process ID via the system/kernel, you can find out the process ids currently active from the command 'ps aux' this will generate alot of output if you have alot of commands however so best used with the grep command but it's worth noting this command will display the grep process itself on top of what you are searching for.
What ever command you use to shutdown a system will generate a killall command as all processes need to be stopped before the system completely shuts itself down.
When a process starts it's assign a process ID via the system/kernel, you can find out the process ids currently active from the command 'ps aux' this will generate alot of output if you have alot of commands however so best used with the grep command but it's worth noting this command will display the grep process itself on top of what you are searching for.
i want to kill some process,so can u suggest me that i should use the kill command login as root or i should make a user,i just want to check it
(note that that output has been drastically trimmed, the whole thing is very long with many processes)
Logged in as tw296, I could stop pidgin with 'kill 1795', but I wouldn't be able to stop X with 'kill 1747', or mpd (a music player daemon) with 'kill 1733'. To kill mpd I could log in as mpd, to kill X I would have to log in as root, and could then kill pidgin, mpd, X, firefox, whatever.
Also, the kill command doesn't just kill things. It sends what are called signals to processes. The default is signal 15, TERM, which asks the process to quit. Some processes will autsave before quitting that way, while a totally nonresponsive process won't quit at all. 'kill -9' will send signal 9, KILL, which ends the process immediately.
The 'killall' command in Linux does not kill everything. In Linux killall kills processes by name, for example 'killall pidgin' would kill pidgin in the example above - in the event that two instances of pidgin were running it would kill them both.
(note that that output has been drastically trimmed, the whole thing is very long with many processes)
Logged in as tw296, I could stop pidgin with 'kill 1795', but I wouldn't be able to stop X with 'kill 1747', or mpd (a music player daemon) with 'kill 1733'. To kill mpd I could log in as mpd, to kill X I would have to log in as root, and could then kill pidgin, mpd, X, firefox, whatever.
Also, the kill command doesn't just kill things. It sends what are called signals to processes. The default is signal 15, TERM, which asks the process to quit. Some processes will autsave before quitting that way, while a totally nonresponsive process won't quit at all. 'kill -9' will send signal 9, KILL, which ends the process immediately.
The 'killall' command in Linux does not kill everything. In Linux killall kills processes by name, for example 'killall pidgin' would kill pidgin in the example above - in the event that two instances of pidgin were running it would kill them both.
i have seen the surce code of kill command in c++,is there any source code in java and if i want to change the working of kill command or some more implementation i have to do ,so i have to do some changes in coding...sugest me
Kernels & OSes generally are written in C and/or C++ (& assembler). Java requires JVM to run, so it can't be the OS itself.
if i m installing something in linux,so by ps aux i will know its pid no after that if i m running that process and by using the kill command i dont want to terminate it but pause it for sometime and then resume it...
what are the commands for this and how it will works
i am working on kill command in linux,so i want to know how it works when it is called to kill some process,
how process is assigned with pid and which file of process does kill attacks to terminate it
when process runs it provide with pid no by kernel,if i want dat it does not terminate it but pause for sometime and after that resume it....suggest me some commands for it....
if i m installing gcc, while installing in the middle can i pause it for sometime using kill stop command and how many files it download and after viewing resume it......
if i am transferring data from one pc to other pc through command scp,then
how we will pause the transferring in between ,so that i can see how much data is transfered....can we pause it through kill command and if not..suggest me the command
if i m installing gcc, while installing in the middle can i pause it for sometime using kill stop command and how many files it download and after viewing resume it......
The kill command would not details like how many files it has downloaded. Kill simply sends a signal to the running program.
What exactly are you trying to accomplish by reworking the kill command? It's possible that there may be an application that already has the functionality that you require.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.