Loop through Sub Directories and search for set of files
I have the below directory in unix environment
i need to ignore the files present in the directory. but i need to loop through all the sub directories present
in this directory and search for ABC.txt in each sub directories
if ABC.txt file present in a sub directory then
echo "ABC.txt present in sub_directory_name"
else
echo "ABC.txt not present in sub_directory_name"
fi
how can i accomplish this in unix shell script.
Please assist.
Last edited by radoulov; 02-08-2011 at 06:17 AM..
Reason: Code tags, please!
Hello,
I'm a first time poster looking for help in scripting a task in my daily routine. I am new in unix but i am attracted to its use as a mac user.
Bear with me...
I have several files (20) that I manually drag via the mouse into several named directories over a network. I've used rsync... (14 Replies)
Hello
I have user directories that contain /temp directory.
Example folders:
/user1/temp/
/user2/temp/
/user3/temp/
How can i loop over all user directories and find all files only in their /temp folder?
Thanks a lot for help! (3 Replies)
Hi,
I am looking for a shell script which serves the below purpose.
Please find below the algorithm for the same and any help on this would be highly appreciated.
1)set of strings need to be replaced among set of files(directory may contain different types of files)
2)It should search for... (10 Replies)
Hi,
I want to access files from different directories (for example: /home/dir1/file1 , /home/dir2/file2 ...) Like this i have to access these files(file1, file2...). (3 Replies)
Hello,
Currently I have a painstaking process that I use to move file for a monthly archive. I have to run the same two commands for 24 different directories. I wish to have a script with a for loop automate this and I have not been able to succeed. Here is what I do 24 times. I know this is... (5 Replies)
Hi,
I have various log files in different paths. e.g.
a/b/c/d/e/server.log
a/b/c/d/f/server.log
a/b/c/d/g/server.log
a/b/c/h/e/server.log
a/b/c/h/f/server.log
a/b/c/h/g/server.log
a/b/c/i/e/server.log
a/b/c/i/e/server.log
a/b/c/i/e/server.log
and above these have an archive folder... (6 Replies)
Hi,
Please help me on this.
Suppose i have the following directory structure.
/app/data
/app/data/eng
/app/data/med
/app/data/bsc
each of the directories data,data/eng,data/med,data/bsc holds files with date extension like
a.20081230
b.20081230 and so on
I need a script to loop... (9 Replies)
I'm trying to write a script that will loop through all files and directories down from a path I give it, and change the permissions and ACL. I was able to do the obvious way and change the files and folders on the same level as teh path...but I need it to continue on deeper into the file... (2 Replies)
I want to search for a file pattern in more than one directory. How I need to do that?
Here is the scenario:
I am having a directory structure like the following:
/log
...../20051001
..........ftp_server_20051001.log
..........ftp_down_server.log
..........ftp_up_server.log... (7 Replies)