Linux Basic Commands
2 min readApr 29, 2022
Beginner guide to Linux Commands
Linux is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds.
Basic Linux Commands
To open the terminal, press Ctrl+Alt+T in Ubuntu, or press Alt+F2, type in gnome-terminal, and press enter. There is also a GUI way of taking it, but this is better!
- pwd — When you first open the terminal, you are in the home directory of your user. To know which directory you are in, you can use the “pwd” command.
- ls — Use the “ls” command to know what files are in the directory you are in. You can see all the hidden files by using the command “ls -a”.
- cd — Use the “cd” command to go to a directory. For example, if you are in the home folder, and you want to go to the downloads folder, then you can type in “cd Downloads”. Remember, this command is case sensitive.
- mkdir & rmdir — Use the mkdir command when you need to create a folder or a directory.Remember rmdir can be used to remove a empty directory. To remove a directory containing files use rm .
- rm — Use the rm command to delete files and directories. Use “rm -r” to delete just the directory. It deletes both the folder and the files it contains when using only the rm command.
- touch — The touch command is used to create a file. It can be anything, from an empty txt file to an empty zip file. For example, “touch new.txt”.
- man & — help — To know more about a command and how to use it, use the man command. It shows the manual pages of the command. A self documentary in Linux better than any online resource.
- cp — Use the cp command to copy files through the command line. It takes two arguments: The first is the location of the file to be copied, the second is where to copy.
- locate — The locate command is used to locate a file in a Linux system, just like the search command in Windows.
- echo — The “echo” command helps us move some data, usually text into a file.