list all files in sub directory 1 level below?

Bonk

I am trying to list all of the *.tcl files that's exactly 1 level below. Such as

./dirA/x.tcl
./dirB/y.tcl
./dirC/z.tcl

I am using foreach command to list all files & directories under the sub directory, but the output is empty..

foreach dir [glob -type d *] {        
    glob -path ./$dir *    
}
glenn jackman

You only need one call to glob:

set tcl_files [glob */*.tcl]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Fetch the list of all txt files in directory and sub directory and add it to a List

From Dev

Python 2.7 How to list files in a directory AND all sub directories?

From Dev

list all c files in sub directories and their parent directory

From Dev

List files having more than 100 lines in a directory and in all it's sub directory

From Java

How to download HTTP directory with all files and sub-directories as they appear on the online files/folders list?

From Dev

.gitignore How to ignore first level files in a directory but not sub-files?

From Dev

Checking out all files in sub directory

From Dev

Writing to all txt files in directory and in the sub dirs

From Dev

Print a list of "full" relative paths of all the files present in a directory and in its sub-directories

From Dev

List all regular files containing (in their name, directory or their content) a specific (sub)string

From Dev

Move all sub-directory content up one level

From Dev

Loop through all files in a directory and its sub directory using Unix

From Dev

list.files() all files in directory and subdirectories

From Dev

Script or command to list all top-level directories that contain sub-directories with modified files less than 30 days old

From Dev

Tree command list one level all files

From Dev

How to get list of all files from a directory (including its sub-directories) whose file name contains a specific string

From Dev

How to delete all files in a directory, keeping sub-directories intact

From Dev

Delete all files and sub directories but keep main directory

From Dev

Rewrite any sub-domain and all files to a single directory

From Dev

c++ sub get all exe files in current directory

From Dev

Change group access to directory and all sub directories and files

From Dev

Change group access to directory and all sub directories and files

From Dev

c++ sub get all exe files in current directory

From Dev

zip files within all sub-directories of a given parent directory

From Dev

Listing all files in a directory and sub-directories C#

From Dev

PHP Delete all files that are empty in a Directory and any sub directories

From Dev

PHP : list files in directory and sub-directories into an XML file

From Dev

How to list all files from the resources directory

From Java

List all files in one directory PHP

Related Related

  1. 1

    Fetch the list of all txt files in directory and sub directory and add it to a List

  2. 2

    Python 2.7 How to list files in a directory AND all sub directories?

  3. 3

    list all c files in sub directories and their parent directory

  4. 4

    List files having more than 100 lines in a directory and in all it's sub directory

  5. 5

    How to download HTTP directory with all files and sub-directories as they appear on the online files/folders list?

  6. 6

    .gitignore How to ignore first level files in a directory but not sub-files?

  7. 7

    Checking out all files in sub directory

  8. 8

    Writing to all txt files in directory and in the sub dirs

  9. 9

    Print a list of "full" relative paths of all the files present in a directory and in its sub-directories

  10. 10

    List all regular files containing (in their name, directory or their content) a specific (sub)string

  11. 11

    Move all sub-directory content up one level

  12. 12

    Loop through all files in a directory and its sub directory using Unix

  13. 13

    list.files() all files in directory and subdirectories

  14. 14

    Script or command to list all top-level directories that contain sub-directories with modified files less than 30 days old

  15. 15

    Tree command list one level all files

  16. 16

    How to get list of all files from a directory (including its sub-directories) whose file name contains a specific string

  17. 17

    How to delete all files in a directory, keeping sub-directories intact

  18. 18

    Delete all files and sub directories but keep main directory

  19. 19

    Rewrite any sub-domain and all files to a single directory

  20. 20

    c++ sub get all exe files in current directory

  21. 21

    Change group access to directory and all sub directories and files

  22. 22

    Change group access to directory and all sub directories and files

  23. 23

    c++ sub get all exe files in current directory

  24. 24

    zip files within all sub-directories of a given parent directory

  25. 25

    Listing all files in a directory and sub-directories C#

  26. 26

    PHP Delete all files that are empty in a Directory and any sub directories

  27. 27

    PHP : list files in directory and sub-directories into an XML file

  28. 28

    How to list all files from the resources directory

  29. 29

    List all files in one directory PHP

HotTag

Archive