Sponsored Content
Top Forums Shell Programming and Scripting Search for files owned by particular owner and group Post 303014330 by Soham on Friday 9th of March 2018 10:32:52 AM
Old 03-09-2018
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

Code:
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 files under that directory are also displayed even though they are owned by different user/group.

Any 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. Cybersecurity

File owned by oracle user and dba group need readonly access to other users

Under oracle user file abc.txt was created. Oracle user belong to dba group on UNIX Server. However other non Oracle users which belongs to some other network groups need read only access to this file. Every time when I login as other then oracle user and try to view this file it saying that I... (2 Replies)
Discussion started by: groosha
2 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. Shell Programming and Scripting

search files with owner having execute permission

Hi All, I have to search for all files in the current directory where the owner having execute operation. I can find the files with specific permission such as 666 find . -type f -perm 666 But how to find files with only execute permission to user. tried with : find . -type f... (3 Replies)
Discussion started by: gotam
3 Replies

6. UNIX for Dummies Questions & Answers

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: 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... (6 Replies)
Discussion started by: dealer1985
6 Replies

7. 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

8. 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

9. 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

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
setregid(2)							System Calls Manual						       setregid(2)

NAME
setregid - sets the real and effective group IDs SYNOPSIS
DESCRIPTION
sets the real and effective group IDs of the calling process. Only a privileged process can set the real group ID and/or the effective group ID to any valid value. A nonprivileged process can set the real group ID to the saved set-group-ID from one of the exec family of functions, or the effective group ID to either the saved set-group- ID or the real group ID. Any supplementary group IDs of the calling process remain unchanged. Argument rgid is the read group ID value to be set with. If rgid is set to the real group ID is not be changed. Argument egid is the effective group ID value to be set with. If egid is set to -1, the effective group ID is not changed. The real and effective group IDs may be set to different values in the same call. Security Restrictions Some or all of the actions associated with this system call require the privilege (CHSUBJIDENT). Processes owned by the superuser will have this privilege. Processes owned by other users may have this privilege, depending on system configuration. See privileges(5) for more information about privileged access on systems that support fine-grained privileges. RETURN VALUE
Upon successful completion is set to Otherwise, errno is set to indicate the type of error and neither group IDs are changed. ERRORS
is set to one of the following values if the corresponding condition is detected. The value of the rgid or egid argument is invalid or out-of-range. The process does NOT have all the appropriate privileges other than to change the real group ID to the saved set-group-ID, or to change the effective group ID to either the real group ID or the saved set-group-ID. AUTHOR
was developed by the University of California, Berkeley and HP. SEE ALSO
exec(2), geteuid(2), getgid(2), getuid(2), setegid(2), setgid(2), setreuid(2), setuid(2). setregid(2)
All times are GMT -4. The time now is 12:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy