Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I downloaded a perl file from some webpage by opening it in my browser and saving it. But the saved file has a file name xxx.pl.txt. How can I save it into a file with pl as its ext?

Also how to change a file's ext?

Can I do these in command line?

Thanks and regards!

share|improve this question
add comment

3 Answers 3

up vote 5 down vote accepted

From the command line:

rename xxx.pl.txt xxx.pl
share|improve this answer
    
More direct indeed. –  Gnoupi Jun 8 '10 at 13:12
    
Beat me by a few seconds. Well done. –  MDMarra Jun 8 '10 at 13:13
add comment

The extension is only a part of the file name. If you rename the file, you have only to take out the ".txt" extension, to have only pl.

I assume that you can see the full name, with extensions, according to what you said in the question. If not, you should change this option, following these instructions (for XP, but it's similar for Vista and 7).

share|improve this answer
    
I clicked at the file name, but the ext is not shown for me to change. It is only shown in it property. –  Tim Jun 8 '10 at 13:10
    
@Tim you need to set the view to show extensions - Tools > Folder Options > View - uncheck "Hide extensions for known file types". This should be off by default as having it checked shows "virus.jpg.exe" as "virus.jpg". Having the former makes it less likely that you'll double click it. –  ChrisF Jun 8 '10 at 13:13
    
Gnoupi: Keep in mind that the default is to not show file name extensions. Usually it's assumed that software does the right thing concerning file name extensions, so basically there would be little to no need for a normal user to ever mess with them (I only miss it once every second month or so as well). –  Joey Jun 8 '10 at 13:13
    
@Johannes - I assumed that they were not hidden, because he described the full filename, with extension. I included instructions to show them, in case. –  Gnoupi Jun 8 '10 at 13:15
    
@Joey: it is this braindead decision (by Microsoft) which made e-mail attachments with .doc.exe extensions to flourish... Beside, it is a useful information (the type column is verbose) and I change such extensions almost daily (with the idiotic warning "Are you sure you want to change this extension?". Yes, I am sure!) –  PhiLho May 12 '11 at 11:20
add comment
rename originalname.ext newname.newext
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.