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
447 B
Bash
Raw Normal View History

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