LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Strip first three characters from filename

[ILUG] Strip first three characters from filename

john Moylan john at nuatech.net
Sun Aug 10 21:32:46 IST 2008


Hi ollie,

This should work.

for i in `ls *.mp3`; do mv ${i} `echo ${i} | sed 's/_//g'`; done

John

echo hjhj_jkjk_dd | sed 's/_//g'

2008/8/10 <ollie at eillo.org>

>
> I have rename and come across some solutions using it (and others) on
> google but while I'm extremely comfortable on the command line i rarely need
> command this complex. I was unable to adapt any of the web solutions to my
> needs.
>
> How could I use rename to convert underscores in a filename to spaces?
>
>
>
> On Sun, 10 Aug 2008 12:21:33 +0100, "Steve McConville" <
> mcconville.steve at gmail.com> wrote:
> > For future reference there's a perl program called 'rename' which  -
> > depending on distro - you may already have installed. It just uses
> > regexps, so
> >
> > rename 's/^\w{3}//' *.mp3
> >
> > would do what you want. John's solution using cut is more portable,
> > however.
> >
> >
>
> --
> Irish Linux Users' Group mailing list
> About this list : http://mail.linux.ie/mailman/listinfo/ilug
> Who we are : http://www.linux.ie/
> Where we are : http://www.linux.ie/map/
>



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell