[ale] rename large number of files

Jason Day jasonday at worldnet.att.net
Tue Apr 29 14:00:13 EDT 2003


On Tue, Apr 29, 2003 at 01:35:40PM -0700, White wrote:
> I have a large number (50-60) of text files that are named without a .txt on
> the end
> most are named in this type fashion
> 222.333-444
> 
> I am a newbie to Linux and was trying to use "mv" to delete the "." and "-"
> in the name and add a .txt on the end.

Open a bash prompt and navigate to the directory where all the files
are.  Then type:
  for i in *; do mv $i `echo $i | tr -d '.-'`.txt; done

Of course, it would be a good idea to make sure you have a copy of these
files in a safe place first.

HTH,
Jason
-- 
Jason Day                                       jasonday at
http://jasonday.home.att.net                    worldnet dot att dot net
 
"Of course I'm paranoid, everyone is trying to kill me."
    -- Weyoun-6, Star Trek: Deep Space 9
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list