Fun with “hdfs dfs -stat”

hdfs dfs -stat “File %n, is a %F,own by %u and group %g,which has block size %o, with replication %r and modified on %y” /tmp/testfile

File testfile, is a regular file,own by raju  and group admin,which has block size 134217728, with replication 3 and modified on 2018-01-04 21:36:14

Here is what -help on stat says:

hdfs dfs -help stat
-stat [format] <path> … :
Print statistics about the file/directory at <path>
in the specified format. Format accepts filesize in
blocks (%b), type (%F), group name of owner (%g),
name (%n), block size (%o), replication (%r), user name
of owner (%u), modification date (%y, %Y).
%y shows UTC date as “yyyy-MM-dd HH:mm:ss” and
%Y shows milliseconds since January 1, 1970 UTC.
If the format is not specified, %y is used by default.


Author: rajukv

Hadoop(BigData) Architect and Hadoop Security Architect can design and build hadoop system to meet various data science projects.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s