I'm using cygwin32 on Windows.
DN is an environment variable pointed at my download directory.
This command works to move the single most recent file in my download directory to my current directory:
mv "`perl -e '$p = $ARGV[0]; opendir $h, $p or die "cannot opendir $p: $!"; @f = sort { -M $a <=> -M $b } map { "$p/$_" } readdir $h; closedir $h;@f=grep(!/\\.$/,@f); foreach $a (@f){$a=~s/\\\\/\\//g;$a=lcfirst $a;$a=~s@^(.):@/cygdrive/$1@;} $" = "\\n";print "@f[0..0]\\n"; ' $DN`" .
Can someone help me modify this so it moves the top "n" (eg: 6 or 20 or...) most recent files from the download directory to the current directory?
thanks
Siegfried