Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#Write a shell script, which reports names and sizes of all files in a directory

whose size is exceeding 1000 bytes.


mkdir temp
count = 0
for i in *
do
if [ -f $i ]
then
tmp=`ls -l $i | cut -f5 -d" "`
if [ $tmp -gt 1000 ]
then
count=`expr $count + 1`
ln $i temp
fi
fi
done
ls -lS temp
echo Total number of such files is : $count
rm -r temp

You might also like