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