I develop for Linux for a living, I used to develop for DOS.
Going from DOS to Linux is like trading a glider for an F117.
— Lawrence Foard, email@example.com
Linux is a UNIX -like free and open source operating system. By free and open source it means that that linux operating systems are free to download (without any charges) along with their source code which is manipulated and developed by thousands of linux enthusiasts or open source communities and released in form of distributions, also called distros for example Arch linux, linux mint, Debian, Ubuntu, Fedora, etc.
Linux interface is pretty user friendly and hence easy to understand but I think apart from that there are few commands that everyone should know in order to get familiar with the terminal which is like command prompt of windows, as it may come handy in future.
Now I believe that you are familiar with downloading linux and already know how to run it as dual boot or in VMware/VirtualBox (recommended). In case you are not familiar with it then click the link given below
Now I have listed some commands and their uses, also I would suggest you to refer to screenshots for better understanding.
So the top 20 commands are:-
1. To view your present working directory:
Use: It will display your current directory your working in
2. To see all directories:
ls To see all the files and folders
ls –l To see detailed list of files and folder
ls –a To see all files and folder including hidden
ls –la Combination of –l and –a .
More generally only ” ls” is used but in case you want more information like date, file permissions, etc. or you want to view hidden files or folders in your terminal then apply “–l” and “–a” attributes to “ls” command respectively.
3. To navigate through the files and folder:
a. Command: cd (change directory)
Use: To enter into a folder or directory by using this command along with path the folder.
b. Command: cd ..
Use: To move one level back from your current folder.
c. Command: cd
Use: To move back to home directory.
4. To create a new folder or directory:
Use: To create a new folder or directory.
5. To delete a folder or directory:
Use: To remove or delete the folder or directory
6. To create a file:
Command: touch filename
Use: To create a blank text file, use touch command along with file name.
7. To remove a file:
Command: rm filename
Use: To delete the particular file or text file.
8. Copy a file:
Command: cp filename1 filename2
Use: To create an exact copy of filename1 which is named as filename2.
9. To move a file:
Use: It moves a file from one folder or location to another folder or location. It first creates a copy of the file at another location with same name and deletes the original file.
10. To rename a file:
Command: mv filename1 filename2
Use: According to above concept of moving a file it creates a copy of the file at same location with different name.
11. To search a word in a file:
Command: grep word filename
Use: It searches a particular word in a given file and displays the lines where it was found
12. To compare two files:
Command: diff filename1 filename2
Use: It compares the two given file line by line and any line different in the two files is displayed
13. To display a line or output a variable:
Use: Probably it is the stupidest command until now because it just displays the same line you have typed under echo command again on the screen. Also it can display the variable content in the terminal, but it is quite useful in shell scripting.
14. Complete information on a command:
Command: info commandname
Use: It displays all the information available on a particular command that you would want to know.
15. To compress a file:
Command: gzip filename
Use: It compress the file in .gz format
16. To extract a file:
Command: gunzip filename.gz
Use: Extracts the .gz file
17. To compress multiple files:
Command: tar cvf file.tar filename1 filename2 filename3
Use: It will create file.tar which will compress 3 files similar to .zip file in windows
18. To extract files from .tar file:
Command: extract xvf file .tar
Use:It is similar to .zip in windows so in the same way it will extract the multiple files from .tar file
19. To run a shell script (.sh file):
Command: bash filename.sh
Use: To execute a shell script file
20. To install a software using apt (advanced package tool):
Command: sudo apt –get softwarename
Use: To install a software using apt command in terminal
There are many more commands like clear, cat, chmod, etc. that everyone should know about but I think at least these basic commands that are applicable in any linux distro.
Thanks for reading and I hope this helps. For any query comment down bellow.
You can follow me on Google+ by clicking on the link below
Written by Akarsh Singh