Last active
August 29, 2015 14:15
-
-
Save vidul-nikolaev-petrov/da6bbf770371e4d825b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use File::Basename; | |
list_direcrory(shift, 1); | |
sub list_direcrory { | |
my ($root, $c) = @_; | |
for my $f (glob "$root/*"){ | |
my $bn = basename($f); | |
if (-d $f and !-l $f) { | |
print "D", $c, " " x $c, $bn, "\n"; | |
list_direcrory($f, $c + 1); | |
} | |
else { | |
print "L", $c, " " x $c, $bn, "\n"; | |
} | |
} | |
} | |
__END__ | |
quick & dirty script; in conjunction with `grep`: | |
./list_direcrory.pl . | grep tests.py$ | grep ^L3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment