Computing.Net > Forums > Unix > multiple renaming files & extension

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

multiple renaming files & extension

Reply to Message Icon

Name: tatoo
Date: June 5, 2004 at 18:46:35 Pacific
OS: Win XP
CPU/Ram: P4, 512
Comment:

How may I rename files *.txt to *.dat?
(*=all). Example:

If i have 3 files named a.txt, b.txt, c.txt how can I rename them as a.dat, b.dat & c.dat (at the same time, not one by one).
I know that we use mv for renaming but it doesn't change the .txt to .dat...



Sponsored Link
Ads by Google

Response Number 1
Name: tatoo
Date: June 5, 2004 at 19:13:36 Pacific
Reply:

I forgot something...I'm using SSH connection in order to use Unix.


0

Response Number 2
Name: Dlonra
Date: June 6, 2004 at 14:37:54 Pacific
Reply:

what Unix? On linux, there is rename(1). Otherwise, you need to write a shell script.


0

Response Number 3
Name: tatoo
Date: June 6, 2004 at 20:00:29 Pacific
Reply:

on unix, using tcsh. Any suggestions???


0

Response Number 4
Name: Dlonra
Date: June 7, 2004 at 05:20:58 Pacific
Reply:

you do/do-not have rename?

don't know tcsh. The general procedure is to use grep and sed to get the prefix, add the new suffix and rename.


0

Response Number 5
Name: Jimbo
Date: June 8, 2004 at 22:06:51 Pacific
Reply:

http://www.faqs.org/faqs/unix-faq/faq/part2/section-6.html


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: multiple renaming files & extension

Rename file extension in script www.computing.net/answers/unix/rename-file-extension-in-script/8138.html

Checking multiple .htpasswd files www.computing.net/answers/unix/checking-multiple-htpasswd-files/3652.html

Utility or script for renaming files on www.computing.net/answers/unix/utility-or-script-for-renaming-files-on-/2538.html