In software engineering and computer science, clobbering a file, processor register or a region of computer memory is the process of overwriting its contents completely, whether intentionally or unintentionally, or to indicate that such an action will likely occur.
[2]Memory or file overwrites in POSIX systems, as well as in shells such as Bash, often happen unintentionally - such as using the > redirection operator.
Therefore, to prevent unintentional clobbering, various means can be used - for example, setting the shell parameter set -o noclobber (bash, ksh) or set noclobber (csh, tcsh) will prevent > from clobbering by making it issue an error message instead:[3] The default behavior of the mv and cp commands is to clobber their destination file if it already exists.
This behavior may be overridden by invoking or aliasing the commands with the -i switch, causing the commands to prompt the user before overwriting the destination file, or -n to not transfer source files with a naming conflict.
In makefiles, a common target clobber means complete cleanup of all unnecessary files and directories produced by previous invocations of the make command.