What are the most useful basic Linux commands?

Author Name
Answered by: Joyce , An Expert in the Linux Basics Category
Linux is a powerful operating system. It gives the user full control over their computer provided they know how to use it. Today there are many different Linux based operating systems and each has made attempts at making the operating system more user friendly. Still, even today, you may find yourself asking, "What are the most useful basic Linux commands?"



Most tasks can be accomplished in some form using the Linux GUI, or Graphical User Interface. If you find yourself wanting more control, or find that their isn't a graphical way to accomplish your task, then knowing the most useful basic Linux commands will be a great help.

For the sake of readability, all Linux commands are contained between quotes, like this: "cd .."



You should use the command as it is, but without the quotes.

CD - Change Directory

If you are used to using a modern Windows operating system, then you may be used to using the term "folder" rather than "directory". The two words both represent the same thing, and can be used interchangeably. This command will allow you to move around the folders of your hard drive. As one of the most essential Linux commands, it is also one of the easiest to learn.

CD stands for "change directory". There are a few ways to use it.

"cd .." - This command will go up one folder. For example, if you are in /home/Downloads this command will change your current working directory to /home.

"cd #" - This useful command will bring you back to your home directory.

"cd Documents" - If you specify a folder that is currently in your current working directory (A.K.A. the folder you are in at the moment) then this command will change to that folder.

LS

LS is short for "list" and is used to display a list of all of the files and folders in the current working directory. It can also be used to "list" USB devices, among other things. Often used after the "CD" command, the "LS" command is essentially the same thing as opening a folder on the Desktop. It changes to that directory and then displays the contents.

"ls" - The simplest form of this command, displays the contents of the current working directory.

"ls usb" - Prints to the console a list of connected USB devices and useful information about them.

MKDIR

If there weren't any folders on your computer, you couldn't do much with the CD and LS commands. Keeping in mind that a directory is the same thing as a folder, the MKDIR command allows you to "make a directory", which is what the command name is short for. To create a new folder using this command, simply CD to the folder you wish to create the new folder in (for example, Desktop) and then run the command as follows:

"mkdir newFolder" - this command will create a new folder named "newFolder".

Be sure to remember that Linux is case sensitive, so "newFolder" and "newfolder" are not the same.

RM

This command is used to "remove" files. Be careful with this command, as it can mercilessly cause data loss if used improperly. One thing to never do with the RM command is to issue it like this: "rm *"

In Linux, the asterisk * is known as the wild card. It represents anything and everything. So "rm *" will remove anything and everything. That means all of your photos, music, documents, etc.

To safely use the RM command, make sure to provide a filename.

"rm file.txt" - this command will look for a file named "file.txt" in the current working directory, and it will remove it permanently.

SUDO

Another command to be careful with, SUDO (which stands for "Super User Do") is the key to the system. This command will let you do anything, and run any command. This can be dangerous if you are editing system files or doing other administrative work.

One reason to use SUDO (and a mostly safe way) is to use it to install applications. On Ubuntu, the command is "sudo apt-get install appname", where appname is the name of the application you want to install.

Author Name Like My Writing? Hire Me to Write For You!

Related Questions