Hdfs count command tweak
Just some comments on the last part of the command.
Since you don't use any of the extra features of uniq, you can drop replace
sort -nr | uniq
with
sort -nr -u

I don't see a reason to sort in reverse, and then take the first line with head -1, when you could instead use tail -1.
sort -nu | tail -1

While outputting duplicated lines to tail might take some time if there is a lot of duplication, since you only actually want the final line, you can probably drop the -u flag in sort. If you wanted the most recent 3 dates, you'd need to add it back in.