command line file management
I'm trying to get a series of jpgs scattered throughout a certain directory tree to all go into one directory or tar file.
But one basic problem I've had is that the recursive option (-R) on both ls and cp don't seem to like the wildcard. i.e. ls -R *jpg gives me an error, when it doesn't if there's no recursive option.
I'd also like to know how to list out files ina directory with the path on the left and the file name on the right. Then I could do an xargs cp with it so the whole problem could be dealt with like so:
ls -aR|grep *jpg|xargs cp --target-directory=/mytargetdir
Though it a common task, so maybe somebody has already done it.