Find all directories in the current working directory with a name ending in ".txt" and execute the command "sed -i 's/^/#/' {}" on each of them.
find $(pwd) -type d -name '*.txt' -exec sed -i 's/^/#/' {} \;