Bash Shell Basic Operation commands and environment variable commands (note)

Source: Internet
Author: User
Tags echo name

First, the Bash Shell Basic Operations Command
1.type: See if the command is a built-in command of the Bash shell type cd
2.Echo: The display of the variable echo $ variable echo name
3.unset: Cancels the variable you just set unset name
4.Envor SET command to view environment variables
5.ExportChange the custom variable to the environment variable export variable name
6.ReadVariable keyboard reads read [-PT] Variable
7.Declare/typesetDeclaring a variable of type declare [-AIXR] Variable
-A: Defines the latter variable as an array
-I: Define the latter variable as an integer numeric type
-X: Defines the latter variable as an environment variable equal to the export
-r: Set variable as read-only type
8.Array: Array Number of groups eg :vaR[1]="d INg "vaR[2]="d oNg "eCho" {var[1]},${var[2]} "display Ding,dong
9.Ulimit: Limited relationship to file systems and programs Ulimit [-SHACDFLTU] [quotas]
-A: No parameters are followed, all limits can be listed
-F: Maximum file capacity that can be created (typically set to 2GB) units of Wei kb
10.alias: command alias Eg:alias ll= ' ls-l ' input ll equals ls-l command
11.Unalias: Cancel alias Eg:unalias ll
12. History: Historical command history [n] N: Representing numbers, listing the last n commands
History [-craw] Histfiles
-C: Empty all current History content
-r: Read Histfiles's contents into the current Shell's history memory
-W: Writes current history memory content to Histfile
I number: The meaning of the execution of the first order
I command: Search forward by the nearest command string beginning for command command
!! Execute the previous command

Second, Bash shell environment variable command
1,stty: Set the terminal input Key command Stty [-a]
-A: List all current stty parameters
Eg:stty Erase ^h Settings [ctrl]+h for character deletion
2. wildcard characters
*: represents 0 to infinity of any number of characters
? : The delegate must have an arbitrary character
[]: The representation must have a character within the brackets
[-]: represents all characters within the encoding order, such as all numbers in the range [0-9]
[^]: Indicates an original selection, [^abc] represents a character, not a, B, c character
3. Data Volume redirection
Standard input: Code 0, using < or <<
Standard output: Code 1, using > or >>
Standard error Output: Code 2, using 2> or 2>>
1>: Output the correct data to the specified file or device in an overriding way
1>>: Output the correct data to the specified file or device in an additive way
2>: outputting the wrong data to the specified file or device in an overridden manner
2>>: The incorrect data is output to the specified file or device in an additive way
4. The judgment basis of the command execution : ";" "&&" "| |"
"CMD1;CMD2": Indicates that multiple commands are executed at the same time, separated by ";" Between commands
"CMD1&&CMD2": If the cmd1 execution is complete and correct, the CMD2 is executed, and if CMD1 is executed as an error, CMD2 does not perform
"Cmd1| | CMD2 ": If the cmd1 execution is complete and is correct, CMD2 does not execute, if the cmd1 execution completes is the error, then executes CMD2

Bash Shell Basic Operation commands and environment variable commands (note)

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.