Awk/script to list the owners of files | 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 !!

Awk/script to list the owners of files

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-30-2013
ggayathri ggayathri is offline
Registered User
 
Join Date: Oct 2008
Last Activity: 5 September 2014, 5:31 AM EDT
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
Awk/script to list the owners of files

I have to list the files in a directory and along with that, list the owner of each of those files. Can someone please help me with a way to get this info please?

Gayathri
Sponsored Links
    #2  
Old 10-30-2013
sea sea is offline
Registered User
 
Join Date: Sep 2013
Last Activity: 24 October 2014, 11:07 AM EDT
Location: Swissh
Posts: 377
Thanks: 55
Thanked 49 Times in 49 Posts
Have a try with:

Code:
ls -l|awk '{print $3" "$9}'

Sponsored Links
    #3  
Old 10-30-2013
Scott's Avatar
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 24 October 2014, 8:03 PM EDT
Location: Zürich
Posts: 8,484
Thanks: 332
Thanked 1,047 Times in 914 Posts
If you have the stat command, you can try:


Code:
[scott@ks tmp]$ touch a b c
[scott@ks tmp]$ stat -c "%U %n" *
scott a
scott b
scott c

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
Find only files/directories with different permissions/owners dheian Shell Programming and Scripting 5 05-12-2013 02:32 AM
Script to check the owners & permissions Dr.Matrix Shell Programming and Scripting 7 05-02-2010 10:48 AM
I need a script to find socials in files and output a list of those files NewSolarisAdmin Shell Programming and Scripting 1 02-19-2009 12:01 PM
Identifying Semaphore Owners backslash AIX 1 06-04-2006 10:06 PM
Need help from E280R owners Don.Key Solaris 2 06-20-2005 03:20 PM



All times are GMT -4. The time now is 08:35 PM.