Sponsored Content
Top Forums Shell Programming and Scripting How-To Exclude Directory in find command Post 302976432 by mohtashims on Wednesday 29th of June 2016 08:59:37 AM
Old 06-29-2016
@Don: Thank you for the suggestion.

But where can i put the -print option which you can see in the OP ?

Becoz in the next line i was reading the output file as you can see below.

Code:
find . -type f \( ! -name "*.log*"  ! -name "*.jar*" \) -print |
while read file
do

Please suggest.

Last edited by mohtashims; 06-29-2016 at 10:41 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how do i exclude the current directory when using find?

i want to compile a list of files in all sub directories but exclude the current directory. the closest i could get was to search 'only' the current directory, which is the opposite of what i wanted. find . ! -name . -prune (7 Replies)
Discussion started by: mjays
7 Replies

2. Shell Programming and Scripting

How to exclude top level directory with find?

I'm using bash on cygwin/windows. I'm trying to use find and exclude the directory /cygdrive/c/System\ Volume\ Information. When I try to use the command below I get the error "rm: cannot remove `/cygdrive/c/System Volume Information': Is a directory. Can someone tell me what I am doing... (3 Replies)
Discussion started by: siegfried
3 Replies

3. UNIX for Dummies Questions & Answers

find command to exclude directories

Howdy I have this directory structure ... eep eepaptest eepfatest eepgltest eep.old eeppoptest ehf ehfaptest ehfgltest ehp ehpgltest I want to find files in these directories, but I want to exclude eep, ehf & ehp. Cany anyone help with the correct command ?? (1 Reply)
Discussion started by: SmurfGGM
1 Replies

4. Shell Programming and Scripting

Help - Find command to exclude sub-directories

Hi Forum. I'm trying to write a script that finds and deletes files that are older than 300 days. The script will read a table that contains the following 3 columns: 1st col: “Y” means sub-directory scan; "N" means no subdirectory scan 2nd col: sub-directory location 3rd col: File prefix... (7 Replies)
Discussion started by: pchang
7 Replies

5. Shell Programming and Scripting

Exclude a directory in 'find'

Hi, I'm in the process of writing a shell script which will be ran under cron hourly and will check for files of specific age in my ftp folder, then moves those over inside a folder called "old" (which is within the ftp dir). But, I'm unable to figure out how to exclude the "old" folder when... (1 Reply)
Discussion started by: mutex1
1 Replies

6. Shell Programming and Scripting

SunOS: How to exclude directory in find command?

Hi All, First my OS version is: ksh:0$ uname -a SunOS 5.9 Generic_122300-48 sun4u sparc SUNW,Sun-Fire-V440 I want to exclude the following DIR(./country111) in my search pattern: ksh:0$ find . -name "*.tar" ./country111/COUNTRY_BATCH-801.tar ./country111/COUNTRY_BATCH-802.tar... (3 Replies)
Discussion started by: saps19
3 Replies

7. Shell Programming and Scripting

Find command with exclude

I had a Shell script that removes the files that are in a directory older than the specified days. find /test/files -mtime +10 I would like to add another condition to the find command above that is to exclude any file starting with ‘CGU' Thanks (1 Reply)
Discussion started by: db2dbac
1 Replies

8. UNIX for Dummies Questions & Answers

cmd find: exclude directory when using option -depth

hello, i want to use "-depth" in command "find" and want to exclude a directory. the find command should work in HP-UX and Linux. i see in the find man page: -prune If -depth is not given, true; do not descend the current directory. If -depth is given, false; no effect. -depth... (3 Replies)
Discussion started by: bora99
3 Replies

9. Red Hat

Find command to exclude a specific path

Hi Folks, I want to run the below command and to exclude the specific path like /var/test/support/... . How to achieve using the below command find / -type f \( –perm –4000 –o –perm –2000 \) –print -Siva Please do not use FONT tags inside CODE tags. And, there is usually no reason to... (2 Replies)
Discussion started by: gsiva
2 Replies

10. Shell Programming and Scripting

Exclude directories in FIND command

Can you please help tweak the below command to exclude all directories with the name "logs" and "tmp" find . -type f \( ! -name "*.tar*" ! -name "*.bkp*" \) -exec /usr/xpg4/bin/grep -i "user_1" /dev/null {} + >result.out bash-3.2$ uname -a SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v... (9 Replies)
Discussion started by: mohtashims
9 Replies
BND(1)							     BND for Debian GNU/Linux							    BND(1)

NAME
bnd - Create and diagnose OSGi R4 bundles. SYNOPSIS
bnd [general-options] [cmd] [cmd-options] bnd [general-options] <file>.jar bnd [general-options] <file>.bnd DESCRIPTION
The bnd tool helps you create and diagnose OSGi R4 bundles. The key functions are: * Show the manifest and JAR contents of a bundle * Wrap a JAR so that it becomes a bundle * Create a Bundle from a specification and a class path * Verify the validity of the manifest entries GENERAL OPTIONS
-failok Same as the property -failok. The current run will create a JAR file even if there were errors. -exceptions Will print the exception when the software has ran into a bad exception and bails out. Normally only a message is printed. For debugging or diagnostic reasons, the exception stack trace can be very helpful. COMMANDS
print ( -verify | -manifest | -list | - all ) * <file>.jar + The print function will take a list of JAR file and print one or more aspect of the JAF riles. The following aspects can be added. * -verify - Verify the JAR for consistency with the specification The print will exit with an error if the verify fails. * -manifest - Show the manifest * -list - List the entries in the JAR file * -all - Do all (this is the default. "bnd print -verify *.jar" buildx ( -classpath LIST | -eclipse <lt>file> | -noeclipse | -output <file> ) * <file>.bnd + The build function will assemble a bundle from the bnd specification. The default name of the output bundle is the name of the bnd file with a .jar extension. * -classpath - A list of JAR files and/or directories that should be placed on the class path before the calculation starts. * -eclipse - Parse the file as an Eclipse .classpath file, use the information to create an Eclipse's project class path. If this option is used, the default .classpath file is not read * -noeclipse - Do not parse the .classpath file of an Eclipse project. * -output - Override the default output name of the bundle or the directory. If the output is a directory, the name will be derived from the bnd file name. "bnd build -classpath bin -noeclipse -output test.jar xyz.bnd" wrap ( -classpath (<lt>file>(','<lt>file>)*)-output <lt>fileE|dir<gt> | -properties <lt>file> ) * -ignoremanifest? <lt>file>.jar * The wrap command takes an existing JAR file and guesses the manifest headers that will make this JAR useful for an OSGi Service Platform. If the output file is not overridden, the name of the input file is used with a .bar extension. The default bnd file for the header calculation is: Export-Package: * Import-Package: <packages inside the target jar> If the target bundle has a manifest, the headers are merged with the properties. The defaults can be overridden with a specific properties file. * -output - Set the output file or directory * -classpath - Sets the classpath as a comma separated list * -properties - Use a special property file for the manifest calculation. * -ignoremanifest - Do not include the manifest headers from the target bundle "bnd wrap -classpath osgi.jar *.jar" SEE ALSO
<http://www.aqute.biz/Code/Bnd> AUTHOR
Ludovic Claude <ludovic.claude@laposte.net> Damien Raude-Morvan <drazzib@debian.org> bnd-1.50.0 2011-10-25 BND(1)
All times are GMT -4. The time now is 08:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy