Write a shell script named filesize.sh that takes the name of adirectory within the current working directory as a command-lineargument and prints the name and size of each file to standardoutput. You may assume there are no sub directories within thegiven directory.
Example output:
$ ./filesize.sh FILES
/FILES/examplefile1.txt
120916
/FILES/examplefile2.pyd
8393
Answer
dirs=$1
if [ -z $dirs ]
then
echo “usage: ./filesize.sh <directoryname>”
else
du -ah $dirs
fi
if you have any doubt then please ask me without any hesitationin the comment section below , if you like my answer then
OR
OR