Command Line Interface
megfile
Client for megfile.
If you install megfile with --user
,
you also need configure $HOME/.local/bin
into $PATH
.
megfile [OPTIONS] COMMAND [ARGS]...
Options
- --debug
Enable debug mode.
cat
Concatenate any files and send them to stdout.
megfile cat [OPTIONS] PATH
Arguments
- PATH
Required argument
config
Return the config file
megfile config [OPTIONS] COMMAND [ARGS]...
alias
Update the config file for aliases
megfile config alias [OPTIONS] NAME PROTOCOL
Options
- -p, --path <path>
alias config file, default is $HOME/.config/megfile/aliases.conf
- --no-cover
Not cover the same-name config
Arguments
- NAME
Required argument
- PROTOCOL
Required argument
hdfs
Update the config file for hdfs
megfile config hdfs [OPTIONS] URL
Options
- -p, --path <path>
hdfs config file, default is $HOME/.hdfscli.cfg
- -n, --profile-name <profile_name>
hdfs config file
- -u, --user <user>
user name
- -r, --root <root>
hdfs path’s root dir
- -t, --token <token>
token for requesting hdfs server
- -o, --timeout <timeout>
request hdfs server timeout, default 10
- --no-cover
Not cover the same-name config
Arguments
- URL
Required argument
s3
Update the config file for s3
megfile config s3 [OPTIONS] AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
Options
- -p, --path <path>
s3 config file, default is $HOME/.aws/credentials
- -n, --profile-name <profile_name>
s3 config file
- -e, --endpoint-url <endpoint_url>
endpoint-url
- -st, --session-token <session_token>
session-token
- -as, --addressing-style <addressing_style>
addressing-style
- -sv, --signature-version <signature_version>
signature-version
- --no-cover
Not cover the same-name config
Arguments
- AWS_ACCESS_KEY_ID
Required argument
- AWS_SECRET_ACCESS_KEY
Required argument
cp
Copy files from source to dest, skipping already copied.
megfile cp [OPTIONS] SRC_PATH DST_PATH
Options
- -r, --recursive
Command is performed on all files or objects under the specified directory or prefix.
- -T, --no-target-directory
treat dst_path as a normal file.
- -g, --progress-bar
Show progress bar.
- --skip
Skip existed files.
Arguments
- SRC_PATH
Required argument
- DST_PATH
Required argument
head
Concatenate any files and send first n lines of them to stdout.
megfile head [OPTIONS] PATH
Options
- -n, --lines <lines>
print the first NUM lines
Arguments
- PATH
Required argument
ll
List all the objects in the path.
megfile ll [OPTIONS] PATH
Options
- -r, --recursive
Command is performed on all files or objects under the specified directory or prefix.
Arguments
- PATH
Required argument
ls
List all the objects in the path.
megfile ls [OPTIONS] PATH
Options
- -l, --long
List all the objects in the path with size, modification time and path.
- -r, --recursive
Command is performed on all files or objects under the specified directory or prefix.
- -h, --human-readable
Displays file sizes in human readable format.
Arguments
- PATH
Required argument
md5sum
Produce an md5sum file for all the objects in the path.
megfile md5sum [OPTIONS] PATH
Arguments
- PATH
Required argument
mkdir
Make the path if it doesn’t already exist.
megfile mkdir [OPTIONS] PATH
Arguments
- PATH
Required argument
mtime
Return the mtime and number of objects in remote:path.
megfile mtime [OPTIONS] PATH
Arguments
- PATH
Required argument
mv
Move files from source to dest.
megfile mv [OPTIONS] SRC_PATH DST_PATH
Options
- -r, --recursive
Command is performed on all files or objects under the specified directory or prefix.
- -T, --no-target-directory
treat dst_path as a normal file.
- -g, --progress-bar
Show progress bar.
- --skip
Skip existed files.
Arguments
- SRC_PATH
Required argument
- DST_PATH
Required argument
rm
Remove files from path.
megfile rm [OPTIONS] PATH
Options
- -r, --recursive
Command is performed on all files or objects under the specified directory or prefix.
Arguments
- PATH
Required argument
size
Return the total size and number of objects in remote:path.
megfile size [OPTIONS] PATH
Arguments
- PATH
Required argument
stat
Return the stat and number of objects in remote:path.
megfile stat [OPTIONS] PATH
Arguments
- PATH
Required argument
sync
Make source and dest identical, modifying destination only.
megfile sync [OPTIONS] SRC_PATH DST_PATH
Options
- -g, --progress-bar
Show progress bar.
- -w, --worker <worker>
Number of concurrent workers.
- -f, --force
Copy files forcible, ignore same files.
- -q, --quiet
Not show any progress log.
- --skip
Skip existed files.
Arguments
- SRC_PATH
Required argument
- DST_PATH
Required argument
tail
Concatenate any files and send last n lines of them to stdout.
megfile tail [OPTIONS] PATH
Options
- -n, --lines <lines>
print the last NUM lines
- -f, --follow
output appended data as the file grows
Arguments
- PATH
Required argument
to
Write bytes from stdin to file.
megfile to [OPTIONS] PATH
Options
- -a, --append
Append to the given file
- -o, --stdout
File content to standard output
Arguments
- PATH
Required argument
touch
Make the file if it doesn’t already exist.
megfile touch [OPTIONS] PATH
Arguments
- PATH
Required argument
version
Return the megfile version.
megfile version [OPTIONS]