LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 04-27-2005, 07:12 PM   #1
ExCIA
Member
 
Registered: Mar 2005
Posts: 78

Rep: Reputation: 15
Command line: Rename several dist files at the same time


I have several dist files that I would like to rename at the same time:

example.php.dist
hook.php.dist
config.php.dist
more...

How do I remove the .dist part for all files at the same time?
 
Old 04-27-2005, 07:30 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
The rename command will do what you need (man rename):
Code:
rename ".dist" "" *.dist
 
Old 04-28-2005, 10:12 AM   #3
ExCIA
Member
 
Registered: Mar 2005
Posts: 78

Original Poster
Rep: Reputation: 15
This is what I did:

rename 's/\.dist$//' *.dist

Thanks
 
  


Reply



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
How to rename a file from command line ??? waelaltaqi Linux - Software 1 11-17-2005 01:49 PM
How to rename a file from command line ??? waelaltaqi Linux - Software 2 11-17-2005 01:43 PM
How can I rename a lot of files with a single command? pujolasdf Linux - Software 4 07-20-2005 05:27 AM
rename files on a command line? CrazyPilot Linux - General 9 06-30-2004 04:10 PM
rename with command line shanenin Linux - Software 1 09-25-2003 07:03 PM

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

All times are GMT -5. The time now is 07:27 PM.

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