Contact Us

Kockpit is here to help you

Business Form

Arpit Dubey

10 Useful Linux Commands Every User Should Know

Linux is a family of open-source Unix operating systems based on the Linux Kernel. They include Ubuntu, Fedora, Debian, OpenSUSE, and Red Hat. There are 3.74 Billion global internet users, and all of them use Linux in one way or the other since Linux servers power 90% of the internet.

Most modern routers run Linux or Unix, and the top 500 Supercomputers also rely on Linux. An Android operating system is constructed from the Linux kernel. In other words, Linux is almost everywhere.

But there is a difference between using Linux-based technologies and using Linux itself. If you're interested in Linux but have been using a PC or Mac desktop, you may be wondering what the things you need to know to use the Linux command line interface (CLI) effectively are. Let's start by mastering Linux CLI with these 10 fundamental commands.

10 Basic Linux Commands

The following are the most fundamental Linux commands you need to know for a smoother experience in Linux operating system. Each command is very simple and easy to memorize and can be useful in big data analytics and Power BI services.

ls

If you're wondering, that is not a typographical error - It is meant to be typed as a lowercase L. “ls,” or “list,” is the number one command that you need to know if you want to use the Linux CLI. This list command functions within the Linux terminal to reveal all the main directories filed under a respective file system. For example, this command:

ls /applications

The command “Is” is used to show every folder stored in the applications folder. You might have to use it to view files, folders, and directories.

All hidden files are viewable by using the command (ls -a).

cd

This command is what you can use to go (or “change”) to a directory. It is used to navigate from one folder to another. Say you're in your Downloads folder, but you like to move to a folder called songs. Simply typing “cd” songs won't work, as the shell won't recognize it and will report the folder you're looking for doesn't exist. To mention that folder, you'll need to include a backslash. The command should look like this:

cd songs\

To go back from the present folder to the previous one, you can type in the folder name followed by (cd ..) consider the two dots like a back button.

mv

This command in Linux operating system transfers a file from one folder to another; “mv” stands for “move.” This short command is like dragging a file to another folder on a PC.

For example, if I created a file called testfile to demonstrate all the basic Linux commands, and I want to move it to my Documents folder, I would issue this command:

(mv /home/sam/testfile /home/sam/Documents/)

The first part of the command (mv) is used to move a file, the second part (home/sam/testfile) names the file you want to move, and the third part (/home/sam/Documents/) indicates the location where you want the file to be transferred.

Keyboard shortcuts

Keyboard Shortcuts include more than one command, but we can't exclude them. Why? Because they save time and improve your experience.

  • CTRL+K Cuts the text from the cursor until the end of the line.
  • CTRL+Y Pastes text.
  • CTRL+E Moves the cursor toward the end of the line.
  • CTRL+A Moves the cursor to the beginning of the line.
  • ALT+F Jumps forward to the next space.
  • ALT+B Skips back to the previous space.
  • ALT+Backspace Deletes the previous word.
  • CTRL+W Cuts the word behind the cursor.
  • Shift+Insert Pastes text into the terminal.
  • Ctrl+D Logs you out.

These commands in Linux operating system always come in handy in many ways. For example, if you misspell a word in your command text:

(sudo apt-get intall programname)

In this command, “install” is misspelled so that the command won’t work. But keyboard shortcuts make it easier to go back and fix it. If my cursor is at the end of the line, I can press ALT+B twice to easily move the cursor to the place noted below with the ^ symbol: (sudo apt-get install programname)

Now, we can quickly add or change the letters to fix the word install.

mkdir

This is the command you use to make a new directory or a new folder in the Linux environment. The user executing this command must have the privilege to make a new folder in the parent directory, or they may receive a permission denied error.

For example:

mkdir [option] directory_name

at

If you would like to run a Linux command at a certain time, you can add “at” to the equation. The syntax is followed by the date and time you want the command to run at. Then the command prompt changes to at> so that you can enter the command(s) you want to run at the time you specified before.

For example:

at 4:08 PM Sat

at> cowsay 'hello'

at> CTRL+D

This will run the program at 4:08 p.m. on Saturday night.

rmdir

This command allows you to remove a directory in the system through the Linux CLI.

For example:

(rmdir testdirectory)

Keep in mind that this command will not remove a directory that has files inside. This only works when removing empty directories.

rm

If you want to remove files, then “rm” is the command you are looking for. It can delete directories along with the files. To delete a single file, type (rm testfile), or to delete a directory and the files inside it, type (rm -r).

touch

The touch command, otherwise known as the “make file command,” allows you to create a new, empty file using the Linux CLI. Just like “mkdir” creates directories, touch creates files. For example, touch Hello will make an empty file named Hello.

locate

This command is what you use to search for a file in a Linux system. Think of it like a search in Windows. It's very useful if you forget where you stored the specified file or what you named it.

For example, if you have a document about songs use cases, but you can't think of the title, you can punch in locating -songs or by separating the words with an asterisk or asterisks (*).

For example:

(locate -i*songs*)

Conclusion

Linux commands let you perform basic and administrative tasks quickly and easily from the Terminal. With these Linux commands, users can have more flexibility over your system and the ability to access features that are not always available through a graphical user interface.

These Linux commands can help you up your coding game drastically. Kockpit Analytics is a major contributor to data analytics and Power BI services in India that also uses Linux to deliver astonishing results. Contact us now to get a free demo.