Skip to main content

Command Palette

Search for a command to run...

Linux basic commands

Published
3 min read
Linux basic commands
K

I'm currently working as Freelancer/Remote developer and crafting Flutter apps with clean code and architecture. I'm learning all about DevOps & Open Source.

What is Linux?

Linux is a free and open-source operating system, and it is a popular choice for those who want to use a powerful and customizable system. One of the things that make Linux so powerful is its command line interface, which allows users to access and manipulate the system in a highly efficient and precise way.

Commands

There are many basic Linux commands that every user should know, and learning these commands can help you get the most out of your Linux system. In this blog post, we will introduce some of the most commonly used Linux commands and explain what they do.

  1. ls: This command is used to list the files and directories in a given directory. By default, the ls the command will display the names of the files and directories in the current directory. For example, if you are in the /home directory and you run ls, you will see a list of the files and directories in the /home directory.

  2. cd: This command is used to change the current directory. For example, if you want to move from the /home directory to the /usr/local directory, you would run cd /usr/local.

  3. pwd: This command is used to print the current working directory. This can be useful if you are not sure where you are in the file system, or if you want to verify that you are in the correct directory before running other commands.

  4. mkdir: This command is used to create a new directory. For example, if you want to create a new directory called my_files in the /home directory, you would run mkdir /home/my_files.

  5. cp: This command is used to copy files. For example, if you want to copy a file called my_file.txt from the /home directory to the /usr/local directory, you would run cp /home/my_file.txt /usr/local.

  6. mv: This command is used to move or rename files. For example, if you want to move a file called my_file.txt from the /home directory to the /usr/local directory, you would run mv /home/my_file.txt /usr/local. If you want to rename the file, you would run mv /home/my_file.txt /home/new_file_name.txt.

  7. rm: This command is used to delete files. For example, if you want to delete a file called my_file.txt from the /home directory, you would run rm /home/my_file.txt.

  8. sudo: This command in Linux stands for "superuser do" and allows users to execute commands with privileges that are typically reserved for the system's root user. This can be useful when a user needs to perform tasks that require higher-level permissions, such as installing software or modifying system files.

These are just a few of the many basic Linux commands that every user should know. By learning and mastering these commands, you can unlock the full potential of your Linux system and become a more efficient and effective user.