Linux with Notes

Source: Internet
Author: User

Wildcard and file name variables: *? []

* Enquiry

$ ls

Doc1 DOC2 Document MyDoc Monday

$ ls doc*

Doc1 DOC2 Document

$ ls *day

Monday

RM Delete

$ ls

Doc1 DOC2 Document MyDoc Monday

$ RM doc*

MyDoc Monday

? Only a single character that is missing from the file name can be matched

$ ls

Doc1 doc2 DocA DOCB Document

$ ls doc?

Doc1 doc2 DocA DOCB

[] histograms End--range has-

$ ls

Doc1 doc2 doc3 DocA DOCB Document

$ ls DOC[1A]

Doc1 DocA

$ ls Doc[1-3]

Doc1 doc2 DOC3

*+[] Combined with

$ ls

MAIN.C MIAN.O MAIN.G main.z

$ ls*. [CZ]

MAIN.C main.z

\ When a wildcard character of a query is actually part of a file name

$ ls

Answers? Answersy? Answersk?

$ ls answers\?---query? End of File

Answers?

Standard input and output and redirection > and >>

REDIRECT >

$ ls

MyData Intro Preface

$ ls > LISTF

$ cat LISTF

MyData Intro Preface LISTF

Filter

$ ls

Doc

Linux with Notes

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.