|
@@ -30,15 +30,17 @@ import org.apache.hadoop.fs.FileStatus;
|
|
|
|
|
|
/**
|
|
|
* Print statistics about path in specified format.
|
|
|
- * Format sequences:
|
|
|
- * %b: Size of file in blocks
|
|
|
- * %g: Group name of owner
|
|
|
- * %n: Filename
|
|
|
- * %o: Block size
|
|
|
- * %r: replication
|
|
|
- * %u: User name of owner
|
|
|
- * %y: UTC date as "yyyy-MM-dd HH:mm:ss"
|
|
|
- * %Y: Milliseconds since January 1, 1970 UTC
|
|
|
+ * Format sequences:<br>
|
|
|
+ * %b: Size of file in blocks<br>
|
|
|
+ * %F: Type<br>
|
|
|
+ * %g: Group name of owner<br>
|
|
|
+ * %n: Filename<br>
|
|
|
+ * %o: Block size<br>
|
|
|
+ * %r: replication<br>
|
|
|
+ * %u: User name of owner<br>
|
|
|
+ * %y: UTC date as "yyyy-MM-dd HH:mm:ss"<br>
|
|
|
+ * %Y: Milliseconds since January 1, 1970 UTC<br>
|
|
|
+ * If the format is not specified, %y is used by default.
|
|
|
*/
|
|
|
@InterfaceAudience.Private
|
|
|
@InterfaceStability.Unstable
|
|
@@ -48,12 +50,19 @@ class Stat extends FsCommand {
|
|
|
factory.addClass(Stat.class, "-stat");
|
|
|
}
|
|
|
|
|
|
+ private static final String NEWLINE = System.getProperty("line.separator");
|
|
|
+
|
|
|
public static final String NAME = "stat";
|
|
|
public static final String USAGE = "[format] <path> ...";
|
|
|
public static final String DESCRIPTION =
|
|
|
- "Print statistics about the file/directory at <path> " +
|
|
|
- "in the specified format. Format accepts filesize in blocks (%b), group name of owner(%g), " +
|
|
|
- "filename (%n), block size (%o), replication (%r), user name of owner(%u), modification date (%y, %Y)\n";
|
|
|
+ "Print statistics about the file/directory at <path>" + NEWLINE +
|
|
|
+ "in the specified format. Format accepts filesize in" + NEWLINE +
|
|
|
+ "blocks (%b), type (%F), group name of owner (%g)," + NEWLINE +
|
|
|
+ "name (%n), block size (%o), replication (%r), user name" + NEWLINE +
|
|
|
+ "of owner (%u), modification date (%y, %Y)." + NEWLINE +
|
|
|
+ "%y shows UTC date as \"yyyy-MM-dd HH:mm:ss\" and" + NEWLINE +
|
|
|
+ "%Y shows milliseconds since January 1, 1970 UTC." + NEWLINE +
|
|
|
+ "If the format is not specified, %y is used by default." + NEWLINE;
|
|
|
|
|
|
protected final SimpleDateFormat timeFmt;
|
|
|
{
|