Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic commands commonly used by beginners in Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "what are the basic commands commonly used by beginners in Linux", the content is simple and clear, and I hope it can help you solve your doubts. Let me lead you to study and learn this article "what basic commands are commonly used by beginners in Linux".

Linux has a great influence on our lives. For beginners, getting Linux for the first time will only make you feel uncomfortable. Because on Linux, you should usually use terminal commands instead of just clicking on the launcher image (as you do on Windows). Don't worry, however, the 10 basic Linux commands and important commands described in this article will help you get started as soon as possible.

Linux has a great influence on our lives. At the very least, your Android phone has a Linux kernel on it. However, using Linux for the first time will only make you feel uncomfortable. Because on Linux, you should usually use terminal commands instead of just clicking on the launcher image (as you do on Windows). But don't worry, the following 10 basic Linux commands and important commands will help you get started as soon as possible.

When we are talking about Linux commands, we are actually talking about the Linux system itself. Just 10 basic Linux commands won't make you a genius or Linux expert. It will help Linux novices use these Linux basic commands, or Linux common commands, to handle daily basic tasks.

All right, let's take a look at each of these 10 basic Linux commands.

1.sudo

This SuperUserDo is the most important command for beginners to use in Linux. This sudo command is required for every command that requires root permissions. You can use sudo before every command that requires root permission.

$sudo su

2.ls (list)

Like everyone else, you often want to see anything in the catalog. With the list command, the terminal will display all the files and folders in the directory you are working on. Suppose I'm in the / home folder and want to see the directories and files in / home.

/ home$ ls

The ls in / home returns the following result:

Imad lost+found

3.cd

Changing the directory (cd) is always the primary command used in the terminal. It is one of the most basic Linux commands. It is easy to use this command. Just enter the name of the folder you want to enter from the current directory. If you want to go back to the next level, just put the double dots (..) As a parameter.

Suppose I'm in the / home directory and want to go to the usr directory, which is always in / home. Here is how I can use the cd command:

/ home $cd usr / home/usr $

4.mkdir

Just changing the directory is not comprehensive. Sometimes you want to create a new folder or subfolder. You can use the mkdir command to do this. Just put your folder name after the mkdir command in the terminal.

~ $mkdir folderName

5.cp

Copy and paste is an important task that we need to complete in order to organize and organize documents. Using cp will help you copy and paste files from the terminal. First, you determine the file you want to copy, then enter the destination location, and then you can paste the file.

$cp src des

Note: if you copy files to a directory where root permissions are required for any new files, then you need to use the sudo command.

6.rm

The rm command removes your files or even your directories. If the file needs root permission to remove it, you can use-f. You can also use-r for recursive removal to remove your folder.

$rm myfile.txt

7.apt-get

This command varies from release to release. In the Debian-based Linux distribution, if you want to install, remove, and upgrade any package, you can use the Advanced Packaging tool (APT) package manager. The apt-get command helps you install the software you need to run in Linux. This is a powerful command-line tool that can perform tasks such as installing, upgrading, and even removing software.

In other distributions, such as Fedora and Centos, there are different package managers. Fedora used to have yum, but now it has dnf.

$sudo apt-get update $sudo dnf update

8.grep

You need to find a file, but you can't remember its exact location or path. Grep can help you solve this problem. You can use the grep command to help find the file based on the given keyword.

$grep user / etc/passwd

9.cat

As a user, you often need to look at some documents or code from scripts. Again, one of the basic Linux commands is the cat command. It will display the text in the file for you.

$cat CMakeLists.txt

10.poweroff

The last command is poweroff. Sometimes, you need to turn it off directly from the terminal. This command will accomplish the task. Don't forget to add sudo at the beginning of the command, because it requires root permissions to execute poweroff.

$sudo poweroff

As I mentioned at the beginning of the article: these 10 basic Linux commands won't immediately make you a Linux geek. It will help you start using Linux at this early stage. With these basic Linux commands, start using Linux and set a goal: learn to use one or three commands a day. This is the purpose of this article. I hope it will be helpful to you.

Here are a few more commonly used instructions for your reference:

Ls displays files or directories

-l list file details l (list)

-a lists all files and directories in the current directory, including hidden a (all)

Mkdir create directory

-p create a directory, if there is no parent directory, create p (parent)

Cd changes directories

Touch creates an empty file

Echo creates a file with content.

Cat views the contents of the file

Cp copy

Mv move or rename

Rm deletes a file

-r Recursive deletion, subdirectories and files can be deleted

-f forcibly delete

Find searches the file system for a file

Wc counts the number of lines, words and characters in a text.

Grep looks for a string in a text file

Rmdir delete empty directory

Tree tree structure display directory, need to install tree package

Pwd displays the current directory

Ln creates a linked file

More and less display text file content in paging

Head and tail display the header and tail of the file.

Ctrl+alt+F1 command line full screen mode

The above is all the contents of the article "what are the basic commands commonly used by beginners in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report