Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Answers to Frequently Asked Questions advanced/complex uses of the find command Post 50871 by Perderabo on Tuesday 4th of May 2004 01:13:13 PM
Old 05-04-2004
advanced/complex uses of the find command

Perhaps the number one advanced find question is:

How to stop find from descending into subdirectories?
find command
Performing a non-recursive find in Unix
Use -prune with find command on AIX
Searching for files over 30 days old in current directory
disk space used for files with in a directory structure.
Question: non-recursive find syntax

Another important concept is using find in conjunction with xargs when dealing with a large number of files.
Too many files to list / remove
grep command-HELP?!
+ instead of ;

For more precise control over files found via a timestamp, use find in conjuction with touch as mentioned in:
files between any two given dates
no [find -mmin -1]
find command using -mmin param
a find script


And I thought that I'd link in other cool examples involving find...

The trouble with FIND .......
Cp All But Some Files, paramater for cp command?
/ is full

Finally, from the USENET Unix FAQS, see: Why doesn't find's "{}" symbol do what I want?

Last edited by Perderabo; 08-22-2005 at 11:23 AM..
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Complex find grep or sed command

Haven't worked in bash for ages. did a good bit of shell scripting in regular sh, but have forgotten most of it. I have several thousand php files that now include the following line at the end of the file. There is no LF or CR/LF before it begins, it is just concatenated to the final line of... (3 Replies)
Discussion started by: sjburden
3 Replies

2. Shell Programming and Scripting

complex find in script

How to I put my find command string into a script. It is currently to long to be entered manually at command line. for FNAME in `find /unixsxxx/interface/x.x/xxxxxx -type f \( -name '*.KSH' -o -name '*.sh' -o -name '*.sql' -o -name '*.ksh' \) -exec grep -il xxx.xxx.xxx.xxx {} \;`; do C=`grep -c... (5 Replies)
Discussion started by: TimHortons
5 Replies

3. Shell Programming and Scripting

pls help! complex find and replace

help pls... i would like to change this CURVE2 565489 789458 1258649 random data here... CURVE2 565489 568795 6548921 random data here... CURVE2 565489 123598 6446259 random data here... CURVE2 565489 672956 2489657 into this CURVE2 565489 586423 1258649 random data here...... (2 Replies)
Discussion started by: lakanino
2 Replies

4. UNIX for Advanced & Expert Users

complex find command

Hi all, I am trying to execute the following command: find 'path' -ls -exec cksum {} \; As you can see this simply finds files from a given path and runs cksum on them. My problem is this, if i have a FIFO in a directory the find tries to execute cksum on it and gets stuck. From the man page i... (9 Replies)
Discussion started by: noam128
9 Replies

5. Shell Programming and Scripting

find command with complex logic

I'm looking to write a script that will do a find of directories and delete them if they are older than x days but keep the last x # of folders even if they are older than x days. The usage is for a deployment location, so we want to keep the location clean but retain maybe the last 2 builds that... (5 Replies)
Discussion started by: MaureenT
5 Replies

6. UNIX for Advanced & Expert Users

Help with complex find syntax

I need to modify the find command below to exclude the output of the directory /usr/UDPM/PerfMgmt/shmlck find / \( -fstype ctfs -o -fstype mntfs -o -fstype objfs -o -fstype proc -o ! local \) -prune -o -type f -perm -0002 -print 2>/dev/null I have tried many iterations and placement of... (2 Replies)
Discussion started by: interesting?
2 Replies

7. Shell Programming and Scripting

Complex find and replace only 1st instance string with dynamic combination

test.txt is the dynamic file but some of combination are fix like below are the lines ;wonder_off = ;wonder_off = disabled wonder_off = wonder_off = disabled the test.txt can content them in any order #cat test.xt ;wonder_off = ;wonder_off = disabled wonder_off = wonder_off =... (5 Replies)
Discussion started by: SilvesterJ
5 Replies

8. Shell Programming and Scripting

Complex grep command

Hallo Team, I need your help and its rather urgent. I have a file with thousands of lines. Here is a sample below: Sample1.txt BW235045560121114833444044@196.35.130.5 BW235106757121114-574455394@196.35.130.5 BW2349514941211141077771352@196.35.130.5... (5 Replies)
Discussion started by: kekanap
5 Replies
URI::URL(3)						User Contributed Perl Documentation					       URI::URL(3)

NAME
URI::URL - Uniform Resource Locators SYNOPSIS
$u1 = URI::URL->new($str, $base); $u2 = $u1->abs; DESCRIPTION
This module is provided for backwards compatibility with modules that depend on the interface provided by the "URI::URL" class that used to be distributed with the libwww-perl library. The following differences exist compared to the "URI" class interface: o The URI::URL module exports the url() function as an alternate constructor interface. o The constructor takes an optional $base argument. The "URI::URL" class is a subclass of "URI::WithBase". o The URI::URL->newlocal class method is the same as URI::file->new_abs. o URI::URL::strict(1) o $url->print_on method o $url->crack method o $url->full_path: same as ($uri->abs_path || "/") o $url->netloc: same as $uri->authority o $url->epath, $url->equery: same as $uri->path, $uri->query o $url->path and $url->query pass unescaped strings. o $url->path_components: same as $uri->path_segments (if you don't consider path segment parameters) o $url->params and $url->eparams methods o $url->base method. See URI::WithBase. o $url->abs and $url->rel have an optional $base argument. See URI::WithBase. o $url->frag: same as $uri->fragment o $url->keywords: same as $uri->query_keywords o $url->localpath and friends map to $uri->file. o $url->address and $url->encoded822addr: same as $uri->to for mailto URI o $url->groupart method for news URI o $url->article: same as $uri->message SEE ALSO
URI, URI::WithBase COPYRIGHT
Copyright 1998-2000 Gisle Aas. perl v5.16.2 2012-02-11 URI::URL(3)
All times are GMT -4. The time now is 11:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy