Monday 8 September 2014

Script1: Take user input and calculate Total size occupied by .

#!/bin/bash
clear
if [ $# -ne 0 ]
then
echo no argument needed.
else
echo "enter the directory or file location u want to see disk space"
read a
test -d $a
if [ $? -eq 0 ]
then
echo  "total space required will be aproximate:`du -h $a > 11 2>&1; tail -1 11 | cut -c-4`  "
fi
fi


No comments:

Post a Comment

Popular Posts