for f in *.jpg; do mv "$f" "${f%.jpg}"; done
for f in *; do mv "$f" "$f.jpg"; done
You can use rename:
rename 's/(.*)/$1.jpg/' *
for f in *.jpg; do mv "$f" "${f%.jpg}"; done
for f in *; do mv "$f" "$f.jpg"; done
You can use rename:
rename 's/(.*)/$1.jpg/' *