Skrevet av Emne: Linux: How to find files belonging to a user and show their size  (Lest 2179 ganger)

ATC

  • Gjest
Linux: How to find files belonging to a user and show their size
« på: 27. ſeptember 2008, 18:24 pm »
  • [applaud]0
  • [smite]0
  • A user has exceeded his/her quota, but finding the oversized file(s) can be tricky.



    ATC

    • Gjest
    [Solved] Linux: How to find files belonging to a user and show their size
    « Svar #1 på: 27. ſeptember 2008, 18:24 pm »
  • [applaud]0
  • [smite]0
  • Employ the magic of "backticks" for this one.

    First of all, the command for finding all files that belong to a certain user is:
    "find ./ -user mette -print"

    For each of these files, we want to show the size, the command for that is:
    "du -h"

    To run that command for each file, use backticks like this:
    "du -h `find ./ -user mette -print`"

    Note the special backticks, normal single quotes (') or apostrophes (´) will NOT work.