Home > OS >  To get all the two letters directories using terminal
To get all the two letters directories using terminal

Time:02-01

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

CodePudding user response:

Use ?? to get all 2 character entries:

ls -ld ??

? matches any single character in shell glob

  •  Tags:  
  • Related