Usage: hadoop fs -ls [-d] [-h] [-R] [-t] [-S] [-r] [-u] <args>
Options:
-d: Directories are listed as plain files.
-h: Format file sizes in a human-readable fashion (eg 64.0m instead of 67108864).
-R: Recursively list subdirectories encountered.
-t: Sort output by modification time (most recent first).
-S: Sort output by file size.
-r: Reverse the sort order.
-u: Use access time rather than modification time for display and sorting.
1条答案
按热度按时间wtzytmuj1#
不,没有其他选项可以根据日期时间对文件进行排序。
如果您使用的是hadoop版本<2.7,则必须使用sort-k6,7:
对于hadoop 2.7.x ls命令,有以下可用选项:
因此,您可以轻松地对文件进行排序: