0% found this document useful (0 votes)
13 views4 pages

Java Interfaces

The document provides a guide on using various Hadoop File System (FS) shell commands, including 'cat', 'checksum', 'appendToFile', 'chmod', 'chown', 'copyFromLocal', and 'copyToLocal'. Each command is accompanied by usage syntax, examples, and exit codes indicating success or error. The document emphasizes the similarity of these commands to corresponding Unix commands and outlines specific options for each command.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views4 pages

Java Interfaces

The document provides a guide on using various Hadoop File System (FS) shell commands, including 'cat', 'checksum', 'appendToFile', 'chmod', 'chown', 'copyFromLocal', and 'copyToLocal'. Each command is accompanied by usage syntax, examples, and exit codes indicating success or error. The document emphasizes the similarity of these commands to corresponding Unix commands and outlines specific options for each command.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Pawan Kumar Singh, AP, Deptt of Cse 1

Pawan Kumar Singh, AP, Deptt of Cse 2


cat
The Command-Line Interface Usage: hadoop fs -cat URI [URI ...]
Copies source paths to stdout.
Example:
All FS shell commands take path URIs as •hadoop fs -cat hdfs://nn1.example.com/file1
arguments. The URI format hdfs://nn2.example.com/file2
is scheme://authority/path. For HDFS the scheme •hadoop fs -cat file:///file3 /user/hadoop/file4
is hdfs, and for the Local FS the scheme is file. Exit Code:
Returns 0 on success and -1 on error.
The scheme and authority are optional. If not
specified, the default scheme specified in the
configuration is used. An HDFS file or directory checksum
such as /parent/child can be specified Usage: hadoop fs -checksum URI
as hdfs://namenodehost/parent/child or simply Returns the checksum information of a file.
as /parent/child (given that your configuration is Example:
•hadoop fs -checksum
set to point to hdfs://namenodehost).
hdfs://nn1.example.com/file1
Most of the commands in FS shell behave like
•hadoop fs -checksum file:///etc/hosts
corresponding Unix commands

appendToFile chgrp
Usage: hadoop fs -appendToFile <localsrc> ... <dst> Usage: hadoop fs -chgrp [-R] GROUP URI [URI ...]
Append single src, or multiple srcs from local file system to the Change group association of files. The user must be
destination file system. Also reads input from stdin and appends to
the owner of files, or else a super-user.
destination file system.
Options
•hadoop fs -appendToFile localfile /user/hadoop/hadoopfile
•The -R option will make the change recursively
•hadoop fs -appendToFile localfile1 localfile2 /user/hadoop/hadoopfile
through the directory structure.
•hadoop fs -appendToFile localfile
hdfs://nn.example.com/hadoop/hadoopfile
•hadoop fs -appendToFile -
hdfs://nn.example.com/hadoop/hadoopfile Reads the input from stdin.
Exit Code: Pawan Kumar Singh, AP, Deptt of Cse 3
Returns 0 on success and 1 on error.
chmod copyFromLocal
Usage: hadoop fs -chmod [-R] <MODE[,MODE]... | Usage: hadoop fs -copyFromLocal
OCTALMODE> URI [URI ...] <localsrc> URI
Change the permissions of files. With -R, make the Similar to put command, except that
change recursively through the directory structure.
the source is restricted to a local file
The user must be the owner of the file, or else a
super-user.
reference.
Options Options:
•The -R option will make the change recursively •The -f option will overwrite the
through the directory structure. destination if it already exists.

chown copyToLocal
Usage: hadoop fs -chown [-R] [OWNER][:[GROUP]] URI Usage: hadoop fs -copyToLocal [-
[URI ] ignorecrc] [-crc] URI <localdst>
Change the owner of files. The user must be a super- Similar to get command, except that
user. the destination is restricted to a local
Options file reference.
•The -R option will make the change recursively
through the directory structure.

Pawan Kumar Singh, AP, Deptt of Cse 4

You might also like