Hi,
I have created a file "-f.txt" or "-f" and now i want to remove this file, I have tried rm -f -f, but you would have understood the problem i am facing. Now please let me know what needs to be done, Also one more question i want to know the difference between Hard Link and Soft Link and... (3 Replies)
Hello,
I am aware of that Find command finds certain files and remove command removes certain files.
However, is there a way to Find certain DIRECTORY and remove that DIRECTORY?
thank you (3 Replies)
Dear Experts,
please can any body help me to explain the below commants in detail what exactly its doing what we mean by -mtime +2 and -exec and rm{};
find /home/data/ab.200* -mtime +2 -exec rm {} \;
Regards,
SHARY (3 Replies)
Im new to this forum and also Unix.
I need help to solve this Directory Clean-up. Im not sure how to do but i wish someone could help me out.
I have to develop a script that can be used to automatically remove files that are not needed. The final script will be developed in two iterations. The... (1 Reply)
Hi Guys,
Can someone help with this.
I have to find out a file name which calls the following sql script "abhishek_to_sdw.sql". In other words it contains a pattern like "abhishek_to_sdw.sql".
I have found out using "find" command that the file abhishek_to_sdw.sql is existing on the... (4 Replies)
Hi!
I'm having trouble usind sed to remove the char ' from within a database's varchar register's sql.
For example, on the following sql:
INSERT INTO patrimonio_municipal.patrimonio_municipal_airc_tmp
Values('|Estação Elevatória|',|16723|,'|Grandes Reparações|',
'|2010-03-26... (3 Replies)
How would i remove rwx permission for group and other users for all hidden files (except . and ..) inside /root using a one line command.
I have tried below command.
# chmod og-rwx /root/.*
but this has removed rwx permission for . and .. files .
As a result
# ls -ld /root
drwx------ 3... (4 Replies)
Hi all,
I have a file which i have to remove some line from it,
the lines that i have to remove from my file is as below:
</new_name></w"s" langue="Fr-fr" version="1.0" encoding="UTF-8" ?> <New_name>
and it is finding at the middle of my file,
is there any command line in linux to do it or do... (10 Replies)
dear all,
i have a data looks like this (i have 3000 columns):
rs123 A T T G C C C C C C A A A A A A A A A A A ...
rs154 T T G C C C C C A A A A A A A A A A T T G ...
rs126 A C C C C C A A A A A A A A A A A A T T G ...
I want to remove all the space after the 2nd column and make the... (2 Replies)
The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :).
set... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT DEBIAN
file::find::rule::extending
File::Find::Rule::Extending(3pm) User Contributed Perl Documentation File::Find::Rule::Extending(3pm)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.12.4 2011-09-19 File::Find::Rule::Extending(3pm)