listing directory contents WITH path to files
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > listing directory contents WITH path to files




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    listing directory contents WITH path to files  
Rob Baxter


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:01 PM

Hi,

I have looked through the arguments for 'dir' and 'ls' on a redhat 8.0
linux system and can't seem to figure out how to generate output that
includes the file and the path to that file.  I'm using BASH.  I need:

/path/to/file1.txt
/path/to/file2.txt

instead of (ls -1):

file1.txt
file2.txt

Any ideas?  Surely this is possible, thanks in advance as always.





[ Post a follow-up to this message ]



    Re: listing directory contents WITH path to files  
Scott McMillan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:01 PM

On 5 Sep 2003 07:29:51 -0700, rbaxter@cyence.com (Rob Baxter) wrote:
quote:
>Hi, > >I have looked through the arguments for 'dir' and 'ls' on a redhat 8.0 >linux system and can't seem to figure out how to generate output that >includes the file and the path to that file. I'm using BASH. I need: > >/path/to/file1.txt >/path/to/file2.txt > >instead of (ls -1): > >file1.txt >file2.txt > >Any ideas? Surely this is possible, thanks in advance as always.
find ./ -print man find Scott McMillan




[ Post a follow-up to this message ]



    Re: listing directory contents WITH path to files  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:01 PM

In article <baea5fa.0309050629.21712bd3@posting.google.com>,
Rob Baxter <rbaxter@cyence.com> wrote:
quote:
>Hi, > >I have looked through the arguments for 'dir' and 'ls' on a redhat 8.0 >linux system and can't seem to figure out how to generate output that >includes the file and the path to that file. I'm using BASH. I need: > >/path/to/file1.txt >/path/to/file2.txt > >instead of (ls -1): > >file1.txt >file2.txt > >Any ideas? Surely this is possible, thanks in advance as always.
ls /path/to/* If you want to see the dot-files as well: ls /path/to/.* /path/to/* -- Barry Margolin, barry.margolin@level3.com Level(3), Woburn, MA *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups. Please DON'T copy followups to me -- I'll assume it wasn't posted to the gro up.




[ Post a follow-up to this message ]



    Re: listing directory contents WITH path to files  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:01 PM

In article <gx16b.569$mD.505@news.level3.com>,
Barry Margolin  <barry.margolin@level3.com> wrote:
quote:
>ls /path/to/* > >If you want to see the dot-files as well: > >ls /path/to/.* /path/to/*
Oops, you should use the -d option in both of those, to avoid having it open up subdirectories. -- Barry Margolin, barry.margolin@level3.com Level(3), Woburn, MA *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups. Please DON'T copy followups to me -- I'll assume it wasn't posted to the gro up.




[ Post a follow-up to this message ]



    Re: listing directory contents WITH path to files  
Chris F.A. Johnson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:01 PM

On Fri, 05 Sep 2003 at 14:29 GMT, Rob Baxter wrote:
quote:
> Hi, > > I have looked through the arguments for 'dir' and 'ls' on a redhat 8.0 > linux system and can't seem to figure out how to generate output that > includes the file and the path to that file. I'm using BASH. I need: > > /path/to/file1.txt > /path/to/file2.txt > > instead of (ls -1): > > file1.txt > file2.txt > > Any ideas? Surely this is possible, thanks in advance as always.
ls -d $PWD/* For shells which do not maintain the $PWD variable: ls -d `pwd`/* -- Chris F.A. Johnson http://cfaj.freeshell.org ======================================== =========================== My code (if any) in this post is copyright 2003, Chris F.A. Johnson and may be copied under the terms of the GNU General Public License




[ Post a follow-up to this message ]



    Re: listing directory contents WITH path to files  
Rob Baxter


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:01 PM

Barry Margolin <barry.margolin@level3.com> wrote in message news:<2y16b.570$mD.491@news.level3.com
>...
quote:
> In article <gx16b.569$mD.505@news.level3.com>, > Barry Margolin <barry.margolin@level3.com> wrote: > > Oops, you should use the -d option in both of those, to avoid having it > open up subdirectories.
I used the "ls /path/to/*" option to solve the problem - thanks to everyone. I had actually tried "ls /path/to" but that doesn't work - you have to add the asterisk...I'd never have thought that. Cheers, Rob




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:21 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum 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
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register