Sponsored Content
Top Forums Shell Programming and Scripting Running find in all directories except one Post 302464135 by DGPickett on Tuesday 19th of October 2010 11:06:31 AM
Old 10-19-2010
FIND

Code:
-path pattern
File name matches shell pattern pattern. The metacharacters do not treat `/' or `.' specially; so, for example, 
find . -path './sr*sc' 
will print an entry for a directory called './src/misc' (if one exists). To ignore a whole directory tree, use -prune rather than checking every file in the tree. For example, to skip the directory `src/emacs' and all files and directories under it, and print the names of the other files found, do something like this: 
find . -path './src/emacs' -prune -o -print



---------- Post updated at 11:06 AM ---------- Previous update was at 11:05 AM ----------

If you like delving into complex options in the find man page! Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find files in Directories

Hello, We have in a file a list of the path of files from one server. We want to search if these files exist on another server , but the path on this new server isn't the same. We want to use the command "awk" but there isn't the god way. Example: on server 1 in a file : listServer1.txt... (4 Replies)
Discussion started by: steiner
4 Replies

2. Shell Programming and Scripting

Find but exclude directories

Hello, I have a line in my script to find the files changed in the last 24 hours. It is as below: find /home/hary -type f -mtime -1 I now want to exclude a directory named "/home/hary/temp/cache" from the above find command. How do I add it to my script? Any help is appreciated. ... (9 Replies)
Discussion started by: tadi18
9 Replies

3. Shell Programming and Scripting

running a script in different directories

hi, I have a peculiar problem I am working in bash shell There is one particular directory in my unix box For the scripts present in that directory, if i put sh <script name> it is working fine if i put ksh <script name> the corresponding script is not even executing but apart from that... (3 Replies)
Discussion started by: trichyselva
3 Replies

4. Shell Programming and Scripting

find directories

I am looking a script which will find garbase directories (10 char. long)..which need to delete empty dir excluding symlink and system directories. I tried this partial script but it just find directories create a file which contains link directories..can somebody help me to complete this... (4 Replies)
Discussion started by: ddk2oo5
4 Replies

5. Shell Programming and Scripting

Find Directories That Do Not Contain A Certain File

I'm having problems figuring out the process to find directories that DO NOT contain a certain file. I have a mp3 collection that all the album art is name "folder.jpg". Not all the albums have images. I need a way to find the albums/directories that do not contain "folder.jpg". I can find the... (2 Replies)
Discussion started by: subsonic
2 Replies

6. Shell Programming and Scripting

How to find 777 permisson is there or not for Directories and sub-directories

Hi All, I am Oracle Apps Tech guy, I have a requirement to find 777 permission is there or not for all Folders and Sub-folders Under APPL_TOP (Folder/directory) with below conditions i) the directory names should start with xx..... (like xxau,xxcfi,xxcca...etc) and exclude the directory... (11 Replies)
Discussion started by: gagan4599
11 Replies

7. Shell Programming and Scripting

Find directories with same name and rename them

Hello Im trying to make a script in bash shell programming to find subdirectories with the same name into the same directory and rename one of them!! Could you please help me? Thanks in advance (1 Reply)
Discussion started by: BTKBaaMMM
1 Replies

8. Shell Programming and Scripting

Automate the process of running jobs on several directories consecutively

Hi, I have about 10 directories in which I run the same code. But this code is only run in a directory when the computation in the previous directory was successful (explained below). My directories are named as : VF_50, VF_100, VF_150, VF_200............. As you can see the number after _... (6 Replies)
Discussion started by: lost.identity
6 Replies

9. 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

10. Shell Programming and Scripting

Running program and output files in specific directories

I have been running a program mseed2sac using the following command cd IV find . -type f -exec /swadmin/mseed2sac '{}' \; The problem is that I end up with a lot of files in directory IV. Instead I would like to select the designator HHZ, create a directory IV.SAC and all the files output... (11 Replies)
Discussion started by: kristinu
11 Replies
Tree::Simple::Visitor::FindByPath(3pm)			User Contributed Perl Documentation		    Tree::Simple::Visitor::FindByPath(3pm)

NAME
Tree::Simple::Visitor::FindByPath - A Visitor for finding an element in a Tree::Simple hierarchy with a path SYNOPSIS
use Tree::Simple::Visitor::FindByPath; # create a visitor object my $visitor = Tree::Simple::Visitor::FindByPath->new(); # set the search path for our tree $visitor->setSearchPath(qw(1 1.2 1.2.2)); # pass the visitor to a tree $tree->accept($visitor); # fetch the result, which will # be the Tree::Simple object that # we have found, or undefined my $result = $visitor->getResult() || die "No Tree found"; # our result's node value should match # the last element in our path print $result->getNodeValue(); # this should print 1.2.2 DESCRIPTION
Given a path and Tree::Simple hierarchy, this Visitor will attempt to find the node specified by the path. METHODS
new There are no arguments to the constructor the object will be in its default state. You can use the "setSearchPath" and "setNodeFilter" methods to customize its behavior. includeTrunk ($boolean) Based upon the value of $boolean, this will tell the visitor to include the trunk of the tree in the search as well. setSearchPath (@path) This is the path we will attempt to follow down the tree. We will do a stringified comparison of each element of the path and the current tree's node (or the value returned by the node filter if it is set). setNodeFilter ($filter_function) This method accepts a CODE reference as its $filter_function argument and throws an exception if it is not a code reference. This code reference is used to filter the tree nodes as they are collected. This can be used to customize output, or to gather specific information from a more complex tree node. The filter function should accept a single argument, which is the current Tree::Simple object. visit ($tree) This is the method that is used by Tree::Simple's "accept" method. It can also be used on its own, it requires the $tree argument to be a Tree::Simple object (or derived from a Tree::Simple object), and will throw and exception otherwise. getResult This method will return the tree found at the specified path (set by the "setSearchPath" method) or "undef" if no tree is found. getResults This method will return the tree's that make up the path specified in "setSearchPath". In the case of a failed search, this can be used to find the elements which did successfully match along the way. BUGS
None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it. CODE COVERAGE
See the CODE COVERAGE section in Tree::Simple::VisitorFactory for more inforamtion. SEE ALSO
These Visitor classes are all subclasses of Tree::Simple::Visitor, which can be found in the Tree::Simple module, you should refer to that module for more information. AUTHOR
stevan little, <stevan@iinteractive.com> COPYRIGHT AND LICENSE
Copyright 2004, 2005 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2005-10-24 Tree::Simple::Visitor::FindByPath(3pm)
All times are GMT -4. The time now is 10:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy