09-15-2008
to search the current directory only
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am using the find command to remove all the files in a directory ending .NEW and created more than a day ago.
The command I am using is:
find . -name '*.NEW' -ctime +1 | xargs rm
The problem is that it does not work properly. I still have files which were craeted more than a day... (7 Replies)
Discussion started by: nattynatty
7 Replies
2. UNIX for Advanced & Expert Users
when i use the following command
find / -name '*.*' -exec grep -il 'text' {} \;
I can redirect the errors to /dev/null. This happens only in ksh but not in csh. the 2>/dev/null is not working in csh. Can you some one suggest an alternative for this in csh ? (3 Replies)
Discussion started by: dhanamurthy
3 Replies
3. UNIX for Dummies Questions & Answers
All,
Please find the below comand . I am trying to list the file that has not been accesed is past 14 days . But when you look at the display the directory "crecv1" which has date as today is displayed .. Why it is happening .
I send this code instead of ls -ltr as rm -f -r in production... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies
4. Shell Programming and Scripting
Hi
I'm working on solaris and I'm trying to run a script. The part listed here does not work properly, the result of the find command is not in the output
file /tmp/result
(I've checked the find command , executing the shell with sh -x , it seems correct). It seems like I've lost the standard... (4 Replies)
Discussion started by: frenchwill
4 Replies
5. Shell Programming and Scripting
I'm trying to display the full file name (including the full path) and file size of all files whose name (excluding the path) is longer than 10 characters.
I came up with find path -type f -name ".{10, }" -printf "%s %p\n", but I'm getting a "find: path: No such file or directory". What's wrong... (2 Replies)
Discussion started by: raidkridley
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I am triying to make sure that there exists only one file with the pattern abc* in path /path/. This directory is having many huge files. If there is only one file then I have to take its complete name only to use furter in my script.
I am planning to do like this:
if ; then... (2 Replies)
Discussion started by: new_learner
2 Replies
7. Shell Programming and Scripting
Hello Friends,
When i give the command from path from path /var/tmp/asirohi/jdk/docs:-
find /var/tmp/asirohi/jdk/docs/ . -depth -name license_*.html
I get the following output:-
/var/tmp/asirohi/jdk/docs/zh_Hant/jre/license_zh_Hant.html... (3 Replies)
Discussion started by: asirohi
3 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have a script below,which reads dates from No_weekandMonthend_dates.txt performs the copy operation.
for i in `cat /tmp/No_weekandMonthend_dates.txt`
do
cd $Gerenimopath/ZH_LP
find . -type f -name "$i_*.txt" -exec cp {} /home/gaddamja/TempLocal \;
cd... (2 Replies)
Discussion started by: jagadish_gaddam
2 Replies
9. Shell Programming and Scripting
I am facing problem in find command. I want to read all file names of a directory and write those names in a text file. My script is
find /home/Pratik/src -type f -exec basename {} \; >> names.txt
The script is working fine and writing all the file names but problem is file names are not... (5 Replies)
Discussion started by: pratikjain998
5 Replies
10. UNIX and Linux Applications
Hi All,
I want to search only files more than 60 min in particular directory but not in sub directories.
with this command i am getting even sub directires also.Please and let me know how to get the files.
$i=`find /home/n1013141/vijay -type f -mmin -60`;
print $i;
... (6 Replies)
Discussion started by: bhas1285
6 Replies
LEARN ABOUT MOJAVE
file::find::rule::extending
File::Find::Rule::Extending(3) User Contributed Perl Documentation File::Find::Rule::Extending(3)
NAME
File::Find::Rule::Extending - the mini-guide to extending File::Find::Rule
SYNOPSIS
package File::Find::Rule::Random;
use strict;
# take useful things from File::Find::Rule
use base 'File::Find::Rule';
# and force our crack into the main namespace
sub File::Find::Rule::random () {
my $self = shift()->_force_object;
$self->exec( sub { rand > 0.5 } );
}
1;
DESCRIPTION
File::Find::Rule went down so well with the buying public that everyone wanted to add extra features. With the 0.07 release this became a
possibility, using the following conventions.
Declare your package
package File::Find::Rule::Random;
use strict;
Inherit methods from File::Find::Rule
# take useful things from File::Find::Rule
use base 'File::Find::Rule';
Force your madness into the main package
# and force our crack into the main namespace
sub File::Find::Rule::random () {
my $self = shift()->_force_object;
$self->exec( sub { rand > 0.5 } );
}
Yes, we're being very cavalier here and defining things into the main File::Find::Rule namespace. This is due to lack of imaginiation on
my part - I simply can't find a way for the functional and oo interface to work without doing this or some kind of inheritance, and
inheritance stops you using two File::Find::Rule::Foo modules together.
For this reason try and pick distinct names for your extensions. If this becomes a problem then I may institute a semi-official registry
of taken names.
Taking no arguments.
Note the null prototype on random. This is a cheat for the procedural interface to know that your sub takes no arguments, and so allows
this to happen:
find( random => in => '.' );
If you hadn't declared "random" with a null prototype it would have consumed "in" as a parameter to it, then got all confused as it doesn't
know about a '.' rule.
AUTHOR
Richard Clamp <richardc@unixbeard.net>
COPYRIGHT
Copyright (C) 2002 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
File::Find::Rule
File::Find::Rule::MMagic was the first extension module, so maybe check that out.
perl v5.18.2 2011-09-19 File::Find::Rule::Extending(3)