BASH Script to Rename Multiple Files

  • Thread starter Thread starter minger
  • Start date Start date
  • Tags Tags
    files Multiple
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 7K views
Messages
1,494
Reaction score
2
Hi guys, this should be a pretty easy thing to do, I'm just not familiar enough with bash shell scripting to do it.

I have a bunch of files named

flow0001.fast
flow0002.fast
...
flow0024.fast

and I would like to remove one zero from the name so:
flow001.fast
flow002.fast
...
flow024.fast

I could do it by hand, but I may have to do it a few times, so a script would be nice. I know the number of files at all times, so I don't need IFs or any searches for the number of files to change.

thanks a lot,
 
Physics news on Phys.org