Hi,
something like:
for x in a*.html
do
mv $x b${x#a}
done
or allinoneline:
for x in a*.html; do mv $x b${x#a}; done
works in bash
If you wanted to trim endings you would use % instead of #
m
>Hi folks,
>>I have a bunch of files in a directory of the following format:
>>>a001.html
>a002.html
>a003.html
>>I'd like to find a single 'mv' command to change these files from axxx.html
>to bxxx.html.
>>Obviously, commands like 'mv a???.html b???.html' don't work.
>I'd prefer a single line shell command rather than some sort of foreach if
>possible.
>
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!