how to check file exist or not in unix

echo "enter your file name"

read file
if [ -e $file ]
then
echo "file exist"
else
echo "file not exist"
fi

output:-




-e option use for checking file exist or not

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post