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

What is a beat in a script?

629


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

1743


What language is bash written in?

640


Is it possible to substitute "ls" command in the place of "echo" command?

694


What is the command to find out users on the system?

645






c program to display the information of given file similar to givan by the unix or linux command ls -l

1777


Why is a script important?

629


How do I set bash as default shell mac?

647


Explain about echo command?

713


What are the zombie processes?

634


What happens on a system call?

636


Explain about stdin, stdout and stderr?

711


What is @echo off?

655


Is cmd a shell?

673


How to get script name inside a script?

648