Reputation: 3
I'm looking to rename a series of files that has the following naming system:
5901_fig-1658008.20.peg.1782.faa
7274_fig-1658008.20.peg.2807.faa
8228_fig-1658008.20.peg.3705.faa
And change it to:
fig-1658008.20.peg.1782.faa
fig-1658008.20.peg.2807.faa
fig-1658008.20.peg.3705.faa
How would I do this on command line?
Upvotes: 0
Views: 47
Reputation: 13998
it looks like you just want to remove the sub strings before '_'
for file in *.faa; do mv "$file" "${file#*_}"; done
Upvotes: 1