Re: changing extensions, a little OT perhaps.
On Fri, Apr 26, 2002 at 01:32:33PM -0400, Bob Torres wrote:
> Hi All,
>
> I recently transferred some MP3s from my MacOS desktop to my Debianppc
> laptop. There are no file extensions for these mp3 files, so they're
> kind worthless for xmms in Linux.
>
> On the Linux side, how would I go about adding extensions to these files
> without doing it manually? In other words, is there something I could
> pass at the command line to accomplish this for a whole directory of
> files? I've been using Linux for three years or so now, and I've always
> wanted to know how to do this...anyone care to educate me? I'm hoping
> for something a little more substantive than "go learn sed (or whatever
> program)," though learning by example usually works the best for me. ; )
I tend to do this as a shell command, and that'd depend on your shell.
For csh variants:
foreach file (*)
mv $file $file.mp3
end
For sh variants (bash, ksh, ...):
for file in * ; do mv $file $file.mp3 ; done
You'll want to read your shell manpages if you want to do stuff like removing
old extensions, etc.
Jon Leonard
--
To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: