Home > Software > BIGDATA > HADOOP
Interview Questions   Tutorials   Discussions   Programs   Videos   Discussion   

HADOOP - HDFS File System Shell Commands




653
views
asked marvit January 2, 2015 07:56 PM  

Overview cat,chgrp,chmod,chown,copyFromLocal,copyToLocal,count,cp,du,dus,expunge,get,getmerge,ls,lsr,mkdir,moveFromLocal,moveToLocal,mv,put,rm,rmr,setrep,stat,tail,test,text,touchz


           

2 Answers



 
answered By marvit   0  

Overview

Please find below apache link for documentation

appendToFile

cat

chgrp

chmod

chown

co pyFromLocal

copyToLocal

count

cp

du

dus

expunge

get< /p>

getfacl

getfattr

getmerge

ls

lsr

mkdir

moveFromLocal

moveToLocal

mv

put

rm

rmr

setfacl

setfattr

r

setrep

stat

tail

test

text

touchz

flag   
   add comment

 
answered By marvit   0  

Overview

The FileSystem (FS) shell is invoked by bin/hadoop fs . All FS shell commands take path URIs as arguments. The URI format is scheme://autority/path.

cat

hadoop fs -cat URI [URI …]

Copies source paths to stdout. Example:

hadoop fs -cat file:///file3 /user/hadoop/file4

Exit Code: Returns 0 on success and -1 on error.

chgrp

hadoop fs -chgrp [-R] GROUP URI [URI …]

Change group association of files. With -R, make the change recursively through the directory structure. The user must be the owner of files, or else a super-user. Additional information is in the HDFS Admin Guide: Permissions.

chmod

hadoop fs -chmod [-R] <MODE[,MODE]... | OCTALMODE> URI [URI …]

Change the permissions of files. With -R, make the change recursively through the directory structure. The user must be the owner of the file, or else a super-user.

chown

hadoop fs -chown [-R] [OWNER][:[GROUP]] URI [URI ]

Change the owner of files. With -R, make the change recursively through the directory structure. The user must be a super-user. Additional information is in the HDFS Admin Guide: Permissions.

copyFromLocal

hadoop fs -copyFromLocal <localsrc> URI

Similar to put command, except that the source is restricted to a local file reference.

copyToLocal

hadoop fs -copyToLocal [-ignorecrc] [-crc] URI <localdst>

Similar to get command, except that the destination is restricted to a local file reference.

count

hadoop fs -count [-q] <paths>

Count the number of directories, files and bytes under the paths that match the specified file pattern. The output columns are: DIRCOUNT, FILECOUNT, CONTENTSIZE FILENAME. The output columns with -q are: QUOTA, REMAININGQUATA, SPACEQUOTA, REMAININGSPACEQUOTA, DIRCOUNT, FILECOUNT, CONTENTSIZE, FILENAME.

hadoop fs -count hdfs://nn1.example.com/file1 hdfs://nn2.example.com/file2
hadoop fs -count -q hdfs://nn1.example.com/file1

Exit Code: Returns 0 on success and -1 on error.

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert