This repository has been archived on 2024-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
linux/.config/bash/module/cp.sh

25 lines
492 B
Bash

# replace default cp with rsync.
function cp() {
rsync -ahP --chmod=u+w -- "${@}"
}
# copy and also merge all changes (delete dst files that do not exist in src).
function cp_merge() {
rsync -ahP --chmod=u+w --delete -- "${@}"
}
# copy by creating hardlinks.
function cp_link() {
/usr/bin/cp -lr -- "${@}"
}
# default cp, a.k.a builtin cp.
function bcp() {
/usr/bin/cp "${@}"
}
# cp_merge without writing anything.
function cp_test() {
rsync -ahP --chmod=u+w --delete -n -- "${@}"
}