Hello, i would like to find huge files and group them by owners.
To find big files i use this command:
Code:
ls -lR | sort -bnr +4 | head -n 75
which give me 75 biggest files, then i need to see in which subdirectory is every file.
second thing i dont know is how to group those files by owner, could someone help me?, have no idea how to do it.
Was trying to play with 'find' command etc but it dont work like i want
The structure i would like to get is following
Code:
name_user1
drwxr-xr-x 4 user1 root 7 Feb 22 2007 file1
drwxr-xr-x 4 user1 root 15 Feb 23 2007 file2
drwxr-xr-x 4 user1 root 20 Apr 13 2007 file3
drwxr-xr-x 5 user1 root 32 Jul 19 2007 file4
drwxr-xr-x 4 user1 root 46 Jul 30 2007 file5
drwxr-xr-x 5 user1 root 56 Sep 20 2007 file6
dr-xr-xr-x 5 user1 sys 67 Mar 24 2008 file7
name_user2
drwxr-xr-x 8 user2 other 9 Jun 16 2008 file1
drwxr-xr-x 6 user2 root 19 Oct 10 12:50 file2
drwxr-xr-x 5 user2 root 26 Oct 14 18:17 file3
drwxr-xr-x 2 user2 root 35 Nov 13 13:37 file4
drwxr-xr-x 76 user2 root 46 Nov 21 09:01 file5
drwxr-xr-x 6 user2 root 58 Nov 27 07:34 file6
drwxr-xr-x 11 user2 root 62 Jan 12 15:39 file7
drwxr-xr-x 5 user2 root 95 Jan 12 15:57 file8
name_user3
drwxr-xr-x 3 user3 root 3 Jan 13 09:01 file1
drwxr-xr-x 3 user3 other 8 Jan 13 11:17 file2
drwxrwxr-x 5 user3 other 61 Jan 13 13:01 file3
i know that i can get user_name from /etc/passwd but how to make it so nice ordered?
Thanks for you help
I am bit unclear of how Linux was set in the real world, please advise me how it's supposed to be.
When I log in as root and do a ls -l, I find: /boot, /, /var, /usr, /tmp, /home, /u01, /u02, /u03 and of of this partition is owned by root and the group also belong to root. Is that the way it's... (1 Reply)
hello
I search a script (ksh for Aix 5.3) to save all permissions, groups and owner for all files. Because we work much to change it, and a mystake ......!
So i want execute this script to save/ execute permissions for all files.
If you have this script, thank you for your help ;)
best... (2 Replies)
hi all,
i need to capture all the files in a directory and its subdirectories that have owner name different than the root owner.
for one file it is " stat -c %U filename " but i need to search for each and every file and record it.
thanks in advance (14 Replies)
Hi all,
We have some files are under 744 permissions and the the owner is say owner1 and group1.
Now we have another user owner2 of group2, owner2 can remove files of the owner1 and the permission of those files are 744, unix admin told us he did some config at his side so we can do that.
... (14 Replies)
If I have to identify the group owner of an AIX group, what is the command to be used. Example: there is an mqadm group, how do I find the owner of this group?
Please help. (6 Replies)
Dears
it is normal that the below binaries stay without any owner and group
I have checked it in many servers and the like the below
/usr/lpp/bos.net/inst_root/etc/ipsec# ls -lrt
total 248
-r-xr-xr-x 1 987 987 13589 Jun 29 2005 default_group
-r-xr-xr-x ... (5 Replies)
Hi.
My example:
I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that
chown -R log_adm /log/*
chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
I am searchingfor files owned by particular owner and group in a particular directory including its sub-directories. I use
find <dir> -user <user> -group <group> -exec ls -l {} \;
It does not work completely. In the sense is a subdirectory is owned by 'user' and group 'group' then all... (9 Replies)
I want to add a condition is my find command to include files/sub-directory whose owner or group is all numeric number.
My current find command is
find . \( -user root -o -user soham\) -type f -exec ls -l {} \; 2>&1
---------- Post updated at 10:20 AM ---------- Previous update was at... (5 Replies)
Discussion started by: Soham
5 Replies
LEARN ABOUT MINIX
find
FIND(1) General Commands Manual FIND(1)NAME
find - find files meeting a given condition
SYNOPSIS
find directory expression
EXAMPLES
find / -name a.out -print
# Print all a.out paths
find /usr/ast ! -newer f -ok rm {} ;
# Ask before removing
find /usr -size +20 -exec mv {} /big ;
# move files > 20 blks
find / -name a.out -o -name '*.o' -exec rm {};
# 2 conds
DESCRIPTION
Find descends the file tree starting at the given directory checking each file in that directory and its subdirectories against a predi-
cate. If the predicate is true, an action is taken. The predicates may be connected by -a (Boolean and), -o (Boolean or) and ! (Boolean
negation). Each predicate is true under the conditions specified below. The integer n may also be +n to mean any value greater than n, -n
to mean any value less than n, or just n for exactly n.
-name s true if current filename is s (include shell wild cards)
-size n true if file size is n blocks
-inum n true if the current file's i-node number is n
-mtime ntrue if modification time relative to today (in days) is n
-links ntrue if the number of links to the file is n
-newer ftrue if the file is newer than f
-perm n true if the file's permission bits = n (n is in octal)
-user u true if the uid = u (a numerical value, not a login name)
-group gtrue if the gid = g (a numerical value, not a group name)
-type x where x is bcdfug (block, char, dir, regular file, setuid, setgid)
-xdev do not cross devices to search mounted file systems
Following the expression can be one of the following, telling what to do when a file is found:
-print print the file name on standard output
-exec execute a MINIX command, {} stands for the file name
-ok prompts before executing the command
SEE ALSO test(1), xargs(1).
FIND(1)