Blair
Rookie

Why linux command ps aux not working?


I have a system which is loaded with Linux as I find it more flexible. There are so many applications that are now running with PID but the problem is that my ps aux command is not working. I use this command to get information to kill a running process but I am not able to do so now….any idea on fixing this?
6 months ago
Respond to this discussion
Mirza Fabiha Bin Yaseen | Nov 2 2011

Linux and even the other UNIX like oses comes with the kill command. The command kill will sends the specified signal such as the kill process to the specified process or even to process group. If there is no signal is specified then the TERM signal is sent.

Kill process using the kill command under Linux or the UNIX

kill command works under both Linux and UNIX/BSD like the operating systems.

Step #1: First, you just need to find out process PID known as process id

Use ps command or even the pidof command to find out process ID or even PID. Syntax:
ps aux | grep processname
pidof processname

For example if process name is lighttpd, you can just use any one of the following command to obtain the process ID.

# ps aux| grep light tpd

output.

lighttpd 3486 0.0 0.1 4248 1432 ? S Jul31 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf

lighttpd 3492 0.0 0.5 13752 3936 ? Ss Jul31 0:00 /usr/bin/php5-cg

OR use pidof command which is use to find the process ID of a running program.

Output:

3486

Step #2: kill process using PID (process id)

Above command tell you PID (3486) of lighttpd process. Now kill process using this PID:
# kill 3486
OR
# kill -9 3486
Where,

  • -9 is special Kill signal, which will kill the process.

killall command examples

DO NOT USE killall command on the UNIX system (Linux only command). You can also use the killall command. The killall command will kill processes by name as there is no need to find PID.

# killall -9 lighttpd

Kill Firefox process:
# killall -9 firefox-bin

© 2012, Instamedia. Some rights reserved. Powered by Instapress and Instacheckin.