Hot answers tagged

41

1. `killall` already nice (SIGTERM) killall by default sends SIGTERM. This is already the nice approach that leaves applications the chance to clean up after themselves. The "go die already, right now!" approach is to send a SIGKILL signal, which requires specifying that as an option to killall. From The GNU C Library: Termination Signals: Macro: int ...


11

From the man page for killall killall sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent. When you do a kill -9, you are sending the SIGKILL signal. If you want to send a SIGKILL with killall, you need to do killall -s SIGKILL <PROCESSNAME> A good explanation of the ...


5

Using GUI, you can use System Monitor Or from terminal you can use ps aux | less To view every process: ps -A or ps -e All processes running by a user: ps -u username To kill a process, either find the process name and type: kill -9 processname or kill the process ID (PID): kill pid Stop/suspend a process: ctrl-z Source:Man Page


5

lightdm is the X display manager for Ubuntu and killing the processes will effectively disable the graphical user interface of your system. If you do not need the graphical user interface then go ahead and kill the processes but it would be preferable to stop the lightdm service instead of killing the processes with: sudo service lightdm stop Additionally,...


4

From the terminal, ps -ef will list all the processes. See man ps. See man kill, man 2 kill, man killall, man nice, man pkill, man renice, man 7 signal, and man skill to mess with processes. However, simply killing a process that you think is useless may be a mistake. The system might restart the process, or something you depend on might depend on the ...


4

The answer by @hvd is basically correct. To back that up even more, the init process will first send SIGTERM to processes when your are shutting down your computer, then after a delay will send SIGKILL if they have not already exited. Processes can't handle/ignore SIGKILL. To give a bit more detail though, the real answer is that you have no way of knowing ...


3

My main tool here is top type top at the command line in a terminal window You'll get a list of the process that are running, listed by cpu usage. Wait a few seconds for it to gather more stats before proceeding. This is my main tool in unix for killing runaway or unwanted processes. They are likely to be near the top of the list. Note their pid and ...


2

"End all" would be killall -s SIGQUIT [process name]. If you want a fancy solution, define alias endall='killall -s SIGQUIT'.


2

Note that you don't have to kill all: you can kill the specific instance: for file in *.pdf; do echo "$file" evince "$file" & sleep 20s kill $! done $! is the pid of the most recently backgrounded process. (http://www.gnu.org/software/bash/manual/bashref.html#Special-Parameters)


2

Options to prevent an application to run while VPN is running There are several options to prevent running an application when VPN is running: Combine the command to open VPN with the command to kill the application Run a small background script to kill the application if VPN runs Although the first option seems to be the cleanest, there are a few ...


2

I am going to state a application-specific possibility. When you use killall program, a SIGTERM (signal 15) is sent to the program. The usual response to SIGTERM is that the program would exit gracefully. Now as the SIGTERM is catchable, a program can have a signal handler for SIGTERM that would do some task upon receiving the first SIGTERM (first killall) ...


1

You can use following command to get only pid: sudo netstat -peanut | grep 3000 | awk '{ print $9 }' | sed 's:/[^/]*$::' | grep -Eo '[0-9]{1,5}' awk command gets the 9-th field. sed command gets the pid before forward slash. And grep command returns only numbers to eliminate extra lines. Here you can simply have a loop and kill processes.


1

Restart your computer sudo shutdown -r now


1

I think you just forgot to run evince in background: for file in *.pdf; do echo $file; evince $file &; sleep 20s; killall evince; done Notice the & after the evince command.


1

killall accepts most of the same syntax as kill. In particular, there's no need to write anything fancy to make killall do the equivalent of kill -9. This works just fine: killall -9 thunderbird (Of course, as discussed, you should usually be reluctant to use killall -9 or, equivalently, killall -KILL, unless other measures have already been tried without ...



Only top voted, non community-wiki answers of a minimum length are eligible