I need to move all my pdf files from one folder to another folder. How can I do this in terminal?
Asked
Active
Viewed 2,985 times
2 Answers
3
To move all pdf's from a single folder to another folder:
mv *.pdf /some/other/folder
To move all pdf's from multiple folders to another folder
find /home/user -name '*.pdf' -exec mv -t /some/other/folder {} +
More information on find and mv can be found from man:
man find
man mv
Glenn Bell
- 61
1
If you must use mv, use it with find and xargs. Read man mv. Read man find. Read man xargs.
find . -type f -iname '*.pdf' -print0 | xargs -0 echo mv --target-directory=/somehwere/else/
Remove the echo when you're happy with the results.
waltinator
- 36,399