Created
April 12, 2017 08:16
-
-
Save Abhinickz/63c023c5ddfedf0453af61c75868c6bd to your computer and use it in GitHub Desktop.
File::Find use with the tabbed format data!!!
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
#!/usr/bin/perl | |
use strict; use warnings; use Data::Dumper; | |
use File::Find; | |
$| = 1; | |
find(\&wanted, './'); | |
sub wanted { | |
my $file_type = `file -bi $_`; | |
chomp($file_type); | |
my ( $mime_type, undef ) = split( /;|\s/, $file_type ); | |
printf ( "%-65s => %-15s\n", $_ , $mime_type ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment