I have two Directories:/routea/path/to/dir1/routeb/path/to/dir2in dir1 I have some files:file.namefile.name.1file.name.2file.name.3(There may be more than the 4 files).I need to move the files ending 1-3 to dir2I tried (what I assumed was the obvious step) of:mv /routea/path/to/dir1/file.name.* /routeb/path/to/dir2/But that just tells me mv: cannot stat `/routea/path/to/dir1/file.name.*': No such file or directoryTo complicate matters, ideally I would like to add a timestamp to the end of each file as I move them, so I end up with something like file.name.1.yyyymmddhhmmss can anyone point me in the right direction please. I assume I'll need to use some form of a loop to do this, but can't see how.
Moving certain files to new location (and appending the datettime)
debian;mv
find dir1/ -name file.name.[1-3] -exec bash -c 'mv {} dir2/$(basename {}).$(date +%Y%m%d%H%M%S)' \;