Linux Bash: Searching for an empty folder

Linux Bash: Searching for an empty folder

This is a very easy script in the Linux Bash in order to find a folder. Here you can add your directory path and the max depth where the Bash should search.

#!/bin/bash

echo -n "Add the directory where to search "
read directorypath

echo -n "Add the searchdepth "
read searchdepth

find $directorypath -maxdepth $searchdepth -type d -empty 2>/dev/null
Die Kommentare sind geschlossen.