1
2
3
4
5
6
/raid5/Serien/Dokumentation/Aidskrieg/2011-12-01.07.58.89-0.rec
/raid5/Serien/Dokumentation/Berlin_1945_-_?berleben_im_Bunker/2009-09-07.16.13.50.99.rec
/raid5/Serien/Dokumentation/Berlin_1945_-_?berleben_im_Bunker/2009-07-31.10.33.50.99.rec
/raid5/Serien/Dokumentation/Berlin_1945_-_?berleben_im_Bunker/2009-07-30.22.58.50.99.rec
/raid5/Serien/Dokumentation/Countdown_in_den_Tod:_9~11/2011-09-11.02.13.50.99.rec
/raid5/Serien/Dokumentation/Countdown_zur_Katastrophe/2012-09-21.02.23.41-0.rec
1
2
3
4
5
6
7
8
9
10
11
12
13
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2012-04-05.02.53.42-0.rec/index
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2012-04-05.02.53.42-0.rec/info
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2012-04-05.02.53.42-0.rec/resume
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2012-07-26.02.53.43-0.rec
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2012-07-26.02.53.43-0.rec/00001.ts
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2012-07-26.02.53.43-0.rec/index
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2012-07-26.02.53.43-0.rec/info
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2012-07-26.02.53.43-0.rec/resume
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2011-05-06.22.53.50.99.rec
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2011-05-06.22.53.50.99.rec/resume.vdr
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2011-05-06.22.53.50.99.rec/index.vdr
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2011-05-06.22.53.50.99.rec/info.vdr
/raid5/Serien/Dokumentation/Prisson_Break/Prison_Breaks_-_Die_wahren_Geschichten/2011-05-06.22.53.50.99.rec/001.vdr
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/perl -w
use strict;
use File::Find;
my $MeinVerzeichnis = "/raid5";
my $MeinDateiNamePattern = ".rec";
sub match {print "$_\n" if /$MeinDateiNamePattern/}
find {wanted => \&match, no_chdir => 1}, $MeinVerzeichnis;
my $MeinDateiNamePattern = qr/.rec/;
1
2
3
4
5
/raid5/Serien/Dokumentation/Verrückte_Maschinen_mit_Adam_und_Jamie/2013-04-08.20.13.50.99.rec
/raid5/Serien/Dokumentation/Verrückte_Maschinen_mit_Adam_und_Jamie/2013-04-08.20.13.50.99.rec/001.vdr
/raid5/Serien/Dokumentation/Verrückte_Maschinen_mit_Adam_und_Jamie/2013-04-08.20.13.50.99.rec/index.vdr
/raid5/Serien/Dokumentation/Verrückte_Maschinen_mit_Adam_und_Jamie/2013-04-08.20.13.50.99.rec/info.vdr
/raid5/Serien/Dokumentation/Verrückte_Maschinen_mit_Adam_und_Jamie/2013-04-08.20.13.50.99.rec/resume.vdr
\.rec$
sub match { print "$_\n" if -f && /$MeinDateiNamePattern/ }
1
2
3
4
/raid5/Serien/Dokumentation/Mega-Fabriken/2013-11-25.20.13.50.99.rec/001.vdr
/raid5/Serien/Dokumentation/Mega-Fabriken/2013-11-25.20.13.50.99.rec/index.vdr
/raid5/Serien/Dokumentation/Mega-Fabriken/2013-11-25.20.13.50.99.rec/info.vdr
/raid5/Serien/Dokumentation/Mega-Fabriken/2013-11-25.20.13.50.99.rec/resume.vdr
/raid5/Serien/Dokumentation/Mega-Fabriken/2013-11-25.20.13.50.99.rec
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#! /usr/bin/perl use strict; use warnings; use 5.010; use File::Find::Rule; my @dirs = File::Find::Rule->directory() # finde Verzeichnisse ->name("*.rec") # die diesem Namensmuster entsprechen ->in(".") # in dem genannten Verzeichnis ; # zeige die Treffer say $_ for @dirs;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$ find2perl . -type d -name "*.rec"
#! /opt/local/perl/bin/perl -w
eval 'exec /opt/local/perl/bin/perl -S $0 ${1+"$@"}'
if 0; #$running_under_some_shell
use strict;
use File::Find ();
# Set the variable $File::Find::dont_use_nlink if you're using AFS,
# since AFS cheats.
# for the convenience of &wanted calls, including -eval statements:
use vars qw/*name *dir *prune/;
*name = *File::Find::name;
*dir = *File::Find::dir;
*prune = *File::Find::prune;
sub wanted;
# Traverse desired filesystems
File::Find::find({wanted => \&wanted}, '.');
exit;
sub wanted {
my ($dev,$ino,$mode,$nlink,$uid,$gid);
(($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
-d _ &&
/^.*\.rec\z/s
&& print("$name\n");
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#! /usr/bin/perl use strict; use warnings; use 5.010; use File::Find; my $basedir = "."; my $extension = ".rec"; my @matched_dirs; sub wanted { # $File::Find::dir is the current directory name, # $_ is the current filename within that directory # $File::Find::name is the complete pathname to the file. push @matched_dirs, $File::Find::name if -d $_ && $_ =~ m/\Q$extension\E$/; } find( \&wanted, $basedir ); say "I have found:"; say $_ for @matched_dirs;