searching through directories


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting searching through directories
# 1  
Old 09-29-2004
Data searching through directories

Please help. I am getting back into UNIX and I need a script that requires me to start in one main directory (call it mydata) and under this directory searches several subdirectories within subdirectories. I need to search each directory to locate *_source and delete files within the directory (which is a parameter from the script, got that part) within the *_source directory. I keep messing up the syntax and I need it to run through without specifiing the directories (in case there is one added or several deleted in the course of time).

THANK YOU !!!

MrJaunty

Last edited by MrJaunty; 09-30-2004 at 12:07 AM..
# 2  
Old 09-29-2004
I am not sure what you are asking for. Do you want to find and erase all files of the form *_source in My_data and all subdirectories below?
# 3  
Old 09-29-2004
sorry - hope explaination here is better

Trying to locate what subdirectories of Mydata contain a directory *_source. Some subdirectories may contain more than one *_source directory. Once found, I would need to go into the *_souce directory looking for a directory (01-12, which was specified as a parameter when first ran the script) and then finally go into that 01-12 directory and remove all files in that directory only...

I hope I explained that better ...

thank you for reply and help !!!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Giving read write permission to user for specific directories and sub directories.

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
Discussion started by: blinkingdan
1 Replies

2. UNIX for Dummies Questions & Answers

List the directories, having given pattern in the directories name, sorted by creation date

It is for HP-Unix B.11.31. Requirement: 1. List the directories, having given pattern in the directories name, sorted by creation date. Example: Directories with name "pkg32*" or "pkg33*" 2. On the output of 1. list the directories by creation date as sort order, with creation date... (2 Replies)
Discussion started by: Siva SQL
2 Replies

3. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

4. UNIX for Dummies Questions & Answers

Using grep command to find the pattern of text in all directories and sub-directories.

Hi all, Using grep command, i want to find the pattern of text in all directories and sub-directories. e.g: if i want to search for a pattern named "parmeter", i used the command grep -i "param" ../* is this correct? (1 Reply)
Discussion started by: vinothrajan55
1 Replies

5. Shell Programming and Scripting

searching different multiple directories

Suppose I have 5 different directories in some path .Is it possible to search 5 different directories using find command in one single command line. I mean something like this:- find path -type d -name dirname1 dirname2 .......... pls help (2 Replies)
Discussion started by: maitree
2 Replies

6. Shell Programming and Scripting

Script for parsing directories one level and finding directories older than n days

Hello all, Here's the deal...I have one directory with many subdirs and files. What I want to find out is who is keeping old files and directories...say files and dirs that they didn't use since a number of n days, only one level under the initial dir. Output to a file. A script for... (5 Replies)
Discussion started by: ejianu
5 Replies

7. Shell Programming and Scripting

searching for a filename in ALL directories

Hi, I am searching for a file named "Backup.txt" but I don't know in which directory it is. Can someone tell me, how I can search recursiv in all directories and subdirectories? thanks (2 Replies)
Discussion started by: ABE2202
2 Replies

8. Shell Programming and Scripting

searching content of files in the current and sub directories

Hi I was wondering why command 2 doesn't work like command 1 below. 1. find . -exec grep "test" '{}' \; -print 2. ls -R | grep "test" I am trying to search "test" from all the files in the current and sub directories. What's wrong with my command 2? Thanks in advance for your help (4 Replies)
Discussion started by: tiger99
4 Replies

9. Shell Programming and Scripting

searching for list of empty directories

Guys I need to write a korn shell script that will search for a list of empty sub-directories in a specific directory and then email a list of these empty directories. Any ideas - apologies, I am new to shell scripting. Thanks (4 Replies)
Discussion started by: man80
4 Replies
Login or Register to Ask a Question