Linux 10 novice commands to share

  • 2020-06-15 11:00:47
  • OfStack

Linux has a great impact on our lives. For starters, getting Linux on the first try will only make you 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, these 10 basic Linux commands and key commands will help you get started.

Linux has a great influence on our lives. At the very least, you have the Linux kernel on your Android phone. However, getting Linux on the first try will only make you feel uncomfortable. Because on Linux, you should usually use the terminal command instead of just clicking on the launcher image (as you would on Windows). But don't worry, here are 10 basic Linux commands and key commands to get you started.

When we talk about the Linux command, we are really talking about the Linux system itself. Just 10 basic Linux commands won't make you a genius or Linux expert. It helps Linux novices to use these Linux basic commands, or Linux common commands, for day-to-day basic tasks.

Well, here are the 10 basic Linux commands, one at a time.

1.sudo

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


$ sudo su 

2.ls(list)

Just like everyone else, you often want to see everything in a directory. Using the list command, the terminal displays 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 

ls in /home returns the following results:


imad lost+found 

3.cd

Changing the directory (cd) is the primary command that is always used in the terminal. It is the most basic Linux command 1. Using this command is simple. Simply enter the name of the folder to which you want to go from the current directory. If you want to go back up to level 1, simply place a double dot (..) As a parameter.

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


/home $ cd usr 
 
/home/usr $ 

4.mkdir

Changing the directory alone is not complete. Sometimes you want to create a new folder or subfolder. You can do this using the mkdir command. Just put your folder name at the end of the mkdir command.


~$ mkdir folderName 

5.cp

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


$ cp src des 

Note: If you copy a file to a directory that requires root permissions for any new file, you will need to use the sudo command.

6.rm

rm is a command that removes files and even directories. If the file needs root permission to be removed, use -f. You can also use -r for recursive removal to remove your folder.


$ rm myfile.txt 

7.apt-get

This command varies from distribution to distribution. In the ES108en-based Linux distribution, you can use the Advanced Wrapper Tool (APT) package manager to install, remove, and upgrade any package. The apt-ES112en 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 can't remember its exact location or path. grep can help you solve this problem. You can use the grep command to help find files based on a given keyword.


$ grep user /etc/passwd 

9.cat

As a user, you often need to view some documentation or code from a script. Similarly, one of the Linux base commands is the cat command. It will show you the text in the file.


$ cat CMakeLists.txt 

10.poweroff

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


/home$ ls 
0

As I mentioned at the beginning of this article: These 10 basic Linux commands don't immediately turn you into an Linux geek. It will help you get started with Linux at this early stage. With these basic Linux commands, start using Linux and set a goal of learning to use one to three commands a day. That's the purpose of this article, and I hope it helps.

Here to share a few common instructions for your reference:

ls displays files or directories

-l lists file details l(list)

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

mkdir creates directories

-ES178en create directory, or p(parent) if no parent directory

cd toggle directories

touch creates an empty file

echo creates the file with the content.

cat views the file contents

cp copy

mv move or rename

rm deletes files

-r recursively removes subdirectories and files

-f mandatory deletion

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 removes empty directories

The tree tree structure shows the directory where the tree package needs to be installed

pwd displays the current directory

ln creates link files

more, less pages display text file contents

head and tail display header and footer contents

ctrl+alt+F1 command line full screen mode

conclusion

That's it for Linux10 novice commands in this article. Welcome to: Linux enterprise operation and maintenance personnel commonly used 150 commands to share, Linux library files, Linux file under the simple method of segmentation and merger, please point out any questions, thank you!


Related articles: