RedXIII | Sept. 5, 2021, 6:07 a.m.
It seems more and more people are moving to Linux these days. But before users can take full advantage of what this popular open-source operating system has to offer, they’ll need to learn some basic terminal commands.
This post will cover some of the most commonly used commands in the Linux environment. With Linux, not only is it possible to navigate the file system from within the terminal, but users can also download and install software, update their computers, and much more.
Entering the help command in the shell is a great place to start for those new to Linux. This command will provide the user with a list of builtin commands and options for navigating the Linux terminal.
Use the dir command to view the contents of a folder. With this command, the names of any files or folders will be printed to the shell in alphabetical order. This command is useful for navigating the file system of the Linux computer.
The cd command is used to change directories. This is one of the most commonly used commands in the Linux shell. Users can use this command to change the current working directory.
This command has multiple uses. Here’s a quick breakdown of how to use the cd command correctly.
The cat command is used to print the contents of a file. Short for concatenate, this command helps users to quickly inspect files on their computer. For example, the cat command followed by the name of a text file will print the file’s contents to the shell.
If you want to make a new directory on your Linux computer from the shell, use the mkdir command followed by the new directory’s name. With the mkdir command, it’s possible to quickly add folders and subfolders to any project.
To remove a file from the computer’s hard drive, use the rm command. With this command, file’s will be deleted from the computer. To remove a directory of files, you’ll need to use the optional ‘-r’ command. By using the rm -r command, it’s possible to remove an entire directory.
rm -r example_directory
As we type commands into the shell, it tends to fill up and become cluttered with text, making it difficult to read. If you want to clear the shell, use the clear command. This command will wipe the screen, leaving you with a fresh slate.
This is another commonly used command in the Linux shell. The sudo command grants the user special permissions. sudo stands for ‘SuperUser Do’ and it essentially lets the user do stuff that requires root permission.
Some files are more important than others. For example, many files are necessary for the operating system to function properly. Before users can edit these files, they’ll need to tell the computer they have permission to do so. For this, users need the sudo command. And before users can install new packages from the terminal, they’ll need SuperUser privileges.
Use the exit command to close the shell. If multiple tabs are open, only the current tab will be closed.
This is far from a complete list of the commands available in the Linux shell. But it’s a good start for those just learning how to navigate Linux and work within the shell environment. Happy computing everybody.