Linux Basic Learning -10.2-wildcard review

Source: Internet
Author: User

1. * Everything

End With. txt *.txt

End With. Log *.log

A file in the system that begins with LS.

Find/-type f-name "ls*"

Locate the file in the system that contains Oldboy.

Find/-type f-name "*oldboy*"

2. {} Generate Sequence

echo {1..10}

echo {10..1}

echo {01..10}

echo {01..100}

echo {A.. C

echo {A.. Z

echo {A.. Z

[[email protected] ~]# echo stu{01..10}

Stu01 stu02 stu03 stu04 stu05 stu06 stu07 stu08 stu09 stu10

[[email protected] ~]# echo 20{01..10}

2001 2002 2003 2004 2005 2006 2007 2008 2009 2010

#通过 {}

[Email protected] ~]# echo {A.. Z

A b c d e F g h i j k l m n o p q R S t u v w x y Z

[[email protected] ~]# echo {a c F}

{A C F}

[[email protected] ~]# echo {a,c,f}

A C F

[[email protected] ~]# echo A{b,c}

AB AC

[[email protected] ~]# echo A{,c}

A AC

[[email protected] ~]# echo Oldboy.txt{,.bak}

Oldboy.txt Oldboy.txt.bak

[email protected] ~]# Touch oldboy.txt

[[email protected] ~]# CP Oldboy.txt{,.bak}

Cp:overwrite ' Oldboy.txt.bak '? Y

[Email protected] ~]# ls-l oldboy.txt*

[Email protected] ~]# ls-l oldboy.txt*

-rw-r--r--3 root root 0 Nov 23:50 oldboy.txt

-rw-r--r--. 1 root root 0 Nov 23:50 Oldboy.txt.bak

-rw-r--r--3 root root 0 Nov 23:50 Oldboy.txt-hard

[Email protected] ~]#

[[email protected] ~]# #cp Oldboy.txt{,.bak}

[[email protected] ~]# echo Oldboy.txt{,.bak}

Oldboy.txt Oldboy.txt.bak

[[email protected] ~]# echo A{,c}

A AC

3. Summary

1) Find Files

2) * {}

3)? Any one

Exercises:

Tell me, what are the wildcard characters?

Linux Basic Learning -10.2-wildcard review

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.