I often need to selectively archive a long list of files using cp -iar, or similar, and to speed up the process I would like to press just one key instead of y or n followed by ENTER on every file. In other words I want to avoid having to press ENTER as well as y or n. Of course I would happily use different keys instead of y or n.Is there a way to do this?
Can I avoid enter key in cp -i?
command line;cp
I think that what you need is a file manager, like midnight commander. In mc you can select several files with insert or + and realize operations on them, like deleting, moving or copying. A full set of instructions and tips can be found in the Tutorial.If you give it a try to pure shell commands (no gui), suppose you have file0 to file10 but wants to copy only file1 and file3:cp file1 file3 directory/Of course, you can use the shell to help yourself:cp file{1,3} directory/but what about consecutive ones? file5 through file10?cp file{5..10} directory/You can also use find to help, if you want something more advanced, for example:find Downloads -name *.cfg -exec cp {} directory \;will do this:copy Downloads/file(6).cfg to directorycopy Downloads/file(7).cfg to directorycopy Downloads/file(1).cfg to directorycopy Downloads/file.cfg to directorycopy Downloads/file(2).cfg to directorycopy Downloads/file(4).cfg to directorycopy Downloads/file(3).cfg to directorycopy Downloads/file(5).cfg to directoryyou can verify the files to be copied removing the -exec ... part. You can also use -exec echo cp ... in case you want to know what find will do.