how to find largest file in directory recursively using find/du

1. Open the terminal application

2. Login as root user using the sudo -i command

3. Type du -a /dir/ | sort -n -r | head -n 20

4. du will estimate file space usage

5. sort will sort out the output of du command

6. head will only show top 20 largest file in /dir/


run this command "sudo du -a /dir/ | sort -n -r | head -n 20"

or "sudo du -a / 2>/dev/null | sort -n -r | head -n 20"

Posting Komentar

Lebih baru Lebih lama