Why does the wildcard and GLOB pattern [A-Z] does not work as expected with 'ls' command ?
Issue
- If you have files created, say for example
a,b,cand you want to list the files using the GLOB pattern as below :
[root@XXX ~]# touch a b c
[root@XXX ~]# ls -l [A-Z]
-rw-r--r-- 1 root root 0 Jul 21 19:31 b
-rw-r--r-- 1 root root 0 Jul 21 19:31 c
[root@XXX ~]# ls -l [A]
ls: cannot access [A]: No such file or directory
- Now the issue is that inspite of giving a GLOB pattern
[A-Z], we would expect only the files with nameAtoZto be listed and notatoz.
Environment
- Red Hat Enterprise Linux All
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
