I don't know the details, so I'll write a general example while complementing it.
/tmp/spam/
is the current directory, and you want to go to /tmp/eggs/
with the text file (test.txt
) and aaa.JPG, bbb.JPG, ...At this time,
$pwd
/tmp/spam/
$ cat test.txt | xargs-n 1-I%mv%/tmp/eggs
and allow you to move files in each line of a text file to a destination.
In Bash and zsh, $(<filename)
allows you to expand the contents of a text file to the command line.
$mv$(<filelist.txt)/path/to/dest_dir
It can be combined with the sh/bash
for statement.
$for fin'cat filelist.txt`
>do
>mv$f DEST_DIR
> done
© 2024 OneMinuteCode. All rights reserved.