Shell scripts and variables

Source: Internet
Author: User
BASH integrates: ksh, csh, and avoids its defects. 1. File Name wildcard: *: represents any characters of any length. Example: ls *; ls *. log? : Any single character example: ls ?. Log []: any single character in the specified range. [a-z] [abc] example: ls [abc]. log [^ abc], ^: indicates the inverse does not include abc [a-zA-z0-9]

BASH integrates: ksh and csh and avoids its defects.

1. File Name Configuration

Wildcard:

*: Example of any character with any length:Ls*; Ls *. log

? : Any single character example: ls ?. Log

[]: Any single character in the specified range, [a-z] [abc]

Example: ls [abc]. log

[^ Abc], ^: indicates that abc is not included in the result.

[A-zA-z0-9] specifies the character range

[: Keyword:]: [: lower:], [: upper:], [: puNcT:],

[: Space:], [: alpha:]. [:LnUm:] [: diGit:]-(Number)

Man 7 glob: You can view all

[^ [: Alpha:]: "^" indicates inverse.

 

2,CommandCompletion and path completion

Command completion:

Echo $ PATH complete command PATH search

Path completion:

Under the specified path

3. Expand the command line

~ : Expand to the Home Directory of the corresponding user

Cd~ Home Directory

{}: Expand multiple paths

Mkdir-Pv x/{y, z/{1, 2 }}

Mkdir-pv {x, y }_{ 1, 2}

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.