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 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 ]
Jump to PostI'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
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.