Command to find largest file in hadoop directory Command to find largest file in hadoop directory hadoop hadoop

Command to find largest file in hadoop directory


In Linux you can run the following command to find the largest file in Desktop directory, remove the -r argument of sort if you want to find the file with smallest size!

du ~/Desktop/* | sort -n -r | head -n 1

For HDFS you can try the following command

hadoop fs -du <Path-in-HDFS> | sort -n -r | head -n 1