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:
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.
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-
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:
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
or you can also go step by step
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:
. .esd_auth .ICEauthority .recently-used
To see the details of all elements.
Command options can also be combined. To see details of hidden files
To see a list of available command options add --help. e.g:
ls --help or
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:
will run a program called browser located in current directory