Bypass cp's overwrite question for every file

By xngo on June 23, 2019

If cp still ask you permission to overwrite every single file, then it means that there is an alias cp -i in your system. To bypass the overwrite question for every file, you can either:

  • Temporarily disable alias by prefixing a backslash: \cp XYZ.
  • or
  • Feed yes to cp through pipe: yes | cp XYZ.

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.