Linux Classes
Share This With a Friend  
LINUX CLASSES - LINUX BASICS

Do I Have to Logoff and Shutdown My Linux PC?

Stop the System, I Want to Get Off!

If you're ready to cash in your console and call it a day, use the logout command. Entering logout

at the command prompt exits your current user account and returns you to the log-in prompt. (The exit command does the same thing as logout.) To log out from multiple consoles, use alt-Fn to switch between consoles and then log out from each one. But note that even if you log out from all of your active consoles, Linux is still running.

If you were to power off your machine at this point, a voice from your computer would drone, "You have chosen unwisely!" The floor would shake, and your PC would glow white hot while your hard disk melted into a pool of molten silicon. Just kidding . . . sometimes the floor doesn't shake, but powering off a running Linux system without using the shutdown command will most certainly cause Bad Things to happen to your hard disk. So if you really want to exit Linux, be sure that you're logged in as the root user and enter the command

shutdown -h now

You'll see some messages indicating that various subsystems are being shut down, and then the computer will be reset. When you see a message indicating that shutdown is complete, it's safe to turn off your PC.

Tip: Pressing ctrl-alt-delete will also safely shut down your Red Hat Linux system. Just remember to power off as soon as you see your PC's normal bootup screen. Note that some other Linux distributions will do a hard reset (which may cause filesystem damage) instead of gracefully shutting down, so don't use ctrl-alt-delete on non-Red Hat systems unless you know it's safe.

Previous Lesson: Virtual Consoles
Next Lesson: Choosing a Shell

[ RETURN TO INDEX ]


   

Comments - most recent first
(Please feel free to answer questions posted by others!)

Sanjeev     (21 Dec 2012, 09:50)
Hi, in my linux machine i don't have sound card and which shutdown i get message "Saving mixer settings alsactl: save_state: 1501: No soundcards found ... [FAILED]", how to get rid of this message?
selvam     (20 Nov 2012, 11:10)
this site very usefull
steve     (14 Nov 2012, 22:48)
Sometimes when I use shutdown -h now, my system reboots rather than stays shutdown. What causes this to happen?
Gabriel A. Cánepa     (01 Aug 2012, 19:56)
@Edward Tari, GNU/Linux is the FULL operating system/kernel set (for simplicity, let's just say it's the full operating system), while Linux Mint is a linux distro - or Linux flavor if you wish. Linux Mint is based in Ubuntu (another Linux distro) which in turn is based in Debian (yet another distro). Linux Mint is a good choice to start for a newbie, specially if they're coming from Windows.
Gabriel A. Cánepa     (01 Aug 2012, 19:53)
@papabaks, make sure you are logged in as the root user before you issue the 'shutdown -h now' (without quotes, of course ;)) command. There are certain commands in GNU/Linux that can only be executed as the root user - and shutdown is one of them.
yagyavrat arya     (01 Apr 2012, 16:28)
init 0
papabaks     (12 Mar 2012, 04:46)
i tried using the "shutdown -h now" command on my redhat but its telling me "command not recognize" are mine missing something? pls...
Nikky     (05 Mar 2012, 02:29)
Hello Bob(my new teacher),

I must say u r man of ur word..tutorials typed by u r really simple to understand & work upon. Further, some commands , i would like furnish here for shutdown & reboot that i know:

Shutdown: init 0
poweroff
Restart: init 6
reboot

to forcefully shutdown/restart:

reboot -f
poweroff -f
Bhob Rankesh     (01 Mar 2012, 12:37)
What is difference in startup and shutdown computer?
Edward Tari     (18 Feb 2012, 19:09)
What is the different's between GNU/Linux and Linux Mint?
Nazzareno     (03 Jan 2012, 10:49)
In an redhat5, once shutdown the system with as root:

shutdown -h now

now, when I restart the system and connected as root then I have lost all display tabs, i.e.: "Applications", "Places" and "System", so basically I cannot use any display commands anymore through root user. On the contrary, if I swift on another user, for example oracle, then I can see and work fine all display commands. How can I fix this behavior and work fine again with root user as?
santhoshkumar     (17 Dec 2011, 03:43)
i need to shutdown my redhat linux in command method
but i would like to start automatically after sum some time what type of command we used for that
pranab     (16 Dec 2011, 09:38)
thanks
Vithu     (29 Nov 2011, 00:53)
Thank you very very helpful....
theregkid     (28 Oct 2011, 14:27)
.... i will never shutdown again... - cowers in fear-
amit     (27 Sep 2011, 06:45)
thanks
Santhosh     (02 Sep 2011, 10:18)
init 0 (to shutdown)
init 6 or reboot (to reboot)

in Redhot linux...
duvvuri     (02 Jul 2011, 10:31)
there are other commands for turning off:-
(a) init
(b) poweroff
harmilap rahul     (31 Mar 2011, 06:04)
this command are very useful now in my college
rahul singh     (31 Mar 2011, 06:03)
this command are very useful...
constant_c     (30 Mar 2011, 06:32)
If you want to shut down and then turn off the power, you can type

shutdown -P now

this shuts down the pc normally and after it turns off the power as well
zubair     (21 Mar 2011, 04:35)
plz gv me a brief discription of grep command
Hakan     (02 Mar 2011, 09:36)
As a newbie, I've been using the command "poweroff" version and now I wonder if this is a non-standart command?
amy     (20 Jan 2011, 15:05)
No doubt this is a very good site to know about linus. i have problem to configure tomcat6. could you please add on tomcat6 details
Raj Narayan Verma     (14 Dec 2010, 10:46)
Its very useful thanks
ravi     (29 Nov 2010, 02:38)
disktop remote
AMAL     (07 Nov 2010, 11:19)
thanku>>>>> very much
Jasbir Singh     (11 Oct 2010, 06:38)
very goood site... thanks
dineshbabu     (02 Sep 2010, 00:52)
thanks
jahirhuusain     (16 Jul 2010, 04:46)
its very usefull,,, thanx to every one
vimal     (08 Jun 2010, 22:49)
Please Notify me about new comments with explanations.

I welcome your comments. However... I am puzzled by many people who say "Please send me the Linux tutorial." This website *is* your Linux Tutorial! Read everything here, learn all you can, ask questions if you like. But don't ask me to send what you already have. :-)

NO SPAM! If you post garbage, it will be deleted, and you will be banned.
*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:
 
 


Ask Bob Rankin - Free Tech Support


Copyright © by - Privacy Policy
All rights reserved - Redistribution is allowed only with permission.