12 lines
209 B
Bash
Raw Normal View History

2025-01-17 10:49:39 +05:30
#!/bin/bash
echo "Enter the name of item to be checked"
read name
if [ -f $name ]; then
echo "File $name exists"
elif [ -d $name ]; then
echo "Directory $name exists"
else
echo "Neither file or directory"
fi