This is an old revision of the document!
Linux File Operations
Find Directories Containing Specified File Glob
For example, find directories containing Python source files.
find /c/home/db/ -type f -name '*.py' | sed -r 's|/[^/]+$||' | sort | uniq
sed -r 's|/[^/]+$||
' eats off the file name of a fully qualified file path, leaving only the path.- For each file path
sed
finds the filename and replaces it with a null string and the rest of the string/path is returned.
Find all the directories containing *.py files modified in the last 15 minutes.
find /c/home/db/ -mmin -15 -type f -name '*.py' | sed -r 's|/[^/]+$||' |sort|uniq