Jump to content

Command Line Interface (CLI) Help


Recommended Posts

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.

Link to comment
Share on other sites

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. :lol2:

 

 

ciao!

Link to comment
Share on other sites

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. :lol2:

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...

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...