hadoop fs
The hadoop fs
command runs a generic filesystem
user client that interacts with the MapR filesystem (MapR-FS).
PATH
contains the following directories:
-
C:\Windows\system32
-
C:\Windows
If they are not present, the hadoop fs command might fail silently.
Syntax
hadoop [ Generic Options ] fs
[-cat <src>]
[-chgrp [-R] GROUP PATH...]
[-chmod [-R] <MODE[,MODE]... | OCTALMODE> PATH...]
[-chown [-R] [OWNER][:[GROUP]] PATH...]
[-copyFromLocal <localsrc> ... <dst>]
[-copyToLocal [-ignoreCrc] [-crc] <src> <localdst>]
[-count[-q] <path>]
[-cp <src> <dst>]
[-df <path>]
[-du <path>]
[-dus <path>]
[-expunge]
[-get [-ignoreCrc] [-crc] <src> <localdst>
[-getmerge <src> <localdst> [addnl]]
[-help [cmd]]
[-ls <path>]
[-lsr <path>]
[-mkdir <path>]
[-moveFromLocal <localsrc> ... <dst>]
[-moveToLocal <src> <localdst>]
[-mv <src> <dst>]
[-put <localsrc> ... <dst>]
[-rm [-skipTrash] <src>]
[-rmr [-skipTrash] <src>]
[-stat [format] <path>]
[-tail [-f] <path>]
[-test -[ezd] <path>]
[-text <path>]
[-touchz <path>]
Parameters
Command Options
The following command parameters are supported for hadoop
fs
:
Parameter |
Description |
---|---|
|
Fetch all files that match the file pattern defined by the
|
|
Specify the file system to use.
If not specified, the current configuration is used,
taken from the following, in increasing precedence:
|
|
List the contents that match the specified file pattern.
If
path is not specified, the contents of
|
|
Recursively list the contents that match the specified
file pattern. Behaves very similarly to |
|
Shows the capacity, free and used space of the filesystem. If the filesystem has multiple partitions, and no path to a particular partition is specified, then the status of the root partitions will be shown. |
|
Show the amount of space, in bytes, used by the files
that
match the specified file pattern. Equivalent to the Unix
command |
|
Show the amount of space, in bytes, used by the files
that
match the specified file pattern. Equivalent to the Unix
command |
|
Move files that match the specified file pattern
|
|
Copy files that match the file pattern |
|
Delete all files that match the specified file
pattern.
Equivalent to the Unix command |
|
Remove all directories which match the specified file
pattern. Equivalent to the Unix command |
|
Copy files from the local file system into fs. To copy files, user must
have write permission on the directory or the |
|
Identical to the |
|
Same as |
|
Copy files that match the file pattern <src> to the local name. <src> is kept. When copying multiple files, the destination must be a directory. |
|
Get all the files in the directories that
match the source file pattern and merge and sort them to
only
one file on local fs. |
|
Identical to the |
|
Not implemented yet |
|
Create a directory in specified location. |
|
Show the last 1KB of the file.
The |
|
Write a timestamp in |
|
If file { exists, has zero length, is a directory then return 0, else return 1. |
|
Takes a source file and outputs the file in text format. The allowed formats are zip and TextRecordInputStream. |
|
Print statistics about the file/directory at
|
|
Changes permissions of a file.
This works similar to shell's |
|
Changes owner and group of a file. This is similar to
shell's WARNING:
void using '.' to separate user name and group
though
Linux allows it. If user names have dots in them and you
are
using local file system, you might see surprising results
since
shell command
chown is used for local files.
|
|
This is equivalent to |
|
Count the number of directories, files and bytes under the
paths
that match the specified file pattern. The output columns
are:
|
|
Displays help for given command or all commands if none is specified. |
Generic Options
The following generic options are supported for the hadoop
fs
command: -conf <configuration file>
,
-D <property=value>
, -fs <local|file
system URI>
, -jt
<local|jobtracker:port>
, -files
<file1,file2,file3,...>
, -libjars
<libjar1,libjar2,libjar3,...>
, and -archives
<archive1,archive2,archive3,...>
. For more information
on generic options, see Generic
Options.