Tuesday 20 July 2021

Top 10 Basic Linux Commands For Beginners


Let's learn some basic linux commands

Let's learn some basic linux commands

  1. ls - List all the folder contents

    Example: ls -la List all hidden files and directories

  2. pwd - Print name of current/working directory

    Know your working directory location or path

  3. cd - Enter into or exit from the directory

    Syntax: cd destination_path

    Example: cd /home/user Enter into a home user location

  4. mkdir - Create a directory

    Syntax: mkdir directory_name

    Example: mkdir test Create a new directory named test

  5. rm - Remove a file or directory

    Syntax: rm filename

    Example: rm myfile Remove a file called myfile

    Example: rm -r myfolder Remove a folder called myfolder

  6. mv - Move/Rename a file or folder

    Syntax: mv source_filename destination_filename

    Example: mv file1 file2 Move or rename a file1 to file2

  7. cp - Copy files and directories

    Syntax: cp source_filename destination_filename

    Example: cp file1 file2 Copy all contents from a file1 to file2

  8. cat - Display file contents

    Syntax: cat filename

    Example: cat file1 Show all the contents inside the file1 in standared output device(usually your monitor).

  9. su - Switch user account

    Syntax: su - username

    Example: su - linuxer logged into linuxer user account.

  10. touch - Create an empty file with the specified name.

    Syntax: touch filename

    Example: touch file1 Create an empty file called file1.