Suppose I have directories like this:
A9
d0
23
12
k3
Folder1
Folder2
I want to find all the directories with just two letter, can anyone give the regular expression for listing all the directories.
Note: I have folders of only the letters A-Z, a-z, and numbers 0-9 combined in 2 letters.
$ ls <some command>
A9
d0
23
12
k3
Use ??
to get all 2 character entries:
ls -ld ??
?
matches any single character in shell glob
To list only directories use:
ls -ld ??/
Trailing /
lists directories only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With