I have a bunch of directories; some of them contain a \'.todo\' file.
/storage/BCC9F9D00663A8043F8D73369E920632/.todo /storage/BAE9BBF30CCEF5210534E875FC80D37E/.
The quick and easy answer for stripping off a file name and showing only the directory it’s in is dirname:
dirname
#!/bin/bash STORAGEFOLDER='/storage' find "$STORAGEFOLDER" -name .todo -exec dirname {} \;