How to get all subdirectory names in a list with tcl?

For a specific directory, how can I get the names of the child directories in the list?

+4
source share
1 answer

Use glob . For example, for the current directory, the command to get all the subdirectories

glob -type d * 

Or, if you need a specific directory, use the -directory option :

 glob -directory $mydir -type d * 
+9
source

All Articles