|
Home > Archive > Unix questions > October 2004 > rename files
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Gabriella 2004-10-02, 9:13 pm |
| I would like to shorten file name from search?q=opq to opq. For one
file, I did mv command and it works. The question now: how to shorten
the name of many files at the same time.
list of files:
search?q=opq
search?q=odf
search?q=kjl
etc
output
opq
odf
kjl
Thanks
| |
|
|
| Stephane CHAZELAS 2004-10-04, 6:01 pm |
| 2004-10-2, 13:53(-07), Gabriella:
> I would like to shorten file name from search?q=opq to opq. For one
> file, I did mv command and it works. The question now: how to shorten
> the name of many files at the same time.
> list of files:
> search?q=opq
> search?q=odf
> search?q=kjl
> etc
>
> output
> opq
> odf
> kjl
If your shell is zsh (4.0 or above):
autoload -U zmv
zmv 'search\?q=(*)' '$1'
--
Stephane
| |
|
| in message <slrnclue53.18d.parv_@localhost.holy.cow>,
wrote parv ...
> in message <17c19ad9.0410021253.1e520d6a@posting.google.com>,
> wrote Gabriella ...
>
>
> One of these should be able to help you...
Another one, untested but interesting, i found about on Unix Review
site ...
http://www.student.lu.se/~nbi98oli/renameutils.html
- parv
--
As nice it is to receive personal mail, too much sweetness causes
tooth decay. Unless you have burning desire to contact me, do not do
away w/ WhereElse in the address for private communication.
|
|
|
|
|