Days
Hours
Minutes
Seconds

Super Black Friday Sale!

0
No products in the cart.
  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9661
    blankabctest483
    Member

    I am working on a Linux production server and the client wants to be able to find the largest files on the system to make sure they are not taking up too much space.

    I found this command: sudo du -a / 2>/dev/null | sort -n -r | head -n 20, but it gives the largest directories, not files.

    Does anyone know what command can find the largest files?

    Thanks

    #9662
    blankabctest483
    Member

    The following solution using find should meet your requirements:

    # find / -type f -print0 | du -h --files0-from=- 2>/dev/null | sort -h -r | head -n 20
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.