Jump to content

HOWTO (newbie) Console HOWTO


aru
 Share

Recommended Posts

 

bradenm

Frequent user

Joined: 01 May 2002

Posts: 69

Location: Kelowna, BC, Canada

 

Posted: Wed May 01, 2002 7:42 pm Post subject: (newbie) Console HOWTO

_________________________________________________________________

 

 

Console HOWTO:

by bradenm

(a work in progress, please comment)

 

Linux revolves around the command line. There are many, many graphical tools, but they are (almost) all just interfaces to the command line.

 

To follow this HOWTO, launch a terminal: Menu > Terminals > Shell

 

Prompt

When you are logged in, you will see something like

[braden@macdonald braden]$

Here is a breakdown of what this says:

 

[braden@macdonald braden]$ : Your user name.

[braden@macdonald braden]$ : The hostname (friendly name) of the computer.

[braden@macdonald braden]$ : The name of the directory you are currently in. type pwd for the full path.

 

Changing Directory

To change directory, use the cd command. Examples:

To change to your home (the main directory for your user) directory:

cd or cd $HOME or cd ~ (~ is automattically tranlated into/home/yourname/)

To change any directory: cd /foo/blah/stuff/

To change to a directory relative to the current directory: cd music/

 

Listing files

To list the files in the current directory, type ls (LiSt).

To list the files with more details: ls -l

 

nota bene:

(Latin for note well)

In Linux/UNIX all files/directories/commands are treated as case-senitive. Typing LS is different than typing ls.

 

History

Bash (the shell, the program that runs the command line) has extensive history capabilities.

To see the last command you did, press [uP ARROW]. Pressing it again will view the command before that, and so on. [DOWN ARROW] is the

reverse.

Typing !ech will execute the last command that you did starting with "ech". (like echo Hi)

Your history is stored in the file called .bash_history in your home directory.

 

Piping

To send the output of one command as the input of another, use the | operator. (Above the backslash on your keyboard.)

Example: cat ~/.bash_history|grep -e echo

Will list all commands you've ever entered containing the word "echo"

 

CTRL-x

presing CTRL-key will do different things:

CTRL-D: logout. Same as typing exit

CTRL-S: turns on "keyboard delay". Anything that you type will be stored until your press CTRL-Q

Example:

Press CTRL-S. Type echo hello [ENTER]Press CTRL-Q.

 

 

pineault

Frequent user

Joined: 09 May 2002

Posts: 32

Location: Montreal, Québec

Posted: Tue May 14, 2002 2:39 pm Post subject: stupid question about command line display

_________________________________________________________________

 

 

I would like to know how to control the display in a bash console window, ie when using top or ls how to control the display process so as to work in a page mode and thus be able to scroll through the posted content instead of having just the last lines displayed.

 

 

bradenm

Frequent user

Joined: 01 May 2002

Posts: 69

Location: Kelowna, BC, Canada

Posted: Tue May 14, 2002 3:28 pm Post subject:

_________________________________________________________________

 

 

top|more for the output of a command like top or more filename for the contents of a file

 

Also, you can just type top, then use shift+pageUp and shift+pageDn to scroll through the output.

 

 

cannonfodder

Moderator

Joined: 16 Apr 2002

Posts: 1056

Location: Rochester, NY, USA

Posted: Tue May 14, 2002 4:43 pm Post subject:

_________________________________________________________________

 

 

So basically

 

more README.txt (hit spacebar to scroll)

cat REAMDE.txt | more (same, output gets piped to more program)

less README.txt (scroll up/down whatever, hit q to quit)

cat README.txt | less

 

 

pineault

Frequent user

Joined: 09 May 2002

Posts: 32

Location: Montreal, Québec

Posted: Tue May 14, 2002 6:16 pm Post subject:

_________________________________________________________________

 

 

thanks

 

 

pokestix

Newbie

Joined: 31 Oct 2002

Posts: 3

Posted: Thu Oct 31, 2002 8:05 pm Post subject: command prompt to gui

_________________________________________________________________

 

 

i just installed and it is booting straight to the command prompt. how do i get to the gui? i'm sure this is a really stupid question, but i'm a stupid newb and i couldn't find the answer to this. thanks a bunch.

neil

 

 

spiedra

Senior user

Joined: 30 May 2002

Posts: 686

Location: Orlando, FL

Posted: Thu Oct 31, 2002 8:18 pm Post subject:

_________________________________________________________________

 

 

At the command prompt, login and type:

 

startx

 

 

pokestix

Newbie

Joined: 31 Oct 2002

Posts: 3

Posted: Thu Oct 31, 2002 10:06 pm Post subject:

_________________________________________________________________

 

 

so simple, but so helpful...thanks a ton man!

 

 

spiedra

Senior user

Joined: 30 May 2002

Posts: 686

Location: Orlando, FL

Posted: Thu Oct 31, 2002 11:02 pm Post subject:

_________________________________________________________________

 

 

No problem Smile

 

 

 

Editor's note: This thread was originally posted at the old MUB (Mandrake User Board at club-nihil). This post is the result of a 99% automatic backup, so due to its nature some text may be lost (improbable but possible).

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