How to get directory size and modification date time using the same command in hdfs shell

Viewed 248

I need to get the modification datetime and the directory size using the same command using hdfs cli. Currently I am running 2 separate commands and manually merging the rows. Is there a way to do this directly?

The commands I am using are:

  1. hdfs dfs -du -h ~/tmp to get the size
  2. hdfs dfs -ls ~/tmp to get the modification date
1 Answers

Two commands are required, just like in Linux

You're more than welcome to create your own shell script that runs both commands after one another that accepts the folder as input

Related