Add tree listing (#2804)

This commit is contained in:
Praveen raj Mani
2019-07-17 22:23:02 -07:00
committed by Harshavardhana
parent 6200a34522
commit bdcb9dcb2f
4 changed files with 337 additions and 10 deletions
+40 -10
View File
@@ -4,6 +4,7 @@ MinIO Client (mc) provides a modern alternative to UNIX commands like ls, cat, c
```
ls list buckets and objects
tree list buckets and objects in a tree format
mb make a bucket
rb remove a bucket
cat display object contents
@@ -183,6 +184,7 @@ alias cat='mc cat'
alias mkdir='mc mb'
alias pipe='mc pipe'
alias find='mc find'
alias tree='mc tree'
```
## 6. Global Options
@@ -251,7 +253,7 @@ Skip SSL certificate verification.
| | | |
|:---|:---|:---|
|[**ls** - List buckets and objects](#ls) |[**mb** - Make a bucket](#mb) | [**cat** - Concatenate an object](#cat) |
|[**ls** - List buckets and objects](#ls) |[**tree** - List buckets and objects in a tree format](#tree) |[**mb** - Make a bucket](#mb) | [**cat** - Concatenate an object](#cat) |
|[**cp** - Copy objects](#cp) |[**rb** - Remove a bucket](#rb) | [**pipe** - Pipe to an object](#pipe) |
| [**share** - Share access](#share) | [**rm** - Remove objects](#rm) | [**find** - Find files and objects](#find) |
| [**diff** - Diff buckets](#diff) |[**mirror** - Mirror buckets](#mirror)|[**session** - Manage saved sessions](#session) |
@@ -285,6 +287,34 @@ mc ls play
[2016-04-08 20:58:18 IST] 0B mybucket/
```
<a name="tree"></a>
### Command `tree` - List buckets and directories in a tree format
`tree` command lists buckets and directories in a tree format. Use `--files` flag to include files/objects in listing.
```sh
USAGE:
mc tree [FLAGS] TARGET [TARGET ...]
FLAGS:
--help, -h show help
--files, -f include files in tree
--depth, -d set the maximum depth of the tree
```
_Example: List all buckets on play/test-bucket in a tree format._
```sh
mc tree play/test-bucket
play/test-bucket/
├─ dir_a
├─ dir_b
│ └─ dir_bb
└─ dir_x
└─ dir_xx
```
<a name="mb"></a>
### Command `mb` - Make a Bucket
`mb` command creates a new bucket on an object storage. On a filesystem, it behaves like `mkdir -p` command. Bucket is equivalent of a drive or mount point in filesystems and should not be treated as folders. MinIO does not place any limits on the number of buckets created per user.
@@ -396,9 +426,9 @@ ENVIRONMENT VARIABLES:
MC_ENCRYPT_KEY: list of comma delimited prefix=secret values
INPUT SERIALIZATION
--csv-input or --json-input can be used to specify input data format. Format is
--csv-input or --json-input can be used to specify input data format. Format is
specified by a string with pattern "key=value,..." for valid key(s).
DATA FORMAT:
csv: Use --csv-input flag
Valid keys:
@@ -409,12 +439,12 @@ INPUT SERIALIZATION
FileHeader (fh)
Comments (cc)
QuotedRecordDelimiter (qrd)
json: Use --json-input flag
Valid keys:
Type
Type
parquet: If object name ends in .parquet, this is automatically interpreted.
OUTPUT SERIALIZATION
--csv-output or --json-output can be used to specify output data format. Format is
specified by a string with pattern "key=value,..." for valid key(s).
@@ -426,11 +456,11 @@ OUTPUT SERIALIZATION
QuoteChar (qc)
QuoteEscChar (qec)
QuoteFields (qf)
json: Use --json-output flag
Valid keys:
RecordDelimiter (rd)
RecordDelimiter (rd)
COMPRESSION TYPE
--compression specifies if the queried object is compressed.
Valid values: NONE | GZIP | BZIP2
@@ -810,7 +840,7 @@ FLAGS:
--debug Enable debug output.
--insecure Disable SSL certificate verification.
--help, -h Show help.
LEGEND:
< - object is only in source.
> - object is only in destination.