|
Welcome to the Web Hosting Forum - Hosting Reviews, Web Hosting Discussion Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content etc. By registering you have access to many other special features, Like personal blogs, your own personal forum, extended profiles, posting of your resume, free links, photo galleries, auctions etc. We are Web 2.0 Compliant . We also reward our posters and referals with free hosting, domains, prizes etc. Even earn points for reading posts. We offer contests, and events that are sure to please anyone in the hosting industry, web developer or SEO at heart. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|
|||||||
| Misc Topics Got something that dont fit, well jam it in here hehe. |
|
|
LinkBack | Thread Tools |
|
|||
|
mass renaming
Hi
I have files without any extension, I want to add html to the end. findbis7?query=tree findbis7?query=light findbis7?query=vert etc findbis7?query=tree.html findbis7?query=light.html findbis7?query=vert.html etc I tried this command among many others and nothing works ls -d *.* | sed 's/\(.*\).*$/mv "&" "\1.html"/' | sh It would be nicer if I can get rid of findbis7?query= Please help me Thanks |
|
|||
|
Re: mass renaming
On 2006-11-13, ray <ray_lokey7543@yahoo.com> wrote:
> I have files without any extension, I want to add html to the end. > > findbis7?query=tree > findbis7?query=light > findbis7?query=vert > etc > > findbis7?query=tree.html > findbis7?query=light.html > findbis7?query=vert.html I would try something like (untested) for file in $(ls) do mv $file $file.html done (I'm sure a find would work too.) > > It would be nicer if I can get rid of > findbis7?query= There you might try rename. man rename has all the details you need. --keith -- kkeller-usenet@wombat.san-francisco.ca.us (try just my userid to email me) AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt see X- headers for PGP signature information |
|
|||
|
Re: mass renaming
On 2006-11-13, ray wrote:
> Hi > I have files without any extension, I want to add html to the end. > > findbis7?query=tree > findbis7?query=light > findbis7?query=vert > etc > > findbis7?query=tree.html > findbis7?query=light.html > findbis7?query=vert.html > etc > > I tried this command among many others and nothing works > ls -d *.* | sed 's/\(.*\).*$/mv "&" "\1.html"/' | sh > > It would be nicer if I can get rid of > findbis7?query= for file in findbis* do mv "$file" "${file#*=}.html" done -- Chris F.A. Johnson, author | <http://cfaj.freeshell.org> Shell Scripting Recipes: | My code in this post, if any, A Problem-Solution Approach | is released under the 2005, Apress | GNU General Public Licence |
|
|||
|
Re: mass renaming
Keith Keller wrote:
> On 2006-11-13, ray <ray_lokey7543@yahoo.com> wrote: > >> It would be nicer if I can get rid of >> findbis7?query= > > There you might try rename. man rename has all the details you need. Beware, however, that there are two different 'rename' utilities. I think either should work in this case, however. http://wiki.linuxquestions.org/wiki/Rename |
|
|||
|
Re: mass renaming
On 13 Nov 2006 13:57:21 -0800, ray
<ray_lokey7543@yahoo.com> wrote: > Hi > I have files without any extension, I want to add html to the end. > > findbis7?query=tree > findbis7?query=light > findbis7?query=vert > etc > > findbis7?query=tree.html > findbis7?query=light.html > findbis7?query=vert.html > etc > > I tried this command among many others and nothing works > ls -d *.* | sed 's/\(.*\).*$/mv "&" "\1.html"/' | sh > Toto, we're not in Redmond anymore. ls *.* lists filenames that contain "." -- If one studies too zealously, one easily loses his pants. -- A. Einstein. |
|
|||
|
Re: mass renaming
Hi,
On Mon, 13 Nov 2006 13:57:21 -0800, ray wrote: > Hi > I have files without any extension, I want to add html to the end. > > findbis7?query=tree > findbis7?query=light > findbis7?query=vert > etc > > findbis7?query=tree.html > findbis7?query=light.html > findbis7?query=vert.html > etc > > I tried this command among many others and nothing works > ls -d *.* | sed 's/\(.*\).*$/mv "&" "\1.html"/' | sh > > It would be nicer if I can get rid of > findbis7?query= you can try: mmv "findbis7*" "findbis7#1.html" regards olli |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HP 2210 Printer Scanner problems in 10.2 | christine | Suse | 24 | 01-05-2007 02:24 AM |
| Re: [Samba] Trouble Renaming Computer | Daniel Carmo Olops | Samba | 0 | 01-04-2007 08:08 PM |
| Make a linux box to act like an USB mass storage unit? | J.O. Aho | Gentoo | 17 | 01-04-2007 06:12 AM |
| Mac Mass Mailer 1.0 (Default branch) | admin | Open Source | 0 | 12-27-2006 09:22 AM |
All times are GMT -5. The time now is 01:24 AM.