-1

Got myself into trouble today - put rhythm box into party mode and I could get it back.

So I was stuck.

I hit ctrl alt del thinking that something like task manager would come up so I could kill rhythm box. Nothing happened so I started hitting all kinds of keys.

Finally I hit ctrl alt fn1 and that got me to a cmd line (I now know that I opened up one of six available 'consoles').

I typed quit - not recognized.

exit - not recognized.

more words - not recognized.

Finally, I typed reboot - needs root. So I did sudo reboot and the box rebooted - everything was OK.

My question is - the next time that I am 'in trouble' - the machine won't respond for whatever reason - and I decide to open up a console, what are the 5 to 10 most important commands that I should learn in order to get myself 'out of trouble?'

I am using raring.

1
  • 3
    This is a difficult question to answer as for example it would be difficult to answer which 20 words of English are the most useful. It depends what you need to do. A good starting point however may be here: Using The Terminal May 11, 2013 at 20:53

1 Answer 1

1

Generally the first thing I do in situations like that is checking ctrl+alt+t. If it works I can just type xkill and choose the application that causes trouble. If I cannot click it I use killall <name of application>, but it does not always work. Sometimes I need to first get the process number by ps x | grep <at least partial name of application> or search it manually after typing ps x. When I got it I just type kill <process number>.

If killing the application does not help I try to restart Unity - or Compiz - by unity --replace or compiz --replace.

In situations when I cannot do that this way, because it's impossible to access Terminal in GUI mode, I use one of the ctrl+alt+f consoles and try to kill process from there - it's all the same I described before.

When it appears that I need to restart unity, the first thing needed is to change the 'DISPLAY' variable by DISPLAY=:0. After that I can just type unity --replace.

If all that does not help I just log out. To do that I kill 'gnome-session' process. I could search for it and then kill, but it's easier to just type the following.

kill -9 -1

-9 stands for a specific signal to kill a process and -1 means kind of 'infinity' so it basically kills everything it can.

Last thing is sudo shutdown 0 which obviously shutdowns the computer. Of course You can also use sudo reboot.

It should be enough. Anyway I recommend You to read some bash tutorial. It can be generally really helpful.

Hope that will help.

Not the answer you're looking for? Browse other questions tagged .