Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Group files by owner and show directory Post 302518753 by dealer1985 on Sunday 1st of May 2011 06:22:59 PM
Old 05-01-2011
Group files by owner and show directory

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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

owner and group in Linux

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)
Discussion started by: lapnguyen
1 Replies

2. Shell Programming and Scripting

permission, owner and group

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)
Discussion started by: pascalbout
2 Replies

3. Shell Programming and Scripting

to parse a directory and its subdirectories and find owner name of files

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)
Discussion started by: vyasa
14 Replies

4. UNIX for Advanced & Expert Users

How UNIX admin set up this? how files of 744 of other owner can be removed by another owner?

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)
Discussion started by: TheGunMan
14 Replies

5. UNIX for Dummies Questions & Answers

Finding the Group Owner Name

Hi all, How can i find the group owner name...??? Thanks (4 Replies)
Discussion started by: mansahr143
4 Replies

6. Emergency UNIX and Linux Support

To identify the group owner

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)
Discussion started by: ggayathri
6 Replies

7. AIX

Files without owner and group

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)
Discussion started by: thecobra151
5 Replies

8. AIX

How to set owner and permission for files/directory in directory in this case?

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)
Discussion started by: bobochacha29
8 Replies

9. Shell Programming and Scripting

Search for files owned by particular owner and group

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)
Discussion started by: Soham
9 Replies

10. Shell Programming and Scripting

List files whose owner or group is numeric

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
CGCONFIGPARSER(8)						 libcgroup Manual						 CGCONFIGPARSER(8)

NAME
cgconfigparser - setup control group file system SYNOPSIS
cgconfigparser [-h] [-l <filename>] [-L <directory>] [...] OPTIONS
-h, --help Displays help. -l, --load=FILE Parses the control groups configuration file Sets up the control group file system defined by the configuration file and mounts mount points defined by the configuration file. The format of the file is described in cgconfig.conf. This option can be used mul- tiple times and can be mixed with -L option. -L, --load-directory=DIR Finds all files in given directory and parses them in alphabetical order like they were specified by -l option. This option can be used multiple times and can be mixed with -l option. -a <agid>:<auid> defines the default owner of the rest of the defined control group's files. These users are allowed to set subsystem parameters and create subgroups. The default value is the same as has the parent cgroup. -d, --dperm=mode sets the default permissions of a control groups directory. The permissions needs to be specified as octal numbers e.g. -d 775. -f, --fperm=mode sets the default permissions of the control group files. The permissions needs to be specified as octal numbers e.g. -f 775. The value is not used as given because the current owner's permissions are used as an umask (so 777 will set group and others permis- sions to the owners permissions). -s, --tperm=mode sets the default permissions of the control group tasks files. The permissions needs to be specified as octal numbers e.g. -f 775. The value is not used as given because the current owner's permissions are used as an umask (so 777 will set group and others per- missions to the owners permissions). -t <tuid>:<tgid> defines the default owner of tasks file of the defined control group. I.e. this user and members of this group have write access to the file. SEE ALSO
cgconfig.conf (5) Linux 2009-03-16 CGCONFIGPARSER(8)
All times are GMT -4. The time now is 05:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy