Friday, January 15, 2016

What is the command for finding the highest memory occupied file in Linux ?

# du –ah / | sort –n –r | head –n 1

Option Explanations :du  – estimate file space usage
a – write counts for all files, not just directories
h – print sizes in human readable format (eg. 1K 234M 2G)
sort – sort lines of text files
n – compare according to string numerical value
r – reverse the result of comparisons
head – output the first part of files

n – number of lines

No comments:

Post a Comment