Linux LS Regular expression

Source: Internet
Author: User

LS is the default sort.

So:

LS only supports wildcard characters and does not support regular, so simply using LS is not possible.

Some regular filtering operations require a combination of regular-support commands such as grep, sed, or awk.

Example: LS | grep "[0-9]$"

Gets: Aaa1 Aaa2 Aaa3

Share

This answer by computer network classification talent Wang ZHENGMAO certification other similar issues
    • 2010-04-29linux under ls command
    • 2012-09-23linux "ls", "ls-a", "Ls-al" of the District ... -
    • 2010-03-26linux ls-l
    • 2009-04-23linux Regular Expressions
    • 2014-09-17linux Regular Expressions
More aboutproblems with the Linux shell LS regular expression >>Recommended for you:2014-10-21 22:40 netizens adopted
Bash has only extended, not regular operations.
Excerpt a little, you see

A peculiar use

Replace the file name on the spot






MV Xxx{yyy,www}zzz.tt

Extended
In fact, an array-like extension.
Echo/etc/init/avahi-{daemon,lol,what}.conf
/etc/init/avahi-daemon.conf/etc/init/avahi-lol.conf/etc/init/avahi-what.conf

For i in a{2,{1..3},5}; do echo $i; Done
A2
A1
A2
A3
A5

Linux LS Regular expression

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.