Ano-Tech Computers
Enter keyword:

Linux: How to find files belonging to a user and show their size
Problem:
A user has exceeded his/her quota, but finding the oversized file(s) can be tricky.
 
Solution:
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.
 
Discuss this solution
Did this article solve your problem? Yes No Did not apply

We welcome anyone who is willing to contribute to this public knowledge base, contact siteadmin@atc.no if you have information you would like to share. The idea is not to replace the commercial support sites, but to publish those hard-to-find solutions you've found yourself looking for over and over again.

Show all articles