Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] Assistance with find command please Post 302567679 by Condmach on Monday 24th of October 2011 05:22:43 PM
Old 10-24-2011
Question [Solved] Assistance with find command please

Trying to locate files less than xx days old, throughout all directories/subdirectories, but excluding certain types of directories and files.

The directories I want to search all contain the same characteristic (dbdef, pldef, ghdef, etc), and there are subdirectories within that I need to exclude
(all called 'sub'), so my command went something like this:

Code:
find ./*def/ -type d \( -name sub \) -prune -o -type f -mtime -365 | xargs -i ls -l {}

This works, however, I would also like to exclude certain types of files (*.xml and *.dmp), but I cannot work out how to exclude them. I have tried various
methods, but none have worked.

Any help appreciated.

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command assistance

Hi, We currently use the below basic scripts to output details that the business requires for our AIX and Sun servers. I have been asked to produce the same sort of script to be used for our NCR MP-RAS UNIX and OS/2 UNIX servers but am not formilar with these forms of Unix. Would greatly... (0 Replies)
Discussion started by: kmuir
0 Replies

2. UNIX for Advanced & Expert Users

Assistance Needed With Find/Replace in Vi

Hello All I have always had a question about find and replace in Vi. As this uses Vi, sed, and RegEx I never knew how or where to post the question but I thought I would give it a shot here. Say I have a text file filled with the following: Sue, your IP address is 192.168.1.10 which is... (4 Replies)
Discussion started by: NoSalt
4 Replies

3. UNIX for Dummies Questions & Answers

[Solved] weird in find -exec command

i feel weird with this 2 command find /tmp/*test* -user `whoami` -mtime +1 -type f -exec rm -f {}\; find /tmp/*test* -user `whoami` -mtime +1 -type f -exec ls -lrt {}\; the first one return correct which only delete those filename that consist *test* where second command it listed all the... (12 Replies)
Discussion started by: lsy
12 Replies

4. UNIX Desktop Questions & Answers

[SOLVED] find command match pattern

Hello, I would like to ask you, how to match directory names. I need to find only directories, which are created only from numbers and doesn't include any letters. I used command find $AC_WORKDIR/work_archive/test/$dirs_years -maxdepth 1 -name \\* -print If I have dirs like 12... (3 Replies)
Discussion started by: satin1321
3 Replies

5. Shell Programming and Scripting

[Solved] Grep within find command

Platform: AIX 6.1/ksh Question1. I want to grep for the string "CUSTOM_PKMS" in all the files in server except those files with extensions .dbf , .ctl and .dmp I started running the following command but it is taking too long because there are lots of .dbf , .ctl and .dmp files in this... (6 Replies)
Discussion started by: John K
6 Replies

6. Shell Programming and Scripting

[Solved] Find command is not working

Hello Friends, I have a problem about a little script, when i run the following two lines one by one on CLI then they work well: /usr/bin/mkdir `perl -e 'use POSIX qw(strftime); print strftime "%Y-%m-%d",localtime(time() - 30*24*60*60);'` find . -type f -name "fuseesb.log.*" -mtime 30... (5 Replies)
Discussion started by: EAGL€
5 Replies

7. AIX

[Solved] Find command hangs my terminal session

Hello every one. I know little to nothing about AIX. Recently I have been assigned to an AIX project. For some reason or another the find command is hanging the server. Well it does not hand server per say, it just freezes my terminal session. after running find, I waited up to 40 min and... (3 Replies)
Discussion started by: busi386
3 Replies

8. UNIX for Dummies Questions & Answers

Sed/command assistance

Hello all, I need some help and education creating a script. Basically I have a file with a list of numbers.. 2125554444 2124445555 I need to put them into a format that looks like this.... UQ-V8.1,2125554444,hdaudio UQ-V8.1,2124445555,hdaudio Any help would be greatly... (6 Replies)
Discussion started by: jay11789
6 Replies

9. UNIX for Beginners Questions & Answers

Assistance with my one line command to find all inactive kernels

Hello Forum, I'm using the following command to find all inactive kernels installed on my RHEL server: $ rpm -qa | grep '^kernel-' |grep -vE `uname -r` but the result is in two lines: kernel-3.10.0-1062.1.1.el7.x86_64 kernel-3.10.0-1062.el7.x86_64 Is there a one line command I can... (3 Replies)
Discussion started by: greavette
3 Replies

10. Shell Programming and Scripting

Assistance with my Find command to identify last part of a file name and report the name found

Hello Forum, We have two bootstraps of Chef in our environment which are identified by colour: /var/chef/cache/cookbooks/bootstrap_cookbooks_version_green and /var/chef/cache/cookbooks/bootstrap_cookbooks_version_red I'm attempting to identify which version is installed based on the name... (11 Replies)
Discussion started by: greavette
11 Replies
File::Find::Rule::VCS(3pm)				User Contributed Perl Documentation				File::Find::Rule::VCS(3pm)

NAME
File::Find::Rule::VCS - Exclude files/directories for Version Control Systems SYNOPSIS
use File::Find::Rule (); use File::Find::Rule::VCS (); # Find all files smaller than 10k, ignoring version control files my @files = File::Find::Rule->ignore_vcs ->file ->size('<10Ki') ->in( $dir ); DESCRIPTION
Many tools need to be equally useful both on ordinary files, and on code that has been checked out from revision control systems. File::Find::Rule::VCS provides quick and convenient methods to exclude the version control directories of several major Version Control Systems (currently CVS, subversion, and Bazaar). File::Find::Rule::VCS implements methods to ignore the following: CVS Subversion Bazaar In addition, the following version control systems do not create directories in the checkout and do not require the use of any ignore methods SVK Git METHODS
ignore_vcs # Ignore all common version control systems $find->ignore_vcs; # Ignore a specific named version control systems $find->ignore_vcs($name); # Ignore nothing (silent pass-through) $find->ignore_vcs(''); The "ignore_vcs" method excludes the files for a named Version Control System from your File::Find::Rule search. If passed, the name of the version control system is case in-sensitive. Names currently supported are 'cvs', 'svn', 'subversion', 'bzr', and 'bazaar'. As a convenience for high-level APIs, if the VCS name is the defined null string '' then the call will be treated as a nullop. If no params at all are passed, this method will ignore all supported version control systems. If ignoring every version control system, please note that any legitimate directories called "CVS" or files starting with .# will be ignored, which is not always desirable. In widely-distributed code, you instead should try to detect the specific version control system used and call ignore_vcs with the specific name. Passing "undef", or an unsupported name, will throw an exception. ignore_cvs The "ignore_cvs" method excluding all CVS directories from your File::Find::Rule search. It will also exclude all the files left around by CVS after an automated merge that start with '.#' (dot-hash). ignore_rcs The "ignore_rcs" method excluding all RCS directories from your File::Find::Rule search. It will also exclude all the files used by RCS to store the revisions (end with ',v'). ignore_svn The "ignore_svn" method excluding all Subversion (".svn") directories from your File::Find::Rule search. ignore_bzr The "ignore_bzr" method excluding all Bazaar (".bzr") directories from your File::Find::Rule search. ignore_git The "ignore_git" method excluding all Git (".git") directories from your File::Find::Rule search. ignore_hg The "ignore_hg" method excluding all Mercurial/Hg (".hg") directories from your File::Find::Rule search. TO DO
- Add support for other version control systems. - Add other useful VCS-related methods SUPPORT
Bugs should always be submitted via the CPAN bug tracker <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Find-Rule-VCS> For other issues, contact the maintainer AUTHOR
Adam Kennedy <adamk@cpan.org> SEE ALSO
<http://ali.as/>, File::Find::Rule COPYRIGHT
Copyright 2005 - 2010 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.10.1 2010-10-06 File::Find::Rule::VCS(3pm)
All times are GMT -4. The time now is 08:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy