Hey All,
Today i will be sharing with you the basic commands you will need to know for using Terminal in UBUNTU or while using PUTTY or any similar terminal version's on Windows
To launch a new Terminal Session on Ubuntu:- Press CTRL + ALT + T .
Syntax is defined as the method to write a particular command or statement !
COMMANDS :-
1) The tilde (~) symbol stands for your home directory. If you are user, then the tilde (~) stands for /home/user
2) pwd: The pwd command will allow you to know in which directory you're located (pwd stands for "print working directory"). Example: "pwd" in the Desktop directory will show "~/Desktop". Note that the GNOME Terminal also displays this information in the title bar of its window. A useful gnemonic is "present working directory."
3) mkdir : This command is used to create a new folder .
Syntax :- mkdir <folder name>
Example :- mkdir Test ,where "Test" is the folder name that will be created !
4) ls: The ls command will show you ('list') the files in your current directory. Used with certain options, you can see sizes of files, when files were made, and permissions of files. Example: "ls ~" will show you the files that are in your home directory.
5) cd: The cd command will allow you to change directories. When you open a terminal you will be in your home directory. To move around the file system you will use cd. Examples:
To navigate into the (Main) root directory, use "cd /"
To navigate to your home directory, use "cd" or "cd ~"
To navigate up one directory level, use "cd .."
To navigate to the previous directory (or back), use "cd -"
To navigate through multiple levels of directory at once, specify the full directory path that you want to go to.
For example, use, "cd /var/www" to go directly to the subdirectory of /var i.e. /www.
6) gedit/vi: Syntax for gedit :- "gedit <filename>.<filetype>" .
gedit is the command used for creating new files with the specified filename and open it at the same time for editing .
While vi command is used in place of gedit in all terminal's with the same usage as of gedit as in Ubuntu.
Syntax for vi :- "vi<filename>.<filetype>"
7) cc : Used to compile the programs .
By default Syntax :- cc <filename>.<filetype> make the output on a file called a.out .
To save the output to a file named "output.out" the Syntax is :- "cc <filename>.<filetype> -o output.out "
8) .\ :- Used to run the output files .
Syntax :- .\ <filename>.<filetype>
9) i :- Used to enter 'insert mode' after opening a file in vi mode
10) 'Esc Button' :- Used to exit 'insert mode' after editing a opened file in vi mode
11) :wq or <semicolon>wq :- Used to close and save a opened file
12) :q or <semicolon>q :- Used to only close a opened file
13) echo :- Used to output data / text to the terminal screen
Syntax : echo <Your Desired Output>
Example : echo Hello World !
14) cat :- Used to display the content's of a file with some content pre-written in it
15) touch :- To create a file
Syntax : touch <Your Desired filename>.<filetype>
Example : touch Test2.txt
16) cp :- To copy a file/folder from a given directory to another directory
Syntax : cp <Your Old Folder/File Location> <New File/Folder Destination>
Example : cp Test2 NewTest
17) mv :- To rename a file/folder from a given name to another name
Syntax : mv <Your Old Folder/File Name> <New File/Folder Name>
Example : mv Test2 NewTest2
NOTE :- Operators < and > are used to separate/highlight some expression and is not a part of the syntax .
Source :- Reference Books and Ubuntu Support
This guide was last updated on 28/03/18 and is up to date till the above mentioned date.
I will not be responsible for any damage to your system due to any mistake by you in following the guide correctly !
If you face any difficulties or the steps fail ,try contacting me ! I will try my best to help you !
Have a nice day !
-Febin Koshy Philip
Febkosq8
Today i will be sharing with you the basic commands you will need to know for using Terminal in UBUNTU or while using PUTTY or any similar terminal version's on Windows
To launch a new Terminal Session on Ubuntu:- Press CTRL + ALT + T .
Syntax is defined as the method to write a particular command or statement !
COMMANDS :-
1) The tilde (~) symbol stands for your home directory. If you are user, then the tilde (~) stands for /home/user
2) pwd: The pwd command will allow you to know in which directory you're located (pwd stands for "print working directory"). Example: "pwd" in the Desktop directory will show "~/Desktop". Note that the GNOME Terminal also displays this information in the title bar of its window. A useful gnemonic is "present working directory."
3) mkdir : This command is used to create a new folder .
Syntax :- mkdir <folder name>
Example :- mkdir Test ,where "Test" is the folder name that will be created !
4) ls: The ls command will show you ('list') the files in your current directory. Used with certain options, you can see sizes of files, when files were made, and permissions of files. Example: "ls ~" will show you the files that are in your home directory.
5) cd: The cd command will allow you to change directories. When you open a terminal you will be in your home directory. To move around the file system you will use cd. Examples:
To navigate into the (Main) root directory, use "cd /"
To navigate to your home directory, use "cd" or "cd ~"
To navigate up one directory level, use "cd .."
To navigate to the previous directory (or back), use "cd -"
To navigate through multiple levels of directory at once, specify the full directory path that you want to go to.
For example, use, "cd /var/www" to go directly to the subdirectory of /var i.e. /www.
6) gedit/vi: Syntax for gedit :- "gedit <filename>.<filetype>" .
gedit is the command used for creating new files with the specified filename and open it at the same time for editing .
While vi command is used in place of gedit in all terminal's with the same usage as of gedit as in Ubuntu.
Syntax for vi :- "vi<filename>.<filetype>"
7) cc : Used to compile the programs .
By default Syntax :- cc <filename>.<filetype> make the output on a file called a.out .
To save the output to a file named "output.out" the Syntax is :- "cc <filename>.<filetype> -o output.out "
8) .\ :- Used to run the output files .
Syntax :- .\ <filename>.<filetype>
9) i :- Used to enter 'insert mode' after opening a file in vi mode
10) 'Esc Button' :- Used to exit 'insert mode' after editing a opened file in vi mode
11) :wq or <semicolon>wq :- Used to close and save a opened file
12) :q or <semicolon>q :- Used to only close a opened file
13) echo :- Used to output data / text to the terminal screen
Syntax : echo <Your Desired Output>
Example : echo Hello World !
14) cat :- Used to display the content's of a file with some content pre-written in it
15) touch :- To create a file
Syntax : touch <Your Desired filename>.<filetype>
Example : touch Test2.txt
16) cp :- To copy a file/folder from a given directory to another directory
Syntax : cp <Your Old Folder/File Location> <New File/Folder Destination>
Example : cp Test2 NewTest
17) mv :- To rename a file/folder from a given name to another name
Syntax : mv <Your Old Folder/File Name> <New File/Folder Name>
Example : mv Test2 NewTest2
NOTE :- Operators < and > are used to separate/highlight some expression and is not a part of the syntax .
Source :- Reference Books and Ubuntu Support
This guide was last updated on 28/03/18 and is up to date till the above mentioned date.
I will not be responsible for any damage to your system due to any mistake by you in following the guide correctly !
If you face any difficulties or the steps fail ,try contacting me ! I will try my best to help you !
Have a nice day !
-Febin Koshy Philip
Febkosq8
Comments
Post a Comment