shell-base/modules/utility/dir.lib
David Kebler 3a246c71cd use which instead of command -v
added unlocku to alias
added new way better copy module/function based on rsync
  copies local and remote
2024-03-01 15:01:47 -08:00

23 lines
No EOL
506 B
Bash

#!/bin/bash
# simple local copy wintin or merge one directory to another using rsync. Preserves everything
# present working directory to supplied destination
isDir() {
if [[ -d $1 ]]
then
echo "true"
return 0
else
return 1
fi
}
dir_size () {
if sudo ls $1 >/dev/null ; then
sudo du -h --apparent-size --max-depth=1 $1 | sort -rh
else
echo $1 not a directory
fi
}
# for dir in $(/bin/find -maxdepth 1 -name "*[cC]ache*" -type d ); do; echo $dir; done