Saturday 2 January 2016

Hadoop: stat: Print stats about a file

“stat” command is used to print statistics about the file/directory at <path> in the specified format.

Usage:
hadoop fs [generic options] -stat [format] <path> ...

Format Specifier
Description
%b
File size in blocks
%F
Type of file
%g
Group name of owner
%n
Name
%o
Blocksize
%r
Replication
%u
User name of owner
%y
shows UTC date as “yyyy-MM-dd HH:mm:ss”
%Y
shows milliseconds since January 1, 1970 UTC

$ hadoop fs -stat "%F %u:%g %b %y %n"
/user/harikrishna_gurram/dir1/append.txt

regular file harikrishna_gurram:supergroup 20 2015-06-18 07:15:11 append.txt


Previous                                                 Next                                                 Home

No comments:

Post a Comment