AimerNeige revidoval tento gist . Přejít na revizi
1 file changed, 1 insertion, 1 deletion
rsmv.sh
@@ -1,4 +1,4 @@ | |||
1 | - | !/bin/bash | |
1 | + | #!/bin/bash | |
2 | 2 | ||
3 | 3 | # Safety check | |
4 | 4 | [ "$#" -eq 0 ] && "No input files" && exit 1 |
AimerNeige revidoval tento gist . Přejít na revizi
Žádné změny
AimerNeige revidoval tento gist . Přejít na revizi
2 files changed, 14 insertions
origin_refer.md(vytvořil soubor)
@@ -0,0 +1,8 @@ | |||
1 | + | https://www.baeldung.com/linux/moving-files-showing-progress | |
2 | + | ||
3 | + | ```bash | |
4 | + | $ rsmv ~/.cache/ctrlp /tmp/cache | |
5 | + | mru/ | |
6 | + | mru/cache.txt | |
7 | + | 749 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=0/2) | |
8 | + | ``` |
rsmv.sh(vytvořil soubor)
@@ -0,0 +1,6 @@ | |||
1 | + | !/bin/bash | |
2 | + | ||
3 | + | # Safety check | |
4 | + | [ "$#" -eq 0 ] && "No input files" && exit 1 | |
5 | + | ||
6 | + | rsync -aP --remove-source-files "$@" && rm -rf "${@:1:$#-1}" |