Finding the group owner for a file | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Finding the group owner for a file

UNIX for Dummies Questions & Answers


Tags
file, group, owner

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-08-2013
Dad4x Dad4x is offline
Registered User
 
Join Date: Aug 2006
Last Activity: 1 October 2014, 3:36 PM EDT
Posts: 1
Thanks: 2
Thanked 0 Times in 0 Posts
Finding the group owner for a file

How would I find out who the group openers is of a file? For example:


Code:
> ls -l myfile
-rwxr-xr-x    1 myronp   hawks            20125 Oct 20 20:50 myfile

How do I return just hawks. I could do this with a series of cut or awk, but is there a more direct way.

The ls -g is better, but still has all the permissions, size info:


Code:
> ls -g sweepftp
-rwxr-xr-x    1 lawson        20125 Oct 20 20:50 sweepftp

There must be a better way to get the group of a file.

Last edited by Scrutinizer; 02-08-2013 at 02:08 PM.. Reason: code tags
Sponsored Links
    #2  
Old 02-08-2013
alister alister is offline
Registered User
 
Join Date: Dec 2009
Last Activity: 11 June 2014, 8:40 PM EDT
Posts: 3,231
Thanks: 179
Thanked 973 Times in 789 Posts
If your system has a stat utility, man 1 stat should tell you all you need to know. Specifically, for customized output, with GNU stat see the -c option; with BSD stat, see the -f option.

Regards,
Alister
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Finding the Group Owner Name mansahr143 UNIX for Dummies Questions & Answers 4 11-11-2012 06:50 PM
Creating a file where the owner and group is not root jdilts UNIX for Dummies Questions & Answers 20 06-09-2012 02:12 AM
How to set the name of the group and the owner while creation of the file? nehak UNIX for Dummies Questions & Answers 2 04-23-2008 09:26 AM
File Owner/Group through Shell Script rahulrathod Shell Programming and Scripting 1 02-26-2008 02:45 PM
Can't change owner and group of a linux file bache_gowda UNIX for Dummies Questions & Answers 7 06-26-2003 11:08 PM



All times are GMT -4. The time now is 04:42 PM.