Mastering the Basics: Essential Linux Commands Every Beginner Should Know
Table of contents
If you are just learning how to use Linux and don't know the commands to use, in this article you will be exposed to the basic Linux commands you should know to kickstart your Linux journey.
What is Linux?
Linux is an open-source, Unix-like operating system kernel that serves as the core of many different operating systems, known as Linux distributions or distros. The Linux kernel was initially created by Linus Torvalds in 1991 and has since evolved with contributions from a large community of developers worldwide. Linux is a robust, stable, and highly customizable operating system that is widely used for various purposes, including servers, desktops, embedded systems, and more.
Basic Linux commands
There are lots of Linux commands that programmers use daily to make their tasks easier and faster. We will be focusing on the basic ones that you will need as a beginner. I assume you already have a Linux terminal, so you can practice as you learn.
touch: it is used to create a file.
touch file1
When you try that, file 1 is created on the terminal.
pwd: prints the name of the working directory.
pwd
mkdir: it is used to create a directory
mkdir first_dir
cd: it is used to change directory
cd first_dir
rmdir: it is used to remove a directory
rmdir first_dir
cat: It is used to display the contents of a file
cat file1
echo: it is used to write into a file
echo 'I love linux'> file1
ls: It is used to list the contents of a directory
ls first_dir1
cp: it is used to copy contents from one file to another or a directory.
cp file1 file2
contents of file 1 are copied to file 2; if file 2 was not created, it is created automatically.
mv: it can be used to move a file or to rename a file into another
mv file1 file2 mv file2 first_dir
The first command renames file1 to file2, while the second moves file2 into first_dir.
type: indicates how a command name is interpreted.
type ls
which: display which executable program will be executed
help ls
help: get help for shell builtins
help rm mkdir --help
man: display a command's manual page.
man ls
info: display a command info entry
info mkdir
whatis: display one line manual page
whatis ls
- clear: it is used to clear the terminal
Let me show you a terminal that practices these commands so you can have a full understanding.
When you use the help command, you can easily use the letter q to quit the page and move to the main terminal.
Thanks for reading this article. Please follow and subscribe to my newsletter so you won't miss an article.