Jump to content
  • Announcements

    • spinynorman

      Mandriva Official Documentation

      Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.   Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.
    • paul

      Forum software upgrade   10/29/17

      So you may have noticed the forum software has upgraded !!!
      A few things that have changed. We no longer have community blogs (was never really used) We no longer have a portal page.
      We can discuss this, and decide whether it is needed (It costs money) See this thread: Here
Sign in to follow this  
Peter_APIIT

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.

Share this post


Link to post
Share on other sites

If I want to use the command line for shutting down, I type:

 

halt

 

and to restart:

 

reboot

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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!

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×