Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've recently lost my window options, had to somehow manipulate my way to Xchat and ask some people how do I get it back (it was metacity --replace, and after I decided to stop the command and run it in background the X was completely useless so I had to do killall -u user). And that was after the internet connection stopped working for some reason (might've been the ISP).

The thing is, after using linux a long time, I still get the feeling that on dire situations, I don't know the good tricks (stuff like metacity --replace). I feel like a really need like a "rescue" cheatsheet for things like:

  • how to save the X no matter what without pressing reset
  • how to reset the system to "normal state"
  • how to connect to the internet through the command line
  • how to monitor what the X is doing (using ubuntu linux 10.04 btw)
share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

X

If it's working: Ctrl-Alt-Backspace.

Ctrl-Alt-F[1-6] go to terminal.

Ctrl-Alt-F7 - go to X

Restart XDM in most distros:

/etc/init.d/xdm restart

Or find X processes PIDs

ps aux|grep "[Xx]"

and kill them. Then start new X

startx

X logs: /var/log/Xorg.0.log

Internet

Using dhcp:

dhclient interface 

Interface could be eth0. Without

ifconfig ...

or

ip

(see man for more)

Not sure how Ubuntu works, but i think you can restart your network connecting using some kind of /etc/init.d script. Check server guide. Not sure, but I think that works for desktop edition too.

Other stuff

Useful terminal programs:

  • lynx,links - internet browsers
  • irssi - IRC client
  • mc - file manager
  • mcedit - simplest file editor ever
  • GNU and system utils - basic like: cat, tail, head, cp, rm, mv - must know!
  • top, ps - display Linux tasks
  • free - memory usage (but remember to look at buffors table, not mem)
  • man :)

Magic Resq Key

Wikibooks Freezes

share|improve this answer
    
I may add that from Ubuntu 10.04 LTS, you can't directly call /etc/init.d. Just call "service" instead. Also, xdm can refer to kdm or gdm, whichever desktop you use. Also, of "useful terminal programs", I would add "pico" as a text editor. Or "vim", if you know how to use it, but it is not installed by default on Ubuntu (though I think it is on most other distros). –  petersohn May 20 '10 at 18:04
    
I have two more apps on my mind. mc - file manager mcedit - very basic and very simple editor. –  gogiel May 20 '10 at 19:18
    
@petersohn: you can still use /etc/init.d/<service> <action>, and not all services have been converted to use Upstart yet anyway. –  ThatGraemeGuy May 20 '10 at 20:07
    
ohh, I printed it out before you added the extra commands :) –  Asaf May 20 '10 at 20:16
    
@Graeme: But you must use "service" for gdm/kdm (for me it only worked that way). @gogiel: Do not forget find, dd. Anything else? –  petersohn May 20 '10 at 21:27
show 1 more comment

I'm a programmer, so I use git daily.

I have found git very useful for monitoring changes (and eventually restoring in emergency cases) changes in config files.

Edit:

On my Ubuntu 10.04 LTS I do:

sudo /etc/init.d/network-manager restart

or

sudo service network-manager restart
share|improve this answer
    
I also use git, however I don't really understand where does git come to place on these commands? –  Asaf May 20 '10 at 20:48
    
Well, my answer has two parts: git for undoing things when in trouble; and the commands extending @petersohn's comment. –  takeshin May 21 '10 at 20:18
add comment

I know this isn't exactly what your looking for, but I found this .pdf to be a good resource for figuring out ubuntu. (Plus its free...which is always nice.)

http://ubuntu-manual.org/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.