Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to initialize a directory size to a variable??

Answers were Sorted based on User's Feedback



How to initialize a directory size to a variable??..

Answer / damodar rao

#!/bin/bash
echo 'enter the directory name with path Ex: /home/damoar: ';
read $x;
$size = `du -h $x`;
echo 'size of a given directory $x is : `$size` ';
:wq

Is This Answer Correct ?    3 Yes 0 No

How to initialize a directory size to a variable??..

Answer / pushkar

if [ -d $var ] ;then
rm -rf $var
fi
mkdir $var

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More Shell Script Interview Questions

What is echo in shell?

0 Answers  


How will you print the login names of all users on a system?

0 Answers  


Please anyone suggest atleast 2 good training institutes in Hyderabad, INDIA where i can learn unix shell scripting.

1 Answers  


What is sed in shell script?

0 Answers  


How would you replace the n character in a file with some xyz?

7 Answers  


What is the difference between a variable and value?

7 Answers   Sun Microsystems,


What does the sh command do?

0 Answers  


What is difference between shell and bash scripting?

0 Answers  


How to print pid of the current shell?

0 Answers  


What is the command to find out today's date?

0 Answers  


What are the two files of crontab command?

0 Answers  


Where is bash history?

0 Answers  


Categories