Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Find command and use of wildcards Post 302930786 by crimso on Wednesday 7th of January 2015 10:48:09 AM
Old 01-07-2015
Find command and use of wildcards

greetings,

below is the find command i am using for some filesystem maintenance:

Code:
find /data/Engine \( -type d -name .snapshot -prune -o -type d -wholename "/data/Engine/*/CAE" \
   -prune -o -type d -wholename "/data/Engine/*/CAD" -prune -o -name ".*.case" \)\ 
   -mtime +365 -print0 -fls /data/Engine/deleted_files_$DATE.txt -exec rm -f '{}' \;

as you can see i have a couple of directories i wish to exclude. it works but just a little too good. under /data/Engine are the dirs 0000, 0001, 0002, etc. i DO want to exclude the CAE and CAD dirs directly under /data/Engine/0000|0001|0002 but that's it. for example /data/Engine/0000/CAE and /data/Engine/0000/CAD are to be pruned but not /data/Engine/0000/CFD/CAD. can someone please share with me how to get the asterisk wildcard to act only on the CAD and CAE directories directly under /data/Engine/0000, etc?

hope this made sense, thanks.

Last edited by rbatte1; 01-07-2015 at 01:17 PM.. Reason: Splitting code line to make it more readable
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

command find returned bash: /usr/bin/find: Argument list too long

Hello, I create a file touch 1201093003 fichcomp and inside a repertory (which hava a lot of files) I want to list all files created before this file : find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long but i make a filter all... (1 Reply)
Discussion started by: yacsil
1 Replies

2. Shell Programming and Scripting

using wildcards in this perl command

Hi there, is it possible to use wild cards in this statement ssh $remote_server 'perl -pi -e "s,EXP_SERIAL_19b8be67=\"\",EXP_SERIAL_`hostid`=\"UNKNOWN\"," /var/myfile' This command works fine but the bit in bold (the 8 character hostid) will not always be 19b8be67 so I was hoping I could... (2 Replies)
Discussion started by: hcclnoodles
2 Replies

3. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

4. UNIX for Dummies Questions & Answers

how to find a file named vijay in a directory using find command

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)
Discussion started by: amirthraj_12
6 Replies

5. Shell Programming and Scripting

Find string in list with wildcards

I need to add code to a shell script to find out if a string matches any item in a list, where the list can contain a wildcard character. For example, if I have the following list: ok_versions="03-02-4, 04-01-*" Then I want to compare a particular string to see if it matches any item in... (11 Replies)
Discussion started by: Johan III
11 Replies

6. Linux

Simplified find command to find multiple file types

Hi, I'm using the following command to find the multiple requierd file types and its working fine find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies

7. Homework & Coursework Questions

Need help using find or locate with wildcards

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: List all files in ~c12100 directory beginning with "BOZO" that end with either "123" or "456" 2. Relevant... (3 Replies)
Discussion started by: ScarletRavin
3 Replies

8. UNIX for Dummies Questions & Answers

Help with rm command with wildcards

Hello everyone. My first time posting here. I have a question that may seem very insignificant to some but is one that I've been trying to address for the past several days (haven't had any luck looking online). I'm trying to clean a directory by removing old files that we no longer need.... (2 Replies)
Discussion started by: galileo1
2 Replies

9. Shell Programming and Scripting

Date with Wildcards in Command

I have the following script (parts from help on this forum, thanks y'all): #!/usr/bin/ksh date '+%m %d %Y' | { read MONTH DAY YEAR DAY=`expr "$DAY" - 1` case "$DAY" in 0) MONTH=`expr "$MONTH" - 1` case "$MONTH" in 0) ... (5 Replies)
Discussion started by: he204035
5 Replies

10. UNIX for Dummies Questions & Answers

[Solved] Wildcards used in find, ls and grep commands

Platforms : Solaris 10 and RHEL 5.6 I always get double quotes , single quotes and asteriks mixed up for find, ls and grep commands. The below commands retrieve the correct results. But , unders stress , I get all these mixed up :mad: .So, i wanted to get a clear picture. Please check if... (7 Replies)
Discussion started by: John K
7 Replies
Dancer::Engine(3pm)					User Contributed Perl Documentation				       Dancer::Engine(3pm)

NAME
Dancer::Engine - base class for Dancer engines SYNOPSIS
my $engine = Dancer::Engine->build( Serializer => 'JSON', $configuration ); DESCRIPTION
Dancer has various engines such Serializer engines, Template engines, Logger engines and Session handlers engines. This is the base class for all Dancer engines. If you're writing an engine of a common type (such as those mentioned above), you probably want to simply use their base class, which in turn use Dancer::Engine. For example, Template engines inherit from Dancer::Template::Abstract and Serializer engines inherit from Dancer::Serializer::Abstract. Those Abstract base classes inherit from Dancer::Engine. If a new type of Dancer engine is created, it is best it inherits from this class. ATTRIBUTES
name The name of the engine, such as JSON, or Simple. type The type of the engine, such as Serializer, or Session. METHODS
/SUBROUTINES config Fetches the configuration of the engine. my $configuration = $engine->config; You can only set the configuration at initialization time, not after. build Builds and returns the engine. my $engine = Dancer::Engine->build( $type => $name, $config ); AUTHOR
Alexis Sukrieh LICENSE AND COPYRIGHT
Copyright 2009-2010 Alexis Sukrieh. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. perl v5.14.2 2011-11-30 Dancer::Engine(3pm)
All times are GMT -4. The time now is 03:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy