August 16, 2009

rename a range of files using one-line command

Forums: 

Hi, all

I have a range of files in a certain dir, like this,

$ touch file[123456]
$ ls
file1 file2 file3 file4 file5 file6

now, how could rename them, and add a prefix to each file? for example, add a 'pre-' prefix, as following,

pre-file1
pre-file2
pre-file3
...
pre-file6

Thanks in advance. :cheer:

Regards,
gavin