Originally Posted by
HiImTye
Code:
for f in /path/to/folder1/*.png /path/to/folder2/*.png /path/to/folder3/*.png; do
# cp $f
# mv $f
done
replace the folders with the ones you want. if you want to copy, remove the # before cp; the # before mv for move
helps if I have an out folder, should be
Code:
out="/path/to/folder"
for f in /path/to/folder1/*.png /path/to/folder2/*.png /path/to/folder3/*.png; do
#cp "$f" "$out"
#mv "$f" "$out"
done
for recursive, use something like
Code:
in="/path/to/folder1/
/path/to/folder2/
/path/to/folder3/"
out="/path/to/folder"
while read -r f; do
#cp -R "$f" "$out"
#mv -R "$f" "$out"
done< <(echo -e "$test")
if you're saving them as scripts then set out to "$1" and in to "$2" then execute them as
Code:
scriptName "/path/to/folder anywhere"
#-- or --
scriptName "/path/to/folder anywhere" "/path/to/folder1
/path/to/folder2
/path/to/folder3"
lastly, if you're saving scripts, it's a good idea to make line 1
Bookmarks