## zowe › zos-files › download › uss-directory

Download content from a USS directory to a local directory on your PC.

#### Usage

zowe zos-files download uss-directory <ussDirName> [options]

#### Positional Arguments

- `ussDirName` (string)

  - The name of the USS directory you want to download

#### Options

- `--attributes` | `--attrs` (local file path)

  - Path of an attributes file to control how files are downloaded.

- `--binary` | `-b` (boolean)

  - Download the file content in binary mode, which means that no data conversion is performed. The data transfer process returns each line as-is, without translation. No delimiters are added between records.

- `--depth` (number)

  - Filters content in USS based on the number of directories to traverse down.

- `--directory` | `-d` (string)

  - The directory to where you want to save the files. The command creates the directory for you when it does not already exist. By default, the command downloads the files to the current directory.

- `--encoding` | `--ec` (string)

  - Download the file content with encoding mode, which means that data conversion is performed using the file encoding specified.

- `--fail-fast` | `--ff` (boolean)

  - Set this option to false to continue downloading USS files if one or more fail.

    Default value: true

- `--filesys` (boolean)

  - Filters content in USS based on the filesystem the data is on. true - all filesystems, false - same filesystem as search directory.

- `--group` (string)

  - Filters content in USS based on the owning group name or ID.

- `--include-hidden` | `--ih` (boolean)

  - Include hidden files and folders that have names beginning with a dot.

- `--max-concurrent-requests` | `--mcr` (number)

  - Specifies the maximum number of concurrent z/OSMF REST API requests to download files. Increasing the value results in faster downloads. However, increasing the value increases resource consumption on z/OS and can be prone to errors caused by making too many concurrent requests. If the download process encounters an error, the following message displays:
    The maximum number of TSO address spaces have been created. When you specify 0, Zowe CLI attempts to download all files at once without a maximum number of concurrent requests.

    Default value: 1

- `--max-length` | `--max` (number)

  - The option --max-length specifies the maximum number of items to return. Skip this parameter to return all items. If you specify an incorrect value, the parameter returns up to 1000 items.

- `--mtime` (string)

  - Filters content in USS based on the last modification time. N - specify an exact number of days, +N - older than N days, -N - newer than N days

- `--name` (string)

  - Filters files in USS based on the name of the file or directory.

- `--overwrite` | `--ow` (boolean)

  - Overwrite files that already exist in your local environment.

- `--owner` (string)

  - Filters content in USS based on the owning user name or ID.

- `--perm` (string)

  - Filters content in USS based on the octal permissions string.

- `--size` (string)

  - Filters content in USS based on the size. Default units are bytes. Add a suffix of K for kilobytes, M for megabytes, or G for gigabytes. N - specify an exact file size, +N - larger than N size, -N - smaller than N size

- `--symlinks` (boolean)

  - Filters content in USS based on whether or not to follow symbolic links. true - report symlinks, false - follow symlinks

- `--type` (string)

  - Filters content in USS based on the type of content. f - regular file, d - directory, l - symbolic link, p - FIFO named pipe, s - socket

    Allowed values: f, d, l, p, s

- `--response-timeout` | `--rto` (number)

  - The maximum amount of time in seconds the z/OSMF Files TSO servlet should run before returning a response. Any request exceeding this amount of time will be terminated and return an error. Allowed values: 5 - 600

#### Zosmf Connection Options

- `--host` | `-H` (string)

  - The z/OSMF server host name.

- `--port` | `-P` (number)

  - The z/OSMF server port.

    Default value: 443

- `--user` | `-u` (string)

  - Mainframe (z/OSMF) user name, which can be the same as your TSO login.

- `--password` | `--pass` | `--pw` (string)

  - Mainframe (z/OSMF) password, which can be the same as your TSO password.

- `--reject-unauthorized` | `--ru` (boolean)

  - Reject self-signed certificates.

    Default value: true

- `--base-path` | `--bp` (string)

  - The base path for your API mediation layer instance. Specify this option to prepend the base path to all z/OSMF resources when making REST requests. Do not specify this option if you are not using an API mediation layer.

- `--protocol` (string)

  - The protocol used (HTTP or HTTPS)

    Default value: https
    Allowed values: http, https

- `--cert-file` (local file path)

  - The file path to a certificate file to use for authentication

- `--cert-key-file` (local file path)

  - The file path to a certificate key file to use for authentication

- `--completion-timeout` | `--cto` (number)

  - The amount in time, in seconds, a REST operation should wait to complete before timing out

- `--establish-connection-timeout` | `--ecto` (number)

  - The amount of time, in seconds, a REST operation should wait while connecting to the server before timing out

#### Profile Options

- `--zosmf-profile` | `--zosmf-p` (string)

  - The name of a (zosmf) profile to load for this command execution.

- `--base-profile` | `--base-p` (string)

  - The name of a (base) profile to load for this command execution.

#### Base Connection Options

- `--token-type` | `--tt` (string)

  - The type of token to get and use for the API. Omit this option to use the default token type, which is provided by 'zowe auth login'.

- `--token-value` | `--tv` (string)

  - The value of the token to pass to the API.

#### Examples

- Download the directory "/a/ibmuser" to "./" in binary mode:

  - `zowe zos-files download uss-directory /a/ibmuser --binary`

- Download the directory "/a/ibmuser" to "./localDir":

  - `zowe zos-files download uss-directory /a/ibmuser --directory localDir`

- Download files from the directory "/a/ibmuser" that match the name "*.log" and were modified within the last day:

  - `zowe zos-files download uss-directory /a/ibmuser --name "*.log" --mtime -1`