bash: -bash: output: cannot overwrite existing file
In Bash shell, redirecting output to a existing file is not possible if the "noclobber" bash option is set.
To overcome this, use the ">|" or ">>" redirect operator. The pipe will overwrite the file if you are using single angle bracket and append if you're using double angle brackets.
How to forcely overwrite a file with output from a command:
Code:
# cat output
# echo 'output' >output
-bash: output: cannot overwrite existing file
# echo 'output' >|output
# cat output
output
!!! Caution: using the ">|" operator can potentially overwrite important system/configuration files !!!