Friday 5 February 2016

How to use the Linux terminal

The Terminal Emulator is a program that allows you to use the terminal in a graphical user interface. 
This post will show you how to open a Terminal in Linux and use some of the basic commands.

To open a terminal: 
You can open the terminal by either typing "TERMINAL" in the Linux's search box in Menu  OR You can use the shortcut key combination "Ctrl+Alt+T" which would be simpler and more handy.

In the terminal:
When you open the terminal the first line that you see which looks something like jaison@jaison - $ specifies your user name and machine name. The first name is your user name and the second name after @ is your machine name. The cursor blinking after the $ symbol shows that it is ready to accept commands.

Some basic commands:
1.  pwd      - pwd stands for print working directory. Typing pwd in the terminal will display your current directory in which the terminal is open. By default it will be your HOME directory.
Eg. /home/jaison/  -This shows that I am in my root directory (the first '/' symbolizes root directory) and in root directory I am in the 'home' directory and there inside the directory named 'jaison'.

2.  ls      -  ls stands for list. Typing ls in the terminal will display the files and folders that are present in that directory.
Eg. When you are in /home/jaison/ typing ls would display all the files and folders present in /home/jaison/

3. cd      - cd stands for change directory. The cd command enables you to change your working directory from home to any other directory and will help you navigate through directories and files.
Type 'cd' followed by the name of the directory you want to go to.
Eg. jaison@jaison - $  cd Downloads/       -This will take you to the directory 'Downloads'. After this your prompt will look like jaison@jaison ~/Downloads $. This shows that you are in the the directory called 'Downloads'. You can check it out by typing pwd and it will give you an output which looks like /home/jaison/Downloads which shows that 'Downloads'  is your current working directory.

cd ..      - cd .. (cd space followed by two dots) - This command will take you one step back. i.e It will take you to the previous directory you visited.

cd       - Simply typing cd would take you back to your home directory where ever you are.

For more detailed explanation please watch my video below:




No comments:

Post a Comment