A wrapper for the UNIX tree
command with added markers for DataLad datasets.
Helps visualize hierarchies of nested subdatasets and describe dataset layouts.
💡 Note: there is now a native datalad tree
command, available in the datalad-next extension (>=v0.6.0). See documentation.
tree-datalad
works just like tree
. You can pass it any tree
options.
View a hierarchy of nested subdatasets in the context of the whole directory layout:
❯ tree-datalad -d -L 3 bids
bids <--[DS]
├── code
│ └── common
├── data
│ ├── inputs
│ │ └── dicom <--[DS]
│ └── outputs
│ ├── sub-01
│ └── sub-02
└── environments <--[DS]
├── images
Find datasets at all depths starting from the current directory:
❯ tree-datalad -d -f | grep '\[DS\]'
├── ./bids <--[DS]
│ │ │ └── ./bids/data/inputs/dicom <--[DS]
│ ├── ./bids/environments <--[DS]
└── ./dicom <--[DS]
- bash (Linux or macOS)
- tree >= v1.6.0-1
- datalad
Copy the shell script tree-datalad to a directory in your $PATH
, such as $HOME/bin
or /usr/local/bin
.