Just in case your next question is going to be how to get the file name or other info. Perl has a good way of parsing (that is independent of operating systems):
perl -ane 'BEGIN { use File::Basename; } {($n,$d,$t)=fileparse(@F); print $d,"\n"}' yourfile
basically
$n is your filename
$d directory
$t is the type