#!/usr/bin/perl -w use strict; use warnings; use File::Basename; my $path = "/usr/bin/*"; my $files = basename($path); my $dir = dirname($path); print "dir is $dir , files is $files\n"; system "whatis $path";