shell-base/modules/utility/dir.lib

23 lines
506 B
Plaintext
Raw Normal View History

#!/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