Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Sep 2003 21:13:45 -0500
From:      "Charles Howse" <chowse@charter.net>
To:        <till@score.is.tsukuba.ac.jp>, "'Jonas'" <jonas@netwood.net>
Cc:        freebsd-questions@freebsd.org
Subject:   RE: How do I change the extensions on a slew of files
Message-ID:  <000001c3728a$2bdb9510$04fea8c0@moe>
In-Reply-To: <20030904020628.GE50130@plewe.is.tsukuba.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
> > Hello Know-It-Alls,
> >=20
> > If I have a directory with a whole slew of files with the same file
> > extension, for example:
> >=20
> > 1-1-1.inc
> > 1-1-2.inc
> > 1-1-3.inc
> > etc.
> >=20
> > What command can I use to change the file extension - but=20
> keep the file
> > name the same - in one swell swoop? The equivalent command=20
> in Windows
> > would be:
> >=20
> > C:\>ren *.inc *.htm=20
> >=20
>=20
> The shortest answer is probably:
>=20
> portinstall mmv; mmv "*.inc" =3D1.htm

Another option might be:
# Ls <directory with files you need to change extensions> |
> while read file ; do
> mv $file.inc $file.htm
> done <press Enter>
#




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000001c3728a$2bdb9510$04fea8c0>