Bash Common basic features (1)

Source: Internet
Author: User

Bash Common basic features (1)

Bash is a common shell, a recent interaction with the user:

    1. command-line editing:

      CTRL + A: Skip to the beginning of the command

      Ctrl+e: Jump to the end of the command line

      Ctrl+u: Delete the cursor to the beginning of the command line

      CTRL+K: Delete the cursor to the end of the command line

      CTRL+D: Delete cursor specified character

      Ctrl+l: Clear Screen

    2. History: Command Chronicle command

      Option:-C: Empty command history

      -D: Delete the command at the specified location

      -W: Save command history to the. bash_history file

      Common techniques:

      !n: Executes the nth command in the command history;

      !-n: Executes the reciprocal nth command in the command history;

      !: Executes the previous command;

      !string: The most recent command in the command history that starts with a specified string

      !$/esc+./ALT +. : references the last parameter of the previous command;

3. Command and file path completion: Press the TAB key

4. FileName Wildcard related common skills

*: Represents any character of any length

?: Represents any single character

[]: Represents any single character in the specified range

[ABCD]: one of the characters that represents ABCD

[A-m]: represents one of the characters in A to M

[A-Z]: represents all lowercase letters as [: Lower:]

[A-Z]: represents all uppercase letters, as if [: Upper:]

[0-9]: Represents a number, as [:d Igit:]

[A-za-z]: represents uppercase and lowercase letters as [: Alpha:]

[0-9a-za-z]: represents numbers and uppercase and lowercase letters, as if [: Alnum:]

[: Space:]: white space character

[:p UNCT:]: Punctuation

[: Lower:]: lowercase letter, as [A-z]

[: Upper:]: Uppercase, as [A-z]

[: Alpha:]: Uppercase and lowercase letters, as [a-za-z]

[:d igit:]: number, as [0-9]

[: Alnum:]: Numbers and uppercase and lowercase letters, as if [0-9a-za-z]

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

If English is good, man 7 Glob View document

Example Description: File name wildcard:

Background Create W888,DE3,B1 good,1314,w.llow,x 66,9ay,520,d02i these several files

1. Show all files starting with 5 or W

LS [5w]*

2. Display all files that contain letters

LS *[a-za-z]*

3. Display files that contain only special characters

LS *[^[:alnum:]]*

LS *[^0-9a-za-z]*


This article is from the "Willow_xia" blog, make sure to keep this source http://willow.blog.51cto.com/6574604/1761997

Bash Common basic features (1)

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.