-
Notifications
You must be signed in to change notification settings - Fork 11
/
fileowners.csh
38 lines (31 loc) · 1.2 KB
/
fileowners.csh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/csh
###
### Find all files owned by all general users.
### Save the list of files owned by users in /tmp
### Example: /tmp/nobody.list
###
### Submitted By: Marc Jacquard
### Marc.Jacquard@firstdatacorp.com
###
### Adjust as needed
###
cd /
#cd /users
cat /etc/passwd|cut -f1 -d":"|grep -v root|grep -v daemon|grep -v bin|grep -v sys|grep -v adm|grep -v listen|grep -v nobody4|grep -v noaccess|grep -v nobody>/tmp/short.list
foreach i (`cat /tmp/short.list`)
set summ=0
# find . -type f -user $i -exec du -s \{\} \;
find . -type f -user $i -exec du -s \{\} \; >& /tmp/$i.list
#find . -type f -user $i -exec du -s \{\} \; >& /tmp/space/$i.list
end
##############################################################################
### This script is submitted to BigAdmin by a user of the BigAdmin community.
### Sun Microsystems, Inc. is not responsible for the
### contents or the code enclosed.
###
###
### Copyright 2006 Sun Microsystems, Inc. ALL RIGHTS RESERVED
### Use of this software is authorized pursuant to the
### terms of the license found at
### http://www.sun.com/bigadmin/common/berkeley_license.html
##############################################################################