1

I want to rename a lot of files like 1_16_video1.mp4?1578683110081 & 54_127_video7.mp4?168302 to 1_16_video1.mp4 & 54_127_video7.mp4.

How can I rename them?

2 Answers2

6

Using bash for loop and parameter expansion:

for i in *.mp4*; do 
  mv "$i" "${i%\?*}"
done

The parameter expansion is mentioned in the man page as

${parameter%word} Remove matching suffix pattern.

It removes everything after the last ? included.

oliv
  • 455
0
sudo apt install krusader
sudo apt install krename

start krusader, highlight which files, or 'select all', 'file multirename' , click 'insert part of filename' button, swipe over the part and carefully check if the results are what you want before proceeding.

pierrely
  • 735