LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rename command won't work (https://www.linuxquestions.org/questions/linux-newbie-8/rename-command-wont-work-153239/)

Red Squirrel 03-03-2004 08:33 PM

rename command won't work
 
I'm trying to rename a file, but it just does not work. I type rename htaccess.txt .htaccess I don't get an error or anything, but if I do a dir it does not work, the file is still called htaccess.txt. Why is that? Is there an easy way around that?

slakmagik 03-03-2004 08:40 PM

Use 'mv'. I *despise* rename's syntax and it should only be used for complex multi-file renaming.

mv htaccess.txt .htaccess

mjrich 03-03-2004 08:40 PM

The rename command works the other way around :) Also, for single files I'd just use mv, rather than rename (which methinks is meant for renaming a group of files according to a Perl expression), thus

mv htaccess.txt .htaccess

Cheers, M.

mikshaw 03-03-2004 08:40 PM

try mv htaccess.txt .htaccess

ummm....yeah...what they said...

Red Squirrel 03-03-2004 08:53 PM

thanks for the quick answers!


All times are GMT -5. The time now is 11:49 AM.