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

one folder contains lot of students name but I want to fetch hello with every student name individually using shell script

0 Answers  


how is the oppurtunities for unix in the software

1 Answers  


What is sudo command?

0 Answers  


write a shell script that counts a number of unique word contained in the file and print them in alphabetical order line by line?

6 Answers   IBM, Wipro,


How to print all array elements and their respective indexes?

0 Answers  


What is awk in shell scripting?

0 Answers  


How to print pid of the current shell?

0 Answers  


What are types of shells?

0 Answers  


How u convert string "hi pravin how are you?" to "Hi Pravin How Are You?"

12 Answers   Cap Gemini,


How to modify the PATH variable and make it executable?

3 Answers   Mind Tree,


How to print the first array element?

0 Answers  


What are the various stages of a linux process it passes through?

0 Answers  


Categories