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?
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?
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.
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.
renameallows the use of regex, but have you haven't said what part you want to rename, and what to. – guiverc Oct 01 '19 at 07:58mp4suffix. Look at the names precisely. – Mohammad Kholghi Oct 01 '19 at 08:01