Im new to linux and learing linux commands and syntax. can anyone drop 25 most used linux commands with examples and syntax? if you share linux commands with examples and syntax, that will be really helpful. Image help will be really useful.
Share
kushwanth
Here is a list of basic Linux commands:
1.pwd command: it is used to find out the path of the current working directory-Example of an absolute path is /home/username.
2.cd command:syntax cd filename-Example,you’re in /home/username/Documents and you want to go to Photos,cd photos
3.ls command: ls command is used to view the contents of a directory-Example, enter ls /home/username/Documents to view the content of Documents.
4.cat command: It is used to list the contents of a file on the standard output (sdout)-for example, cat file.txt
5.cp command:it is used to copy files from the current directory to a different directory-For example, the command cp scenery.jpg /home/username/Pictures would create a copy of scenery.jpg (from your current directory) into the Pictures directory.
6.mv command: it is used to move files, although it can also be used to rename files-For example: mv file.txt /home/username/Documents.
7.mkdir command:it is used to make a new directory-for example,mkdir Music will create a directory called Music.
8.rmdir command: it is used to delete a directory-for example rmdir filename
9.rm command: it is used to delete directories and the contents within them-for example,If you only want to delete the directory — as an alternative to rmdir — use rm -r.
10.touch command: it allows you to create a blank new file through the Linux command line-Example, enter touch /home/username/Documents/Web.html to create an HTML file entitled Web under the Documents directory.
11.locate command:it is used to locate a file-for example locate -i school*note command will search for any file that contains the word “school” and “note”, whether it is uppercase or lowercase.
12.find command-using find also searches for files and directories-Example, find /home/ -name notes.txt command will search for a file called notes.txt within the home directory and its subdirectories.
13.grep command: It lets you search through all the text in a given file-for Example, grep blue notepad.txt will search for the word blue in the notepad file.
14.sudo command: this command enables you to perform tasks that require administrative or root permissions
15.df command: command to get a report on the system’s disk space usage-example df -m.
16.du command: If you want to check how much space a file or a directory takes-example, type du
17.head command:it used to view the first lines of any text file-Example,type head -n 5 filename.ext.
18.tail command: it will display the last ten lines of a text file-For example, tail -n filename.ext.
19.diff command:it compares the contents of two files line by line-for example,diff file1.ext file2.ext
20.chown command: it enables you to change or transfer the ownership of a file to the specified username-for example,chown linuxuser2 file.ext will make linuxuser2 as the owner of the file.ext.
21.ping command: it is used to check your connectivity status to a server-For example, by simply entering ping google.com
22.wget command: you can even download files from the internet with the help of the wget command-Example, wget followed by the download link.
23.man command: easily learn how to use them right from Linux’s shell by using the man command-Example,entering man tail will show the manual instruction of the tail command.
24.echo command:This command is used to move some data into a file-For example, if you want to add the text, “Hello, my name is John” into a file called name.txt, you would type echo Hello, my name is John >> name.txt
25.zip, unzip command:Use the zip command to compress your files into a zip archive, and use the unzip command to extract the zipped files from a zip archive.