# parse CLI arguments
$opt_l = $opt_i = $opt_t = $opt_s = $opt_a = $opt_r = $opt_d = $opt_n = 0;
$opt_L = $opt_N = $opt_c = $opt_u = $opt_S = $opt_R = $opt_z = $opt_h = 0;
-$opt_U = 0;
+$opt_U = $opt_x = 0;
${'opt_*'} = ${'opt_?'} = 0;
$opt_m = $opt_f = $opt_F = $opt_D = '';
-&usage if !getopts('hdnlLNitcuarsUSRz*?m:f:D:F:') || $opt_h;
+&usage if !getopts('hdnlLNitcuarsxUSRz*?m:f:D:F:') || $opt_h;
$opt_z = 1 unless $opt_R;
$opt_l = 1 if $0 eq 'll';
$opt_l = $opt_i = $opt_a = $opt_S = 1 if $0 eq 'lll';
# traverse real subdirs
if (-d $f and not -l $f) {
$f =~ s:/*$:/:;
+ # skip other file systems on -x
+ if ($opt_x) {
+ my @pd = stat(dirname($f));
+ my @sd = stat($f);
+ next if $pd[0] ne $sd[0];
+ }
collect(getfiles($f));
}
sub usage {
- my $opts = '[-lastcuidnrzLRNS*] [-f format] [-D X:Y]';
+ my $opts = '[-lastcuidnrzLRxNS*] [-f format] [-D X:Y]';
if ($0 ne 'lf') {
print "usage: $0 $opts [-F regexp] [file...]\n";
}
-z squeeze size field (slows down output)
-L derefernce symbolic links
-R recursive into subdirs
+ -x do not cross filesystem boundaries with -R
-F find files matching case insensitive regexp
-N show only normal (regular) files
-S print statistics summary at end