feat: add Dotbot

This commit is contained in:
Stefan Imhoff
2024-08-09 11:57:28 +02:00
parent a41290c297
commit 0437240919
248 changed files with 1205 additions and 44 deletions

18
functions/fs.sh Executable file
View File

@@ -0,0 +1,18 @@
# Determine size of a file or total size of a directory
fs() {
# Check if 'du' supports the -b option
if du -b /dev/null > /dev/null 2>&1; then
arg="-sbh"
else
arg="-sh"
fi
# If arguments are provided, use them; otherwise, use current directory
if [ $# -gt 0 ]; then
du $arg -- "$@"
else
# Use find to handle hidden files and directories
find . -maxdepth 1 -print0 | xargs -0 du $arg | sort -h
fi
}