I have a text file that has a list of files with full paths, with each line representing each file. For example, the first line from the file is:
All the files share the same path up to the "data4" part (i.e. /mnt/data/data4). All I'm trying to do is to move each of these files to a different drive. So, for example, the above file would be moved to
The "data11" part of the path would be constant and replace "data4" in the existing paths for all files. There are spaces in the text file and file names. In some cases, the part of the target path following /data11 will already exist, but in other cases it will not.
I imagine this can be done in a one liner using
mv but can't quite seem to figure it out. Any suggestions would be most appreciated.