Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-08-2006, 03:41 PM
|
#1
|
|
Member
Registered: Dec 2005
Posts: 65
Rep:
|
Recursive directories listing
How can I output only the names of the files and directories recursively?
Thanks
|
|
|
|
12-08-2006, 03:51 PM
|
#2
|
|
Member
Registered: Oct 2006
Location: Utah
Posts: 520
Rep:
|
|
|
|
|
12-08-2006, 03:58 PM
|
#3
|
|
Member
Registered: Dec 2005
Posts: 65
Original Poster
Rep:
|
Thanks fordeck but I only need the names to use them in a script. I don't want paths. Maybe you can point to a scipt that does that?
|
|
|
|
12-08-2006, 04:23 PM
|
#4
|
|
Member
Registered: Oct 2006
Location: Utah
Posts: 520
Rep:
|
Could you tell us alittle more about what your trying to accomplish? Like what are you wanting to do with the list of files? Maybe you could even give some example data to show what you are trying to do?
Regards,
Fordeck
|
|
|
|
12-08-2006, 04:35 PM
|
#5
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
(deletes all lines containing the character "/") (Still need one more filter to delete the empty lines--maybe?)
|
|
|
|
12-08-2006, 04:50 PM
|
#6
|
|
Senior Member
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,153
Rep: 
|
find . -print
|
|
|
|
12-08-2006, 05:04 PM
|
#7
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
Quote:
|
Originally Posted by Quakeboy02
find . -print
|
That gives full pathnames--not what OP was looking for (But then I must not speak for him/her)
|
|
|
|
12-08-2006, 05:27 PM
|
#8
|
|
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530
Rep:
|
Code:
find . |sed 's|.*/||'
|
|
|
|
12-08-2006, 05:32 PM
|
#9
|
|
Senior Member
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,153
Rep: 
|
find . |sed 's|.*/||'
The power of the collective!  )
|
|
|
|
12-08-2006, 06:29 PM
|
#10
|
|
Member
Registered: Dec 2005
Posts: 65
Original Poster
Rep:
|
Quote:
|
Originally Posted by matthewg42
Code:
find . |sed 's|.*/||'
|
Excellent. Thanks guys.
|
|
|
|
12-08-2006, 06:55 PM
|
#11
|
|
Member
Registered: Dec 2005
Posts: 65
Original Poster
Rep:
|
If I want to write a recursive csh script for diretories listing (instead of using find), how would I do it?
|
|
|
|
12-09-2006, 07:04 AM
|
#12
|
|
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530
Rep:
|
Eugh, don't use csh. If you want to do it with scripts, at least use a borne style shell. csh is horrible for scripting.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:47 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|