i want to give a filename in commandline itself and want to check whether it is a directory are not.shall i use this command
if [ -f $filename ]
I've already answered you.
if [ -d $1 ]; then ls -l $1>file1.txt; awk -f '{print tolower($8)}' file1.txt; else echo "it is not a directory"; fi