Posted By

brm on 06/16/15


Tagged

sysadmin perl1liner


Versions (?)

Find file with same name in parent directory


 / Published in: Bash
 

Perl 1 liner to find file with same name as it parent directory

  1. #!/bin/sh
  2.  
  3. perl -MFile::Find -le 'find(\&w,".");while(($n, $p)=each % file){if(@{$p}>1){print join(" ",@{$p})}} sub w{[email protected]{$file{$_}},$file::Find::Name;}'

Report this snippet  

You need to login to post a comment.