I have a few directories and sub-directories containing files with no file extension. I want to add .jpg to all the files contained within these directories. I\
.jpg
like this,
for f in $(find . -type f); do mv $f ${f}.jpg; done
I am not expecting you have space separated file names, If you do, the names will need to be processed a bit.
If you want to execute the command from some other directory, you can replace the find . with find /target/directory.
find .
find /target/directory