03_03 bash feature details (bottom)

Source: Internet
Author: User

Command aliases

Alias comalias= ' COMMAND [options] [arguments] '

Aliases defined in the shell are valid only in the current shell life cycle: The valid range of aliases is only the current shell process:

Ualias Comalias Deleting aliases

Alias cp = ' Cp-i '

command to replace $ (commands) with the ' command '

To replace a subcommand in a command with the process of executing the result

echo "The current directory Is/etc"

echo "The current directory is $ (PWD)"

File-2013-12-12-12-13.txt

Date +%f-%h-$M-%s

Touch./file-$ (date +%f-%h-$M-%s). txt

BASH-supported quotes

": Command substitution

"", double quotes, weak references can implement variable substitution

', single quote strong reference can not implement variable substitution

File name wildcard globbing

* Any character of any length can be no longer

? Match any single character

[] Specify any single character in any specified range

[ABC] [A-z] [A-za-z0-9]

[^]: matches any single character outside the specified range

[^0-9] Non-digital

[: Space:] white space characters

[[: Space:]] Blank Character Set

[:p UNCT:] Punctuation

[: Lower:] lowercase letters

[: Upper:] Uppercase

[: Alpha:] uppercase and lowercase letters

[:d Igit:] Number

[: Alnum:] numbers and uppercase and lowercase letters

also supports reverse [^[:space:]]

Can view man 7 glob


Touch A123 ABC abc123 XYZ x12 xyz123

Start with a letter A

LS A * =>a123 ABC abc123

Letter A begins with a 3-terminated character

LS a*3

Any number of files following the beginning of the letter

[A-za-z]*[0-9]

? y* ==>xyz xyz123

[[: Alpha:]]*[[:space:]]*[[:alpha:]]

The letter begins with a white-space character at the end of the letter

*[0-9]* *[[:d igit:]]*

Number end does not contain whitespace characters *[^[:space:]]*[0-9] There is a problem ... The regular can handle

Non-letter non-numeric: *[^[:alnum:]]*


This article is from the "Jiawu notes" blog, so be sure to keep this source http://jiawu.blog.51cto.com/9349234/1586768

03_03 bash feature details (bottom)

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.