Since you want to remove ".txt" from all text files in a folder, you can use the "mv" command with the "for" loop.
for file in $(ls *.txt); do mv "$file" "${file%.*}" ; done