Skip to main content

tree

info

The tree command can be used with or without prepending bx:// to the path.

Usage

bx tree [-fhis] [--help] [<path>]

Parameters and inputs

ShorthandLong versionDescription
-f--full-pathPrint the full path of the files
-s--sizePrint the size in bytes of each file
-h--humanPrint the size in a more human readable way
-i--intLike -h, but use in SI units (powers of 1000)
--helpShow this help message and exit

Examples

Structure of a directory

Create two local files, one with the content "hello" and the other with the content "goodbye".

$ echo hello > hello.txt
$ echo goodbye > goodbye.txt

Upload the files to different paths inside the test directory using the cp command.

$ bx cp hello.txt bx://test/greeting/hello.txt
hello.txt [=================================================>] 100 %

$ bx cp goodbye.txt bx://test/farewell/goodbye.txt
goodbye.txt [=================================================>] 100 %
info

The cp command will implicitly create directories in BatchX that haven't been previously created.

Use the bx tree command to display the content of the test directory.

$ bx tree bx://test
test
├── farewell
│ └── goodbye.txt
└── greeting
└── hello.txt

Adding the -s and the -h flags will also display the file size in a human readable way.

$ bx tree -sh bx://test
test
├── farewell
│ └── [8 B] goodbye.txt
└── greeting
└── [6 B] hello.txt