Basically I have a shell script and i want to search the computer for a folder and if that folder exists i want to take some action. Not sure exactly how to do this most efficiently.
Not very experienced....any help would be appreciated.
Basically I have a shell script and i want to search the computer for a folder and if that folder exists i want to take some action. Not sure exactly how to do this most efficiently.
Not very experienced....any help would be appreciated.
found=$(find / -type d -name "folder.name" 2> /dev/null)
if [ ! -z $found ] ; then
# your action
fi ;