Sponsored Content
Top Forums Shell Programming and Scripting List files whose owner or group is numeric Post 303014756 by jim mcnamara on Tuesday 20th of March 2018 11:03:24 AM
Old 03-20-2018
Do you mean group id and user id for numbers?

Code:
cat /etc/group

will show you what numbers to use, /etc/passwd has userids.

Example: user john is uid 633 and group 101:
Code:
find . -type f   \( -user 633 -o -group 101 \)

will start you going.

Note that these numbers are usually not portable between servers, some uid's are constant like root, but john's uid could be almost any number > 100.

Edit: the id command will help, too.
Code:
id john

will show the uid and the group(s) for the user named john. Some users may be in multiple groups

Last edited by jim mcnamara; 03-20-2018 at 12:13 PM..
 

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. UNIX for Dummies Questions & Answers

How to copy owner permissions to group

Hi, I need a command or a script to change the group permissions to be the same as the owner permissions for all my files and directories (recursive) any idea ? (4 Replies)
Discussion started by: ynixon
4 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

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

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

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

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

9. UNIX for Beginners Questions & Answers

UNIX command to display Owner,Group,Root and Subdirectories list

Hi Team, Am a newbie to Unix. As I would like to see the Server Name,Owner Name ( not numeric form), Group Name ( not numeric ID), ROOT path. I would like to send this list as an attachment to my personal mail. Can any one please help me out to to resolve this . Here is the sample result... (6 Replies)
Discussion started by: vasuvv
6 Replies

10. 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
ALTER 
GROUP(7) PostgreSQL 9.2.7 Documentation ALTER GROUP(7) NAME
ALTER_GROUP - change role name or membership SYNOPSIS
ALTER GROUP group_name ADD USER user_name [, ... ] ALTER GROUP group_name DROP USER user_name [, ... ] ALTER GROUP group_name RENAME TO new_name DESCRIPTION
ALTER GROUP changes the attributes of a user group. This is an obsolete command, though still accepted for backwards compatibility, because groups (and users too) have been superseded by the more general concept of roles. The first two variants add users to a group or remove them from a group. (Any role can play the part of either a "user" or a "group" for this purpose.) These variants are effectively equivalent to granting or revoking membership in the role named as the "group"; so the preferred way to do this is to use GRANT(7) or REVOKE(7). The third variant changes the name of the group. This is exactly equivalent to renaming the role with ALTER ROLE (ALTER_ROLE(7)). PARAMETERS
group_name The name of the group (role) to modify. user_name Users (roles) that are to be added to or removed from the group. The users must already exist; ALTER GROUP does not create or drop users. new_name The new name of the group. EXAMPLES
Add users to a group: ALTER GROUP staff ADD USER karl, john; Remove a user from a group: ALTER GROUP workers DROP USER beth; COMPATIBILITY
There is no ALTER GROUP statement in the SQL standard. SEE ALSO
GRANT(7), REVOKE(7), ALTER ROLE (ALTER_ROLE(7)) PostgreSQL 9.2.7 2014-02-17 ALTER GROUP(7)
All times are GMT -4. The time now is 12:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy