cp overwrite


cp overwrite

cp overwrites files / directories in Linux/Unix.


Regular cp ususally overwrites destination files and directories:

$ cp test.c bak


To add interactive prompt before overwrite use -i option and press 'y' to overwite:

$ cp -i test.c bak
cp: overwrite 'bak/test.c'? y


To avoid overwrite use -n option:

$ cp -n test.c bak


To always overwrite without prompt:

$ \cp test.c bak



See also

© 2017 CalculatorX. All rights reserved.