find multiple paths


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting find multiple paths
# 1  
Old 07-16-2008
find multiple paths

How do i find files in more than one directory? I searched through forums, but could not land into the right thread.

I tried something like
Code:
find dir1|dir2 -name file1

but it doesn't work. Please suggest.
# 2  
Old 07-16-2008
Code:
DIRLIST="dir1 dir2 dir3 dir4"
for DIR in ${DIRLIST}; do
   find ${DIR} ...
done

# 3  
Old 07-16-2008
Thanks. But, is it not possible to use a single find command to look in multiple directories?
# 4  
Old 07-16-2008
Just tried on gnu find:
Code:
find dir1 dir2 dir3 -type f ....

and it worked.

Works on AIX's find too.
# 5  
Old 07-16-2008
Yes, it works for me too in AIX Smilie

Didn't guess it would be so simple Smilie
# 6  
Old 07-16-2008
Lol nor did I. I haven't used find this way until yet^^
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Wget from multiple paths

if I have these wildcards to download from: path1/*.txt path2/*.txt path3/*.txt path4/*.txt path5/*.txt under a link such as this: http://abc .com/]abc.com Can wget be written in such a way to extract only those files and create the corresponding paths under a target folder? So the... (4 Replies)
Discussion started by: Devyn
4 Replies

2. Shell Programming and Scripting

Storing multiple file paths in a variable

I am working on a script for Mac OS X that, among many other things, gets a list of all the installed Applications. I am pulling the list from the system_profiler command and formatting it using grep and awk. The problem is that I want to be able to use each result individually later in the script.... (3 Replies)
Discussion started by: cranfordio
3 Replies

3. Shell Programming and Scripting

Solaris FIND: Exclude Specific Paths

Using Sol 10 + KSH. I need to run a find command on the whole system "/" and exclude a bunch of explicit directories and files that may or may not be on each system. I cannot use the -name because i dont want to exclude all dirs named just specific paths. -path/-wholename is not an option... (2 Replies)
Discussion started by: nitrobass24
2 Replies

4. Shell Programming and Scripting

Replace directory paths in multiple files at once

I need to update about 2400 files in a directory subtree, with a new directory path inside the files I need to change this occurence in all files: /d2/R12AB/VIS/apps/tech_st/10.1.2 with this: /u01/PROD/apps/apps_st/10.1.3 I know how to change single words using "find . -type f -print0 |... (6 Replies)
Discussion started by: wicus
6 Replies

5. Programming

Can't find paths.h

I wasn't sure which forum to post this in. I am trying to compile logsurfer. After I run configure and the make, I get a complaint that paths.h is not found. I see three places where there is a paths.h: /usr/include/pgsql/server/optimizer/paths.h... (3 Replies)
Discussion started by: brownwrap
3 Replies

6. Shell Programming and Scripting

KSH - Find paths of multiple files in CC (dir and sub-dir))

Dear Members, I have a list of xml files like abc.xml.table prq.xml.table ... .. . in a txt file. Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file. Please help me with the script or command to do so. ... (11 Replies)
Discussion started by: Yoodit
11 Replies

7. Solaris

find home directory paths for all users

How to find al the user's home directories? (2 Replies)
Discussion started by: a2156z
2 Replies

8. Shell Programming and Scripting

To find and replace paths consisting \

Hi all, I am new to unix and wanted to replace the string consisting \ with nothing. I tried the following but did not help. for y in `ls DIV*`; do sed s/C:\\Project\\AML\\bin//g $y > temp mv temp $y done I actually want to remove any occurance of C:\Project\ABC\bin in... (4 Replies)
Discussion started by: cv_pan
4 Replies

9. Shell Programming and Scripting

Enabling a script to run in multiple paths

I have a script that i need to run from different paths. for example mypc/path1/path2/, mypc/path1/path2/path3/, and mypc/path1/path2/path3/path4 How do i set up that script so that it can execute in any of the above paths or how can i make it run on any path on my computer?? (5 Replies)
Discussion started by: dowell
5 Replies

10. Filesystems, Disks and Memory

Multiple Paths to SAN with LVM in Linux?

I'm setting up a CentOS 5 server that will be connected to an HP EVA4000. My previous experience is with an HP VA7400 and HP-UX. In HP-UX I can add "alternate paths" to a volume group in order to have redundant paths to the SAN via dual fiber channel HBAs just by either adding them with... (3 Replies)
Discussion started by: deckard
3 Replies
Login or Register to Ask a Question