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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-23-2005, 03:21 PM
|
#1
|
Member
Registered: Dec 2004
Posts: 245
Rep:
|
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?
|
|
|
12-23-2005, 08:07 PM
|
#2
|
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:
|
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
|
|
|
12-23-2005, 09:33 PM
|
#3
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
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!
|
|
|
12-24-2005, 04:11 AM
|
#4
|
Senior Member
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Rep:
|
I'd been trying to come up with something using rename, but I got stuck using ? as a wildcard. Nice sollution!
|
|
|
12-24-2005, 10:14 AM
|
#5
|
Member
Registered: Dec 2004
Posts: 245
Original Poster
Rep:
|
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!
|
|
|
All times are GMT -5. The time now is 03:23 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|