Linux's most commonly used shell commands

Source: Internet
Author: User
Tags echo command

Linux must use the Linux shell command . Nonsense! You don't know any Linux commands , such as Ps,grep,ls, but you can still use a lot of modern Linux desktop distributions.


Linux system administrators are not like desktop users, they don't use cinnamon,gnome,unity, or KDE, all the time with Linux commands.


for desktop users, if you understand a subset of Linux commands, you can better use Linux to experience its charm, listed below:


Shell Base:


You can execute the shell command by opening the Linux terminal (terminal). There are many types of shells, such as the Csh,bourne Shell,korn shell. In most Linux distributions today, the default shell is typically the Bourne Again Shell (bash).


To see what your shell is, execute the following command


Echo $SHELL


in Linux, the $ symbol represents a shell variable. All shells use variables in this way. There are some shell variables that have default values when your system starts. For example, $SHELL; $LOGNAME is your login name, and the $path variable indicates the search scope for your SHELL command. The effect of the


Echo command is to print out your input. If your input has the special meaning of the shell, such as the shell variable, he will output the value of the variable.

 


An important place is that you pay attention to the case of text. For example, LS, the Linux version of the dos dir command. This command lists the list of files in the current working directory. If you enter LS, you can only get the "command not found" error message.

Another important part of the Linux shell command is that you can string the commands together. This is the ingenious feature that unix/linux from the first day. The simplest way to connect commands is to use "|", which we call "pipe”。 The output of the first command is the input to the next command.

  The Linux command has its own syntax rules:


The basic syntax is like this:


Command-option file


For example:


Ls-la


The meaning of this line of command is to output the file name of all files in the current directory, L for "long", and a For "all", with the L option, you will find that the output is rich, not only file names, but also access to files, owners, groups, and so on. You will find that this command will output a large amount of information on the screen, if there are more files in the current directory.


Now is the time to "pipe".


Ls-la | More


You will see the following message on the screen:


You can also use wildcard characters in most Linux commands. A wildcard is one that can represent any unknown character or string in a file name. For example, * represents any string,? Represents a single character. For example:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.