usage() for os x and linux
This commit is contained in:
@@ -32,12 +32,21 @@ pri() {
|
||||
|
||||
|
||||
# disk usage per directory
|
||||
# in Mac OS X and Linux
|
||||
usage ()
|
||||
{
|
||||
if [ $1 ]
|
||||
then
|
||||
du -hd $1
|
||||
else
|
||||
du -hd 1
|
||||
fi
|
||||
if [ $(uname) = "Darwin" ]; then
|
||||
if [ -n $1 ]; then
|
||||
du -hd $1
|
||||
else
|
||||
du -hd 1
|
||||
fi
|
||||
|
||||
elif [ $(uname) = "Linux" ]; then
|
||||
if [ -n $1 ]; then
|
||||
du -h --max-depth=1 $1
|
||||
else
|
||||
du -h --max-depth=1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user