I have multiple files that have the following format: (note that file corresponds to each file name which is not common).
File1_S20.tab
File2_S25.tab
File3_S40.tab
etc
I want to rename them all so they become:
File1
File2
File3
etc
Basically removing the _S$$.tab part from all the files.
For renaming files, I usually use the rename command as follows: rename # somethingelse *.tab (replace # by somethingelse). But the only trouble I'm have is each file has different number after the S.
You can use bash parameter expansion/substring removal to do this: https://wiki.bash-hackers.org/syntax/pe#substring_removal