Skip to content

Instantly share code, notes, and snippets.

@vidul-nikolaev-petrov
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vidul-nikolaev-petrov/da6bbf770371e4d825b1 to your computer and use it in GitHub Desktop.
Save vidul-nikolaev-petrov/da6bbf770371e4d825b1 to your computer and use it in GitHub Desktop.
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