I have a bunch of files like this:
file123.txt.452
file456.txt.098
file789.txt.078
How can I remove the second dot and the numbers at the end from the file names?
I tried using rename
but I don’t think my regex is correct:
rename 's/txt.*/txt/' *
Something like:
for f in *.txt.*; do
g=${f%.txt.*}.txt
mv $f $g
done