473,499 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listing Directory Recursively

30 New Member
Hi

I want list all files on all directory recursively.As example below,

/home/ashok>ls -1p
test.txt
test1.txt
directory1/
directory2/

/home/ashok> cd directory1/
ashok/directory1>ls -1p
a1.txt
a2.txt

ashok/directory1>cd ../directory2/
ashok/directory2>ls -1p
b1.txt
b2.txt


The above is the directory structure from home directory.
I want to display like this below from /home/ashok>
listing:::

test.txt
test1.txt
directory1/a1.txt
directory1/a2.txt
directory2/b1.txt
directory2/b2.txt

How do i do that.

Thanks in advance.Any suggestion is highly appriciated.

-Ashok
Aug 18 '08 #1
4 3067
ashitpro
542 Recognized Expert Contributor
try with 'find' command

find . -print

NOTE:There is dot after find command....
Aug 18 '08 #2
ashokd001
30 New Member
It is exactely what i am expecting but the first entry is giving "."
I want all files under current and all child directories not any directory entry in the listing.But the first entry is a directory "."

Can you please suggest how do i remove the first entry.

-Ashok
Aug 18 '08 #3
ashitpro
542 Recognized Expert Contributor
It is exactely what i am expecting but the first entry is giving "."
I want all files under current and all child directories not any directory entry in the listing.But the first entry is a directory "."

Can you please suggest how do i remove the first entry.

-Ashok
Try this command..It will give you the list of files only...
all directory entries will be excluded..
find . -type f -print
Aug 18 '08 #4
ashokd001
30 New Member
Really great....
Thanks a lot..
-Ashok
Aug 18 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

19
3286
by: SU News Server | last post by:
I've struggled with this for quite a while and I'm am just not sure what is going on. I have the following code import os def buildList( directory='/Users/mkonrad' ) dirs = listing =...
10
3650
by: ibic | last post by:
Just curious: is it possible to recursively list all the directorys/files inside a given directory using standard c i/o library routines only, which can be re-compiled and run on any os supportes c...
2
3359
by: Tom | last post by:
I need to get a directory listing through http. If I put the directory path in the browser address bar such as http://somewebpage.com/subdir I get the listing of the directory. Of course this is...
3
30562
by: S. Han | last post by:
I'm using Directory.GetFiles to enumerate files in a directory. The problem is if you have to enumerate all files + subdirectories recursively, it takes too much memory, and it fails. Is there...
8
11052
by: gil | last post by:
Is it possible to prevent a browser from listing the entire contents of a folder? The site, is hosted on my ISP with the following layout- site/ "user name from ISP" pagefile (dir)...
2
1681
by: ngr | last post by:
I used to use the DirListox control in VB6 but this is no longer supported in VB.NET. What I want to do: I want to take a directory listing and show any subdirectories in a list. When you click...
7
5464
by: epikto | last post by:
I have a mapped share that I am trying to get a listing of all the files that it contains. I use the following code to access the contents String files = Directory.GetFiles(path); I can then...
4
3231
by: techusky | last post by:
I have a *very* simple script written that displays the directory listing of the current working directory, but I am having some difficulty when I try to change folders. Basically, I have my $dir...
5
3464
by: jain236 | last post by:
HI every body, i am always getting the following error while parsing a directory . i am reading a directory by doing ls and trying to find out the name,type,size, mtime and mode of files from...
0
7174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.