write a scwipt that
a) takes exactly one argument, a directory name.
b) if the number of argument is more or less than one,print
a usage message
c) if the argument is not adirectory, print another message
d) for the given directory, print the five biggest files
and the five files that were most recently modified.
e) save the output to a file called q2output.
Answer Posted / sudhir
for var in `ls -1S` === -S sort the file primary key as
size of the file and -1 column o/p
do
if [[ $i -eq 5 ]]
then
break;
fi
print $var
let i=i+1;
done
Same code can be used for time and ls command option will be
ls -1t
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
Tell something about the super block in shell scripting?
How do I run a shell script on a mac?
How do I stop script errors?
What is a scripting language simple definition?
What command needs to be used to take the backup?
How to pass an argument to a script?
What is the best shell scripting language?
Can we run shell script in windows?
Why is used in shell scripting?
Is shell a part of kernel?
What is console line?
What is the purpose of scripting?
one folder contains lot of students name but I want to fetch hello with every student name individually using shell script
What does echo mean in scripting?
What language is bash?