How to initialize a directory size to a variable??
Answers were Sorted based on User's Feedback
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 |
Is bash an operating system?
What is a shell? · Types of shell · what is shell scripting?
Explain about return code?
How to use arguments in a script?
Write a command sequence to find all the files modified in less than 2 days and print the record count of each.
A file has multiple records each having three 30-bit long fields(field1,field2,field3).There is also a lookup file,LOOK_UP.dat.Now, we need to consider only the last ten digits of field1 and lookup the file LOOK_UP.dat. If there a match then field2 and field3 should replaced with corresponding data from the lookup file. otherwise that particular record,for which there is no match, should be stored in a seperate file.
What are the different types of variables used in shell script?
How do you rename the files(*.sh) with file names containing space in it?for example "interview question.sh" needs to rename to "interview-question.sh". Appreciate your inputs.Thanks.
How does shell scripting work?
How to get the 3rd element/column from each line from a file?
Explain about stdin, stdout and stderr?
What is the command to find out today's date?