Extract common directories.