You are not logged in.
having a bit of trouble trying to copy a list of files with full paths into a single directory without preserving the paths.
for example the list is a file called 'list' containing the following:
/foo/bar/1.txt
/bar/2.txt
/bar/foo/3.txt
/foo/bar/foooo/baaar/4.txtand i want to copy all the txt files into a single directory called 'directory' like this:
./directory/1.txt
./directory/2.txt
./directory/3.txt
./directory/4.txtive managed to copy all the files into the directory using this command:
rsync -v --files-from=list / ./directoryBUT they are copied with full paths which i dont want:
./directory/foo/bar/1.txt
./directory/bar/2.txt
./directory/bar/foo/3.txt
./directory/foo/bar/foooo/baaar/4.txti know its probably stupidly simple but ive searched and failed thus far.
the real 'list' contains ALOT of paths hence wanting to automate this mass copy.
any help would be appreciated
Last edited by jonno2002 (2020-01-18 11:58:06)
Offline
rsync -v --dry-run /first/file /second/file /more/files.... /target/dirOffline
figured it out:
rsync -v --files-from=list --no-relative / ./directoryadding the --no-relative did the trick, feel like a moron, sorry for this waste of a thread, please close/bin/delete
Offline