MandrivaUsers.org : Command Line Interface (CLI) Help - MandrivaUsers.org

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Command Line Interface (CLI) Help

#1 User is offline   Peter_APIIT 

  • casual
  • Group: Members
  • Posts: 69
  • Joined: 23-January 07

Posted 30 January 2007 - 03:49 AM

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

[quote]
>
[quote]

I odn"t know what is it ? Please help on this. Thansk for u your help.
0

#2 User is offline   ianw1974 

  • Platinum
  • View blog
  • Group: Admin
  • Posts: 14,051
  • Joined: 09-March 05

Posted 30 January 2007 - 08:05 AM

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

halt


and to restart:

reboot

Ian Walker

Light travels faster than sound. This is why some people appear bright until you hear them speak.........

Posted Image2 x systems installed with Ubuntu 14.04 x86_64 (Laptop and Desktop)
Posted Image1 x systems installed with Gentoo x86_64 (Desktop)

My Linux Solutions | Linux Systems Limited
0

#3 User is offline   Peter_APIIT 

  • casual
  • Group: Members
  • Posts: 69
  • Joined: 23-January 07

Posted 30 January 2007 - 08:26 AM

Could you please help me on this ?
0

#4 User is offline   ianw1974 

  • Platinum
  • View blog
  • Group: Admin
  • Posts: 14,051
  • Joined: 09-March 05

Posted 30 January 2007 - 08:40 AM

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?
Ian Walker

Light travels faster than sound. This is why some people appear bright until you hear them speak.........

Posted Image2 x systems installed with Ubuntu 14.04 x86_64 (Laptop and Desktop)
Posted Image1 x systems installed with Gentoo x86_64 (Desktop)

My Linux Solutions | Linux Systems Limited
0

#5 User is offline   Peter_APIIT 

  • casual
  • Group: Members
  • Posts: 69
  • Joined: 23-January 07

Posted 31 January 2007 - 02:12 AM

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

#6 User is offline   ianw1974 

  • Platinum
  • View blog
  • Group: Admin
  • Posts: 14,051
  • Joined: 09-March 05

Posted 31 January 2007 - 06:57 AM

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

Light travels faster than sound. This is why some people appear bright until you hear them speak.........

Posted Image2 x systems installed with Ubuntu 14.04 x86_64 (Laptop and Desktop)
Posted Image1 x systems installed with Gentoo x86_64 (Desktop)

My Linux Solutions | Linux Systems Limited
0

#7 User is offline   ramfree17 

  • Pinoy Newbie Home/Philippines
  • View blog
  • Group: Members
  • Posts: 1,941
  • Joined: 08-September 02

Posted 31 January 2007 - 10:11 AM

View PostPeter_APIIT, on Jan 30 2007, 03:49 AM, said:

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.



View PostPeter_APIIT, on Jan 30 2007, 03:49 AM, said:

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.

View PostPeter_APIIT, on Jan 30 2007, 03:49 AM, said:

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.

View PostPeter_APIIT, on Jan 30 2007, 03:49 AM, said:

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!
You have read a post from a newbie. Take everything with a grain of salt.

"I am a newbie forever, I wont learn a damn thing if I am not." - pilfered from an email sig

Registered Linux User #246176
http://del.icio.us/ramfree17
Link to Frequently Asked Questions
When you absolutely have nothing else better to do...
and its always paul's fault. sometimes tyme's too.
0

#8 User is offline   Gowator 

  • always learning
  • Group: Platinum
  • Posts: 5,674
  • Joined: 09-May 03

Posted 31 January 2007 - 10:38 AM

View Postramfree17, on Jan 31 2007, 11:11 AM, said:

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/s...al/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...
Fere libenter homines id quod volunt credunt. (J.C. de Bello Gallico III/XVIII)

Visit my visitor site for coelaics, find out what a coelaic is even.
http://linuxmigratio....fr/glutenfree/
0

#9 User is offline   shengchieh 

  • casual
  • Group: Members
  • Posts: 65
  • Joined: 07-October 06

Posted 01 February 2007 - 03:36 AM

On a console, do

man shutdown

Sheng-Chieh
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users