Try:
EDIT:
find DVLP -type f -name "XYZ" would get you files named XYZ. I think what you want is the files named anything which are inside directories XYZ?
find DVLP -type d -name XYZ -print0 finds directories under DVLP which are called XYZ. -print0 outputs them NUL-terminated, which is just a precaution in case any directory names have whitespace in them.
find <path> -maxdepth 1 -type f finds files directly under <path> (i.e. it doesn't check subdirectories of <path>)
xargs passes its input as arguments to the command specified. By default it separates its input using whitespace, but -0 overrides that to use NUL. Also by default, the arguments are supplied as the last parameter to the command, but by using -I<replace string> it will pass them wherever <replace string> is in the command.
In this case, I'm using -I{}, so xargs passes its input (the list from the directory find) to the files find as the path to start from.
EDIT:
Quote:
Originally Posted by emc^24sho
So to find all of the xml files under there it would be?
No - that would find files which actually contain / in the filename itself (which is highly unlikely for Unix).
If you wanted all xml files under DVLP you could do:
If you only want xml files which are in directories called XYZ which are under DVLP then you could do:
How to get a file 'zlib.h' in an entire directory with an excluded directory specified lives under that starting directory by using find command, as it failed on:
$ find . -name 'zlib.h' -a -ipath 'CHROME.TMP' -prune -o -print
it'll just list entirely up (2 Replies)
I would really appreciate any assistance that I can get here.
I am fairly new to perl. I am trying to rewrite my shell scripts to perl.
Currently I have a shell script (using sed, awk, grep, etc) that gets a list of all of the zone files in a directory and then looks in named.conf for what... (0 Replies)
Someone in my group manages to name a directory -p. I'm not sure how they did it but it's there.
How can I access the directory or change it's name? I've tried to quote it (cd "-p"). I've tried to use the backslash (cd \-p) and a combination of the two (cd "\-p" and cd \-p). each of these... (3 Replies)
Hi Everyone!
Looking for some help with a script that will take all files in any given root folder (which are not already in a folder) and put them into separate folders with the name of each given file.
Any ideas?
Thank you! (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write a C program to search the current directory for all pipes.
1. It will print the pipe... (2 Replies)
Pls. advise how to find or used grep recursively all shell script files.
Some files doesnt have a .sh or .ksh extension name.
find / -name "*" |xargs grep bin |grep sh
??
TIA (1 Reply)
I am preparing a shell script to backup a few config files on a daily basis, with a retention of 30 days. Need some help with syntax/examples:
The shell script (running as cron) would require the following:
1. create a sub-directory within a specified (backup) directory, in the format... (3 Replies)
I'm trying to find this string 'preparing string IBE_Quote_W1_Pvt.SaveWrapper for quote_header_id’ in my Apache log file directory. The log file that contains this string may be in a parent direcotry or a sub-directory. I have tried 'grep' and 'awk' with no success.
I would like to get the path... (3 Replies)
I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem.
so i need to use find command (6 Replies)
Since this site solved my problems before, I am back for more (solutions)
I down load via a script every day a file that has the same name as the file of the day before. I want to move that file to its own directory like:
/archive/jul30
How do I capture the systems date in a script an... (2 Replies)