10

I'm new to linux. How to close GUI and go into pure shell mode in RedHat enterprise Linux 6? I don't want the GUI. I just want to learn some shell scripts.

Thanks.

Yousui
  • 245
  • 3
  • 4
  • 9

1 Answers1

12

you boot your server in run level 3 or you use CTRL+ALT+F2 go to terminal mode :)

Runlevels Descriptions

  • 0 – halt
  • 1 – Single user mode
  • 2 – Multiuser, without NFS (The same as 3, if you do not have networking)
  • 3 – Full multiuser mode (terminal mode)
  • 4 – unused
  • 5 – X11 (X mode)
  • 6 – reboot

To change the default runlevel in RedHat/CentOS/Fedora, edit /etc/inittab and find the line that looks like this:

id:5:initdefault:

change to 3, then reboot the server

chicks
  • 3,793
  • 10
  • 27
  • 36
Rajat
  • 3,349
  • 22
  • 29
  • +1 For listing all the options. – Niels Basjes Dec 16 '10 at 07:33
  • 3
    Alternately, you can just run, as root: "telinit 3" to temporarily change the run-level to 3 to try it out. Then if it is not working out for you, you can do "telinit 5" or just reboot the system to get back to the GUI. – Sean Reifschneider Dec 16 '10 at 10:12
  • Good post. I'll add: CTRL+ALT+Backspace as a way of forcefully killing the GUI session (though it may restart afterwards). Also, you can usually cycle between a number of terminals with CTRL+ALT+F1-7. F7 typically returns you to the GUI, though this might vary with different distros. Try them out :) – SmallClanger Dec 16 '10 at 10:47