#!/usr/bin/perl $list_file = "list2.txt"; $HOME_dir = `echo \$HOME`; $pic_dir = $HOME_dir."/magic/dir/"; $dst_dir = $HOME_dir."/Desktop/tmp/"; #目的路徑 sub test_tmp_dir { } $f_str = "find $pic_dir -type f | sed 's#.*/##' | grep -F -f $list_file"; @f = `$f_str`; test_tmp_dir(); foreach (@f) { $fn = "find $pic_dir -name \"$_\" -exec cp {} $dst_dir \\;"; } $command = "find $pic_dir -type f | wc -l"; $count = `$command`;