listing for all directories

listing for all directories

Post by Homer Wilson Smi » Tue, 30 Aug 1994 15:00:35



     How do I list for a file inside of a directory and for all
directories in side that directory.  (I supposed I could use find.)

     I would think something like

     ls -R make*

     work to find all files starting with 'make' inside of the present
directory and all sub directories.  But it doesn't work.

     Answers by private mail welcome and preferred.  But I do read this
group.

     Homer

 
 
 

listing for all directories

Post by David W. Tamk » Tue, 30 Aug 1994 16:25:10




|      How do I list for a file inside of a directory and for all
| directories in side that directory.  (I supposed I could use find.)

You suppose correctly.  Use find.

 
 
 

listing for all directories

Post by Mark Thom » Wed, 31 Aug 1994 01:47:25





: |      How do I list for a file inside of a directory and for all
: | directories in side that directory.  (I supposed I could use find.)

: You suppose correctly.  Use find.

slightly more informative.. use:

find . -name make\* -print

;)

-mark
--
Mark Thomas
Assistant System Administrator  | Student System Administrator
O'Reilly & Associates, Inc. | Boston University CS Department
90 Sherman Street               | 111 Cummington Street
Cambridge, MA 02140             | Boston, MA 02215

:) :) :)

 
 
 

1. how to delete files based on listing in another directory

I have two directories, let's call them dir1 and dir2.

I need to delete files from dir1 that are not in dir2.
f.ex: if dir1 has files: file1 through file10, and dir2
has files: file3 through file10, I want file1 and file2
in dir1 deleted. The rest of the files in dir1 should
be left intact (hence I can't use rsync since rsync will
update the remaining files if different).
Her's one solution I know of:

ls -1 dir1 > /tmp/dir1
ls -1 dir2 > /tmp/dir2
diff /tmp/dir1 /tmp/dir2 | grep '<' | sed 's/< //' | xargs rm
rm /tmp/dir1 /tmp/dir2

but I'd like to do this without using temporary files, preferably
on one line (by using sed, awk, diff, ls, pipes, etc).
What's the best way to achieve this?

Thanks.

2. netscape offline?

3. Creating a Recursive Listing of all directory content?

4. ParaMind Brainstorming Software Needs UNIX/LINUX help

5. Only list (ls) certain directory names?

6. PLEASE HELP: eth0: trigger_send() called with the transmitter busy.

7. Slow ls listing of a directory

8. Boot disk for UW7 on LH3

9. Creating a Recursive Listing of all directory content?

10. Alphabetical list of matched directories

11. recursive listing skipping specific directories

12. list short column directory

13. Listing of /usr directories for Slackware??