Shell's Features

Source: Internet
Author: User

Shell's Features

~/.bash_history command history to store files, log out after saving.

$HISTSIZE the number of command history bars, which allows the ~/.bash_history file to store the number of command bars, by default.

!! : Previous command

!$: Last parameter of previous command

Command label: Executes the corresponding command in the history output


*: wildcard characters, any of any characters; ?: Wildcard, an arbitrary character

The alias defined in the current shell is only valid at the current shell

> Output redirect >> Chase Redirect < input redirect 2> error redirect 2>> error append redirect

Input redirection is the contents of the file after using the symbol as input

Error redirection logs only error messages


Shell Variables   

Variables are divided into system preset variables and user-defined variables

Variable rule:

  • Variable name = variable content

  • No spaces on either side of the = sign

  • Variable names can only consist of letters, numbers, underscores, and cannot start with a number

  • Use single quotation marks when the contents of a variable contain special characters

  • When you need to reference the run result of a command in the variable content , you should use the inverted single quote '

  • Use double quotation marks when you need to reference other variable values in the contents of a variable

  • Use double quotation marks when the contents of a variable contain single quotes

Summary: Single quotes will use special characters as ordinary characters, and double quotes will not eliminate the meaning of special characters. (except for the last article above)

ENV: Display System-Preset environment variables

Set: Show all variables, System presets and user-defined

Export: Declaring variables in a child shell

unset variable name: Cancel declaration variable


Special symbols in the shell

#: Comment, ignore the following \: De-ideographic character, eliminate the role of special characters, make it a normal character

~: User's home directory &: Put the command in the background run []: character combination, match any one of the characters in parentheses



This article from "Good Freshman only gourd" blog, please be sure to keep this source http://zhuxingye.blog.51cto.com/11121336/1737906

Shell's Features

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.