How would I rename a file say old.txt to new.txt in Linux using commands?

would it be...?

rename old.txt new.txt

link|improve this question
Not really a programming question is it? Welcome to the world of computing though, you seem new around here ;-) – user9644 May 19 '10 at 20:53
3  
Belongs on superuser.com – Paul R May 19 '10 at 20:53
Sure its a programming question. Isn't 'sh' a programming language? – Christopher Barber May 19 '10 at 21:02
rename actually is a Linux command for renaming, though for a single file mv is used. rename is typically for batch renames. – Zurahn May 20 '10 at 3:12
feedback

migrated from stackoverflow.com May 20 '10 at 1:40

This question came from our site for professional and enthusiast programmers.

2 Answers

mv old.txt new.txt

link|improve this answer
feedback

mv is a command that "moves" the file given as the first argument to the name specified in the second. In this case, you're just moving the file from one name to another in the same directory.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown