Mastering the Basics: Essential Linux Commands Every Beginner Should Know

Mastering the Basics: Essential Linux Commands Every Beginner Should Know

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.

  1. touch: it is used to create a file.

     touch file1
    

When you try that, file 1 is created on the terminal.

  1. pwd: prints the name of the working directory.

     pwd
    
    1. mkdir: it is used to create a directory

       mkdir first_dir
      
    2. cd: it is used to change directory

       cd first_dir
      
    3. rmdir: it is used to remove a directory

       rmdir first_dir
      
    4. cat: It is used to display the contents of a file

       cat file1
      
    5. echo: it is used to write into a file

       echo 'I love linux'> file1
      
    6. ls: It is used to list the contents of a directory

       ls first_dir1
      
    7. 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.

    8. 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.

    9. type: indicates how a command name is interpreted.

       type ls
      
    10. which: display which executable program will be executed

      help ls
      
    11. help: get help for shell builtins

      help rm
      mkdir --help
      
    12. man: display a command's manual page.

      man ls
      
    13. info: display a command info entry

      info mkdir
      
    14. whatis: display one line manual page

      whatis ls
      
  1. 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.