Peter_APIIT Posted January 30, 2007 Report Share Posted January 30, 2007 Hello guys, I am a newbie to computer. I quite interested to know about the Bash, Ksh, tcsh and many more. Question : When i type, shutdown -t 0 shutdown -t now in the console. It won"t work. If i typed shutdown now It is work but it go to a black screen which is switch to run level 1 from level 6 which is the GUI desktop. sh-3.1 # After it, i don"t know why the system cannot shuting down. What command should i type in order to shuting down the system. I know the difference between $ and #. $ is a normal user and # is a root user which have unlimited permission to change the system. Could you all guys please explain to me what is sh-3.1 # ? When i typed, /bin /sh It changed to another screen, seems like bash or scripting. I have no idea what is it. The screen is sh-3.1 $ . Then i try to typed, echo "Hello World". It appeared the Hello World to the console. In general, please help me on this. I have enough suffered on this. Please forgive my stupidness, if this is a stupid question. Thasnk for your help. Hope GOD will blessed you. When i typed, if !/bin/bash It's go to antoher screen which is > I odn"t know what is it ? Please help on this. Thansk for u your help. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted January 30, 2007 Report Share Posted January 30, 2007 If I want to use the command line for shutting down, I type: halt and to restart: reboot Quote Link to comment Share on other sites More sharing options...
Peter_APIIT Posted January 30, 2007 Author Report Share Posted January 30, 2007 Could you please help me on this ? Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted January 30, 2007 Report Share Posted January 30, 2007 I'm not sure what you mean? Did you not type halt at the terminal prompt like I said? And what was the result of doing this? Quote Link to comment Share on other sites More sharing options...
Peter_APIIT Posted January 31, 2007 Author Report Share Posted January 31, 2007 I have do it as you wish but i have another question where i mentioned in the post. Please check my post for detail question. Thanks anyway. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted January 31, 2007 Report Share Posted January 31, 2007 sh is a shell, just like bash is a shell. Normally Mandriva uses bash, but when it's in a recovery type mode, it's probably defaulting to sh instead. Quote Link to comment Share on other sites More sharing options...
ramfree17 Posted January 31, 2007 Report Share Posted January 31, 2007 Question :When i type, shutdown -t 0 shutdown -t now in the console. It won"t work. If i typed shutdown now It is work but it go to a black screen which is switch to run level 1 from level 6 which is the GUI desktop. sh-3.1 # im not in linux so im doing this from memory... :) shutdown requires that you pass it the time when it will start shutting down processes. when you specified the -t parameter on the first two invocations then you just told it to wait (-t) 0 and <whatever number 'now' evaluates to> seconds but you didn't specify what would be the reference time to shutdown. i would assume that invoking the following would work: shutdown -t 0 now because it means you want the system to shutdown now with 0 second delay. btw, runlevel 5 is the gui mode, runlevel 6 means a reboot, and runlevel 1 is the single user mode. that is mode you got dropped with the sh-3.1 # prompt. invoking sh-3.1 # init 5 will bring you back to gui mode. After it, i don"t know why the system cannot shuting down. What command should i type in order to shuting down the system. like what ian said, i just use halt. i think it is symlinked or alias to shutdown in some way. Could you all guys please explain to me what is sh-3.1 # ? When i typed, /bin /sh It changed to another screen, seems like bash or scripting. I have no idea what is it. The screen is sh-3.1 $ . Then i try to typed, echo "Hello World". It appeared the Hello World to the console. refer to my explanation above how you got the sh prompt . i think that is the default runlevel that shutdown will take you. check the manpages to be sure. :) when you invoked sh again you just told your current shell to run another shell on top of it. to get back to the original shell (or parent shell) then you only need to execute the 'exit' command. In general, please help me on this. I have enough suffered on this. Please forgive my stupidness, if this is a stupid question. there are no stupid questions, only ones that are asked rudely or is not thought well enough. yours doesnt meet either. dont worry about being a newbie. we all started that way. some dont even get away from the label. check my sig if you dont believe me. ciao! Quote Link to comment Share on other sites More sharing options...
Gowator Posted January 31, 2007 Report Share Posted January 31, 2007 there are no stupid questions, only ones that are asked rudely or is not thought well enough. yours doesnt meet either. dont worry about being a newbie. we all started that way. some dont even get away from the label. check my sig if you dont believe me. Ill just quote that because it is central to the philosophy here.... In general if you mix questions up you'll find you only get part of it answered... 90% of people are looking for a quick fix not reasons :D but I commend you for wanting to understand .... For someone with your interest about WHY and not just HOW there are loads of resources... and IMHO the best ones are all FREE... this takesa bit of a mindshift ... A really neat feature in linux is that the documentation is usually involved with WHY and not just HOW...from your question I think this will suit you... (I myself need to know how... in order to learn or I just get mindblocks) man <command> usually brings up exhaustive documentation, it can also be under info <command> which when it exists is usually a more readable (longer but explained) format than man... for starters you can man bash or info bash and the same with the init command and shutdown.... but you can also google and find http://www.gnu.org/software/bash/manual/bashref.html Please ... we don't have stupid questions /:D so don't stop asking.... sometimes though its easier to point you to something to read, especially for people who want to understand... Quote Link to comment Share on other sites More sharing options...
shengchieh Posted February 1, 2007 Report Share Posted February 1, 2007 On a console, do man shutdown Sheng-Chieh Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.