Author Topic: Understanding Terminal in Ubuntu  (Read 1878 times)

Offline Shabab

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • daffodilcse
Understanding Terminal in Ubuntu
« on: November 21, 2009, 12:32:46 PM »
Most convenient way to access the command-line is to use a terminal program(Application->Accessories->Terminal)
/*I am using Bold to present command input and Italic to present display output*/
When the terminal program appears, you’ll see something like this:

your_name@your_name‐desktop:~$

The first part of the prompt shows your username. After the @ sign is the name of the computer, commonly referred to as the hostname.

After this your current browsing location is displayed followed by a colon. By default you will start from ~ . Where '~' is a shorthand form of your home directory.

i.e: /home/your_name

The $ sign indicates the string or sentence ends here.

There are many commands to work in terminal mode. They also work very logically. Once you learn the basics you'll find it easier to do many tasks in command mode rather than graphical mode.

Some commands work on their own. They dont require any arguments. While the others take arguments to know what to work with. In other words, they need to be told what file(s) or folder(s) to work with.

Once a command is entered, all that’s usually seen is the prompt again.
There’s no confirmation. bash doesn’t say “OK” or “Command
completed!”. bash is the silent type. It’ll only speak if it has to, usually to
tell you of an error.

As I said earlier, some commands work on their own. Like, 'ls'. It is very handy.
If you are in your home folder and give the command 'ls' it will show you the files and folders in that location-e.g: if you are in your home directory and type-

ls

Desktop Documents Examples Music Pictures Public Templates Videos

most commands take arguments. like cd (change directory) it will jump to the directory followed in the command. e.g:

cd Documents

or

cd location

If you want to go to any folder directly just type full address in the location field. for example if you want to go to "/home/shabab/Pictures/" type

cd /home/shabab/Pictures

or you can also go step by step

cd /



cd home

cd shabab

cd Pictures



The firs '/' goes to the root directory (like C:\ in windows). And you can figure out the other steps. Be careful about one thing that linux terminal is case sensitive. So if you type 'pictures' instead of 'Pictures' it wont work.

bash: cd: pictures: No such file or directory

Many commands also has command options. like adding the option after command will make it work. Like ls shows all files folders in a directory. But if you also want to see the hidden ones add –a, which causes all files to be listed including hidden ones.e.g:

ls -a

. .esd_auth .ICEauthority .recently-used




To see the details of all elements.

ls -l

Command options can also be combined. To see details of hidden files

ls -la

To see a list of available command options add --help. e.g:

ls --help or

cp --help


To run a command from your current location. Write the command after ' ./ ' many experts interpret it as 'right here'. It is a good way to remember. E.g:

./browser

will run a program called browser located in current directory

The light is my strength, the truth is my soul.

Offline R i Y a D

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Understanding Terminal in Ubuntu
« Reply #1 on: May 09, 2010, 11:12:10 AM »
Just knowing what a command does is not always enough. In order to use a command effectively you need to know what options and arguments it accepts and what order it expects them in. Most commands have a help option.

The --help Option
  • Displays usage summary and arguments list
  • Used by most but not all commands

The man command

  • Provides documentation for commands
  • Almost every command has a man page
  • Pages are grouped into chapters
  • Collectively referred to as the Linux Manual

The info command

  • Similar to man, but often more in depth
  • Run info without args to list all page






Mahmudur Rahman
RF Optimization Engineer
Radio Network Planning & Optimizations
ZTE Corporation Bangladesh Limited
[email: riyad_ete@yahoo.com]

Offline Shabab

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • daffodilcse
Re: Understanding Terminal in Ubuntu
« Reply #2 on: May 27, 2010, 10:37:15 AM »
Just knowing what a command does is not always enough. In order to use a command effectively you need to know what options and arguments it accepts and what order it expects them in. Most commands have a help option.

The --help Option
  • Displays usage summary and arguments list
  • Used by most but not all commands

The man command

  • Provides documentation for commands
  • Almost every command has a man page
  • Pages are grouped into chapters
  • Collectively referred to as the Linux Manual

The info command

  • Similar to man, but often more in depth
  • Run info without args to list all page








thanks for the reply. Actually man is not argument of any command. All available commands can be given as argument of man(another command which searches the manual),
and is rarely applicable to new users.


Hope to hear more from you
The light is my strength, the truth is my soul.

Offline R i Y a D

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Understanding Terminal in Ubuntu
« Reply #3 on: July 23, 2010, 02:29:44 PM »
Just knowing what a command does is not always enough. In order to use a command effectively you need to know what options and arguments it accepts and what order it expects them in. Most commands have a help option.

The --help Option
  • Displays usage summary and arguments list
  • Used by most but not all commands

The man command

  • Provides documentation for commands
  • Almost every command has a man page
  • Pages are grouped into chapters
  • Collectively referred to as the Linux Manual

The info command

  • Similar to man, but often more in depth
  • Run info without args to list all page








thanks for the reply. Actually man is not argument of any command. All available commands can be given as argument of man(another command which searches the manual),
and is rarely applicable to new users.


Hope to hear more from you

I took references from a book named “redhat enterprise linux essentials”.  So ….
Mahmudur Rahman
RF Optimization Engineer
Radio Network Planning & Optimizations
ZTE Corporation Bangladesh Limited
[email: riyad_ete@yahoo.com]