The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Delete a word and complete line Aejaz UNIX for Advanced & Expert Users 1 05-02-2008 09:50 AM
Using the Esc key to complete command line typing jxh461 UNIX for Dummies Questions & Answers 1 06-05-2007 03:04 PM
Path in prompt line? Leitwolf UNIX for Dummies Questions & Answers 4 04-02-2007 12:25 PM
display full unix path as part of the command line ocelot UNIX for Dummies Questions & Answers 3 10-10-2006 11:58 AM
displaying the path in the command line ocelot Shell Programming and Scripting 2 10-10-2006 11:58 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-10-2005
Registered User
 

Join Date: Dec 2005
Posts: 2
ls -R command but need complete path name on each line

Can anyone help me with the following:
I need to traverse subdirectories to create a list of files with the pathname. For example, here’s what I get with a simple ls –alR command:

/MAIN/data/30007390 dte2>>ls -alR

.:

total 2

drwxrwx--- 4 ecfadmin staff 96 Oct 24 18:35 .

drwxrwx--- 37 ecfadmin staff 1024 Oct 24 18:35 ..

drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 GroupB

drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 GroupA



./GroupB:

total 8

drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 .

drwxrwx--- 4 ecfadmin staff 96 Oct 24 18:35 ..

-rwxrwx--- 1 ecfadmin staff 1968 Oct 24 18:35 02050506.GZ

-rwxrwx--- 1 ecfadmin staff 1976 Oct 24 18:35 02050720.GZ



./GroupA:

total 20

drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 .

drwxrwx--- 4 ecfadmin staff 96 Oct 24 18:35 ..

-rwxrwx--- 1 ecfadmin staff 9453 Oct 24 18:35 05050602.GZ



What I would like to get back is something with the full path name and file name:



/MAIN/data/30007390/GroupB/02050720.GZ

/MAIN/data/30007390/GroupB/02050506.GZ

/MAIN/data/30007390/GroupA/05050602.GZ

*Permissions, primary and secondary group names, dates times and sizes are not needed but don’t have to be excluded.

I’m looking for something pretty straight forward, I could write a little shell to handle it but was hoping for something a little more elegant. (I was hoping there was a version (or option) of “ls” out there that might do it).

Any help would be appreciated.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-10-2005
Just Ice's Avatar
Lights on, brain off.
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 629
try "find" instead ... see "man find" ...

find . -type f -print
Reply With Quote
  #3 (permalink)  
Old 12-12-2005
Registered User
 

Join Date: Dec 2005
Posts: 2
That was exactly what I was looking for. It works great. Thanks very much!!!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0