Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Clear beginning of filenames
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mc  
View profile  
 More options Nov 13 2012, 4:36 am
Newsgroups: comp.unix.shell
From: mc <am...@email.it>
Date: Tue, 13 Nov 2012 09:36:06 +0000 (UTC)
Local: Tues, Nov 13 2012 4:36 am
Subject: Clear beginning of filenames
Hi all,

I have a list of files and I want to remove from filenames everything
before the first "word"

"----=foo1.tmp"
"#foo2.zip"
" foo3.foo"

"foo1.tmp"
"foo2.zip"
"foo3.foo"

How can I do it using perl rename (Debian) or mmv?

Thank you very much in advance,

mc.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mc  
View profile  
 More options Nov 13 2012, 6:15 am
Newsgroups: comp.unix.shell
From: mc <am...@email.it>
Date: Tue, 13 Nov 2012 11:15:04 +0000 (UTC)
Local: Tues, Nov 13 2012 6:15 am
Subject: Re: Clear beginning of filenames
Il Tue, 13 Nov 2012 11:37:08 +0100, houghi ha scritto:

> If it is all the same word, I would go with mmv. mmv "*foo*" "foo#2"

> houghi

the word is not always the same

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Bacarisse  
View profile  
 More options Nov 13 2012, 7:58 am
Newsgroups: comp.unix.shell
From: Ben Bacarisse <ben.use...@bsb.me.uk>
Date: Tue, 13 Nov 2012 12:58:38 +0000
Local: Tues, Nov 13 2012 7:58 am
Subject: Re: Clear beginning of filenames

mc <am...@email.it> writes:
> I have a list of files and I want to remove from filenames everything
> before the first "word"

> "----=foo1.tmp"
> "#foo2.zip"
> " foo3.foo"

> "foo1.tmp"
> "foo2.zip"
> "foo3.foo"

> How can I do it using perl rename (Debian) or mmv?

  rename -- 's/^\W+//' *

--
Ben.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Icarus Sparry  
View profile  
 More options Nov 18 2012, 11:28 am
Newsgroups: comp.unix.shell
From: Icarus Sparry <i.sparry...@gmail.com>
Date: Sun, 18 Nov 2012 16:28:22 GMT
Local: Sun, Nov 18 2012 11:28 am
Subject: Re: Clear beginning of filenames

Since you asked for the *first* match, use a non greedy regular
expression.

rename 's/.*?foo/foo/;' *foo*


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »