Custom Search

Ubuntu terminal not responding tips

Have you ever seen this problem when using Ubuntu terminal? You run a command, then it just hang there, not responding. You press Enter, Esc, Ctrl+c, Ctrl+z, type anything but it won't respond. Well, I always have because I work in terminal a lot.

Don't worry. You do remember that Linux is multiuser and multitasking operating system, do you? So, we don't have to restart our Ubuntu system. Here is what I do:

1) Open other terminal and run ps command. Use grep command to grab the not responding terminal. We need the PID (process id) of the hanged command.


luzar@ubuntu:~$ ps aux | grep tty1
root 4356 0.0 0.2 2568 1212 tty1 Ss 13:04 0:00 /bin/login --
root 4362 0.0 0.3 4144 1808 tty1 S+ 13:05 0:00 -bashluzar
4619 0.0 0.1 3004 756 pts/0 R+ 14:05 0:00 grep tty1


2) Use the kill command to terminate the not responding process.


luzar@ubuntu:~$ sudo kill 4362
[sudo] password for luzar:
luzar@ubuntu:~$ ps aux | grep tty1
root 4624 0.0 0.1 1716 516 tty1 Ss+ 14:05 0:00 /sbin/getty 38400 tty1
luzar 4626 0.0 0.1 3004 756 pts/0 R+ 14:05 0:00 grep tty1


3) If it's still there, you can force terminate with kill -9 option or just kill the login terminal.


luzar@ubuntu:~$ sudo kill -9 4628
luzar@ubuntu:~$ ps aux | grep tty1
root 4632 0.0 0.0 1716 512 tty1 Ss+ 14:06 0:00 /sbin/getty 38400 tty1
luzar 4634 0.0 0.1 3004 752 pts/0 R+ 14:06 0:00 grep tty1


Here is what happened in the not responding terminal when we were using the kill command:

No comments:

Post a Comment

Please keep comment relevant and strictly no spam will be tolerated. Thank you.