Copying files from the terminal with confirmation message before copying each file
Solution 1:
You could implement something with the find
command's -ok
predicate:
-ok command ; Like -exec but ask the user first. If the user agrees, run the command. Otherwise just return false. If the command is run, its standard input is redirected from /dev/null.
So for example
$ find . -maxdepth 1 -mindepth 1 -name '*.jpg' -ok cp -t ../newdir {} \;
< cp ... ./aaa.jpg > ? y
< cp ... ./aaa-small.jpg > ? n
< cp ... ./bbb.jpg > ? n
< cp ... ./ccc-small.jpg > ? y
< cp ... ./ccc.jpg > ? y
< cp ... ./bbb-small.jpg > ? n
$ ls ../newdir
aaa.jpg ccc.jpg ccc-small.jpg