Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find File Owners for *.sh in all sub-direcories 2

Status
Not open for further replies.

gsgb1

Programmer
Jul 31, 2004
21
CA
How would I find the shell file names and corresponding owner, while files are in many subdirectories?

I can see all the files with ls -lR and use Excel to format the output, but I want to do it in UNIX alone, and this is what output should be

./this/is/the/path/filename.sh owner

Thanks in advance.
 
Here's another idea:
# cd {base directory}
# find . -type f -name "*.sh" -exec ls -l {} \;|awk '{ print $9 " " $3 '}|more
 
feherke,
I get find: 0652-017 -printf is not a valid option.

If I use -print, I get
find: 0652-009 There is a missing conjunction
 
Hi:

Feherke is using the GNU version of find which supports printf. Yours obviously doesn't, try:

find . -type f -name "*.sh" -print
 
Or perhaps find . -type f -name "*.sh" -ls | awk '{print $11,$5}'.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top