Although @kostya gave a great answer, using a little awk can help reorder the output to improve the downstream process
hdfs dfs -ls -R ${hdfspath} 2> ${hdfsname}.err \
|awk "{ printf \"%s:%s:%s:%s:%s\n\",\$5,\$6,\$3,\$1,\$8; }" \
|sort -rn > hdfs-${hdfsname}.du
source
to share