This section lists the commands supported by CloudFSUtil, describes how to use them, and command line examples.
Commands
Commands | Description |
none |
Usage: - Options: -put <local source file> <target file> -get <remote source file> <target file> -get <remote source directory> <target directory> -get "<remote source directory>/<file name pattern>" <target directory> -get <remote source file> -get "<remote source directory>/<file name pattern>" -get <remote source directory> -getmerge <remote sourcedir> <target file> -getmerge "<remote source directory>/<file name pattern>" <target file> -getmerge <remote sourcedir> -getmerge "<remote source directory>/<file name pattern>" -cat <remote source file> -cat <remote source directory> -cat "<remote source directory>/<file name pattern>" -ls <remote source directory> -ls "<remote source directory>/<file name pattern>" -mkdir <target> -rm <remote target file> -rm "<remote directory>/<file name pattern>" -rmr <remote target directory> -touchz <target file> -test -d <target> -test -e <target> -test -f <target> -test -f "<remote directory>/<file name pattern>" |
-put <local source> <remote target> | Copies the content of a local file to a remote file. |
-put <remote target> | Copies the content of standard input to a remote file. |
-get <remote source> <local target> | Copies the content of a remote file to a local file. |
-get <remote source directory> <target directory> | Copies all files from a remote source directory to files with the same name in a local target directory. |
-get "<remote source directory>/<file name pattern>" <target directory> | Copies all files from a remote source directory matching a wildcard pattern to files with the same name in a local target directory. |
-get <remote source> | Writes the content of a remote file to standard output. |
-get <remote source directory> | Writes the content of all files from a remote source directory to standard output. |
-get "<remote source directory>/<file name pattern>" | Writes the content of all files from a remote source directory matching a wildcard pattern to standard output. |
-getmerge <remote sourcedir> <local target file> | Concatenates the contents of the files in the specified remote source directory and writes it to the specified local target file. |
-getmerge "<remote source directory>/<file name pattern>" <target file> | Concatenates the contents of the files matching the specified wildcard pattern in the remote source directory and writes it to the specified local target file. |
-getmerge <remote sourcedir> | Concatenates the contents of the files in the specified remote source directory and writes it to standard output. |
-getmerge "<remote source directory>/<file name pattern>" | Concatenates the contents of the files matching the specified wildcard pattern in the remote source directory and writes it to standard output. |
-cat <remote source file> | Writes the content of a remote file to standard output. |
-cat <remote source directory> | Concatenates the content of all files in the remote directory and writes it to standard output. |
-cat "<remote source directory>/<file name pattern>" | Concatenates the content of all files in the remote directory matching the wildcard pattern and writes it to standard output. |
-ls <remote source directory> | Writes a listing of all files and subdirectories in a remote directory to standard output. |
-ls "<remote source directory>/<file name pattern>" | Writes a listing of all files matching a wildcard pattern in a remote directory to standard output. |
-mkdir <target> | Creates a directory on a remote file system. |
-rm <remote target file> | Removes a file from a remote file system. |
-rm "<remote directory>/<file name pattern>" | Removes all files matching a wildcard pattern from a remote directory. |
-rmr <remote target directory> | Removes a directory from a remote file system. |
-touchz <target file> | Creates a zero-length file on a remote file system. |
-test -d <target> | CloudFSUtil return code is 0 when the target is a directory. Otherwise, the return code is 1. |
-test -e <target> | CloudFSUtil return code is 0 when the target exists. Otherwise, the return code is 1. |
-test -f <target> | CloudFSUtil return code is 0 when the target is a file. Otherwise, the return code is 1. |
-test -f "<remote directory>/<file name pattern>" | CloudFSUtil return code is 0 when any file in the remote directory matches the wildcard pattern. Otherwise, the return code is 1. |
Command line examples
This section shows examples of how to use the commands.
List the contents of a directory
cloudfsutil -ls dbfs:/mnt/azureblob/
dbfs:/mnt/azureblob/WebLogInput.log
dbfs:/mnt/azureblob/WebLogInputSeed.log
dbfs:/mnt/azureblob/empty02.log
List files in a directory matching a wildcard pattern
cloudfsutil -ls dbfs:/mnt/azureblob/*_0.log
dbfs:/mnt/azureblob/Connect_DMX10616_0001dxj_app2020090811231234567_378378131_0.log
dbfs:/mnt/azureblob/Connect_DMX10616_0001dxj_app2020090822471234567_310564298_0.log
dbfs:/mnt/azureblob/Connect_DMX10616_0001dxj_app202009082307123456_1879857931_0.log
dbfs:/mnt/azureblob/Connect_DMX10616_0001dxj_app2020090822234123456_857667687_0.log
dbfs:/mnt/azureblob/Connect_DMX10616_0001dxj_app202009092238123456_2076756901_0.log
dbfs:/mnt/azureblob/Connect_DMX10616_0001dxj_app2020091022112345678_699520815_0.log
List the content of a file to standard output
cloudfsutil -cat dbfs:/mnt/azureblob/Connect-
Untitled.dxj_app2020071715193113223456789_3617914142_0.log
Copy a file from a remote directory to a local directory
cloudfsutil -get dbfs:/mnt/azureblob/Connect-job.dxj_app52_0.log
/nis4/connect/data/dmx02.log
Copy a file from a local directory to a remote directory
cloudfsutil -put /nis4/connect/data/dmx02.log dbfs:/mnt/azureblob/directory/dmx01.log
Create an empty file in a remote directory
cloudfsutil -touchz dbfs:/mnt/azureblob/directory/empty01.log