I have files name filename.gz.1 and i need to rename them to filename.gz, There are allot of files and every name is different,
I know i cant to this for i in $(ls); do mv $i $i.1; done
,
But can i do this reverse, from filename.gz.1 to filename.gz and keep the original file name?
I have tried this,
for i in $(ls | grep "xz\|gz"); do echo "mv $i $i | $(rev) | $(cut -c3-) | $(rev) |)"; done
But this ignores my Pipes.
Can anyone help me?