epepper9 said:
What's the difference between:
killall iTunes
killall -9 iTunes and..
killall -9 PID ???
I'm guessing that the last one force quits everything, but what do the first 2 do?
killall is a command that piggybacks on the more common command, kill.
kill takes a pid (process id) number as an argument, and usually sends that process a TERM signal. applications receive TERM signals in a special handler and can handle them however they want. usually they perform some quick cleanups (closing files, e.g.) and then return to the shell. but an application could, in theory, ignore this message and keep right on running.
kill can send other signal to applications, however. this might be advantageous because some signals cant be blocked, such as the KILL signal, which is also numbered 9. so when you kill -9, thats the same as saying kill -KILL, which basically ensures that a program closes.
killall takes a process name as an argument, instead of a pid, because for a human its usually easier to guess the name than the pid. (to find the pid, you'd need to lookup the process, e.g. "ps aux")
as far as i know, killall -pid is not a valid command. i dont know of any way to kill *all* processes without writing a command that lists every single process, such as
killall Finder iTunes AppleWorks etc...
killing certain processes can wreak havoc though, so dont just go around killing random stuff.