LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-23-2005, 03:21 PM   #1
TomalakBORG
Member
 
Registered: Dec 2004
Posts: 245

Rep: Reputation: 30
renaming files


Hey guys, I downloaded a bunch of stuff with d4x, and it saved them all beginning with a dot.

example:
.foo.txt

Last time I tried renaming them, (about 50 of them) I did something like # mv .* * and ended up deleting all my files. I was seriously mad at myself for a week. What is the way to take some .file.extension and move them to file.extension with a single command?
 
Old 12-23-2005, 08:07 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Cannot think of a command persay. A simple script can do this but I am terrible at scripting. If nothing happens in a couple of days you might post a similiar topic under the programming section. I use Krename from KDE to do things like you want. http://freshmeat.net/projects/krename/

Brian1
 
Old 12-23-2005, 09:33 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
See "man rename" (no quotes). The rename commandwill do what you want, e.g.

Code:
rename . '' .[a-zA-Z0-9]*
You might want to make a backup copy of the files first, just in case!
 
Old 12-24-2005, 04:11 AM   #4
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
I'd been trying to come up with something using rename, but I got stuck using ? as a wildcard. Nice sollution!
 
Old 12-24-2005, 10:14 AM   #5
TomalakBORG
Member
 
Registered: Dec 2004
Posts: 245

Original Poster
Rep: Reputation: 30
Oh good call! What I discovered in the meantime was a slick way to do it in windows with a little program.. good program, bad os. Thanx for the rename command - just what I needed!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming files TomalakBORG Linux - Newbie 2 12-05-2005 04:13 PM
bash help renaming files kahn Programming 6 06-16-2005 07:15 AM
Renaming lots of files Tuttle Linux - General 4 11-18-2004 11:15 AM
Renaming files as they are uploaded Cr4wford Linux - Software 1 04-26-2004 03:41 PM
Renaming files in one go anon318 Linux - Software 1 01-12-2004 01:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration