After understanding some basic linux commands, we will continue to introduce other intermediate linux commands.

1. cat

Use the this command to display the contents of a file. It is usually used to easily view programs.

2. nano, vim

These are already installed text editors in the Linux command line. The nano command is a good text editor that denotes keywords with color and can recognize most languages. And vim is simpler than nano. You can create a new file or modify a file using this editor.

3. sudo (SuperUser Do)

A widely used command in the Linux command line, sudo stands for “SuperUser Do”. So, if you want any command to be done with administrative or root privileges, you can use the sudo command. You can also use the command “su” to do this, but you need to set a root password before that. For that, you can use the command “sudo passwd”(not misspelled, it is passwd). Then type in the new root password.

4. echo

This command helps us move some data, usually text into a file. For example, if you want to create a new text file or add to an already made text file, you just need to type in, “echo hello, my name is alok » new.txt”.

5. df

Use this command to see the available disk space in each of the partitions in your system. You can just type in df in the command line and you can see each mounted partition and their used/available space in % and in KBs. If you want it shown in megabytes, you can use the command “df -m”. Also, use the command “df -g”, if you want to change to gigabytes.

6. du

Use this command to know the disk usage of a file in your system. If you want to know the disk usage for a particular folder or file in Linux, you can type in the command df and the name of the folder or file. For example, if you want to know the disk space used by the documents folder in Linux, you can use the command “du Documents”. You can also use the command “ls -lah” to view the file sizes of all the files in a folder.

7. tar

Use this command to work with tarballs (or files compressed in a tarball archive) in the Linux command line. It has a long list of uses. It can be used to compress and uncompress different types of tar archives like .tar, .tar.gz, .tar.bz2, etc. It works on the basis of the arguments given to it. You can see more examples for tar by this link.

8. zip, unzip

Use zip to compress files into a zip archive, and unzip to extract files from a zip archive.

9. uname

Use this command to show the information about the system your Linux distro is running. Using the command “uname -a” prints most of the information about the system. This prints the kernel release date, version, processor type, etc.

10. apt-get

Use apt to work with packages in the Linux command line. Use apt-get to install packages. This requires root privileges, so use the sudo command with it. For example, if you want to install downloader wget (this can download files from url), we can type in the command “sudo apt-get install wget”. Similarly, any packages can be installed like this. It is good to update your repository each time you try to install a new package. You can do that by typing “sudo apt-get update”. You can upgrade the system by typing “sudo apt-get upgrade”. We can also upgrade the distro by typing “sudo apt-get dist-upgrade”. The command “apt-cache search” is used to search for a package. If you want to search for one, you can type in “apt-cache search wget”(this doesn’t require root).

11. hostname

Use this command to know your name in your host or network. Basically, it displays your hostname and IP address. Just typing “hostname” gives the output. Typing in “hostname -I” gives you your IP address in your network.

12. ping

Use this command to check your connection to a server. Wikipedia says, “Ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol (IP) network”. Simply, when you type in, for example, “ping google.com”, it checks if it can connect to the server and come back. It measures this round-trip time and gives you the details about it.

Leave a Comment

Your email address will not be published. Required fields are marked *

Loading...