Renaming multiple files en masse?

Brian Somers brian at awfulhak.org
Wed Apr 12 00:05:54 BST 2000


> sorry couldn't resist..(as its only a suffix change..)
> 
> sh -c 'for fname in *.html ; do mv $fname ${fname%.html}.htm ; done'

This is the best answer - as it uses no external commands - just the 
``mv''.  But bear in mind, most ``sh''s don't do % or # matching.
-- 
Brian <brian at Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !






More information about the Ukfreebsd mailing list