How to initialize a directory size to a variable??

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Suppose you execute a command using exec, what will be the status of your current process in the shell?

578


What is mac default shell?

614


What shell is bin sh?

532


What does .sh file contain?

548


Can you write a script to portray how set –x works?

550






What is .sh file in mac?

553


What is the best shell scripting language?

539


How to calculate the number of passed arguments?

552


How do you find out What is your shell?

590


Write a command sequence to find all the files modified in less than 2 days and print the record count of each.

935


What is the difference between bash and shell?

641


What is echo $shell?

621


What is echo in shell?

636


How do you create a shortcut in linux?

591


c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l

3154