Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

To get all the two letters directories using terminal

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

$ ls <some command>

A9
d0
23
12
k3

>Solution :

Use ?? to get all 2 character entries:

ls -ld ??

? matches any single character in shell glob

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading