To rename the files by removing their extensions, we’ll use the mv command with for loop. The loop will iterate through the list of files present in the current directory. Also, if the loop condition is true, it’ll remove the extensions using the mv command: