TKN
TKN

Reputation: 145

echo directories whose name doesn't start with 1 and has an odd number as second char

Do you know how to write a command in bash which using "echo" will write all the directories in the current directory, which name does not start with a number one (1) and in the second position in the name has an odd number?

Upvotes: 0

Views: 23

Answers (1)

oguz ismail
oguz ismail

Reputation: 50795

Using a simple glob:

echo [!1][13579]*/
$ ls
1567  1678  1789  1900  2011  2122  2233  2344
$ echo [!1][13579]*/
2122/ 2344/

Upvotes: 1

Related Questions