LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 10-21-2005, 08:56 AM   #1
Khmer
Member
 
Registered: Aug 2005
Posts: 36

Rep: Reputation: 15
How can i Rename file?


Can you tell me how can i rename my file if now i have:

bbudoc.txt and want to rename this file to bbuegent.test

Please tell me what is command to do it? How can? can give me an example?
 
Old 10-21-2005, 08:57 AM   #2
iluvatar
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
renaming a file in linux means moving the file. so renaming will be:

mv bbudoc.txt bbuegent.test

greets,
.-=~ iluvatar ~=-.
 
Old 10-21-2005, 08:57 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Use the mv (move) command:

mv bbudoc.txt bbuegent.test

Hope this helps.
 
Old 10-21-2005, 09:01 AM   #4
Khmer
Member
 
Registered: Aug 2005
Posts: 36

Original Poster
Rep: Reputation: 15
Ok, thanks why its should be (MV) MV not mean Move, before i think like this too but i think it's wrong. Can you explain me this command MV

I think MV=Move and move only change place of file to other one.
 
Old 10-21-2005, 09:09 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

mv is indeed the command to move files, but the inner workings of mv also makes this the 'rename' command.

mv file01 file02 => first copy file01 to file02 and then, after this is done succesfulley, remove the original (file01 in this example).

See man mv for more details.

PS: There's also a rename command in linux, but this does _not_ do what you expect (man rename for details).

Hope this clears things up.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Rename a dos file - how to? flyboy320 Linux - Newbie 3 07-26-2005 08:13 PM
File rename script jjwl89 Linux - General 1 03-14-2005 07:28 PM
Can't rename file with parenthesis in name pleasehelp Linux - Newbie 4 03-16-2004 04:01 PM
How do I rename a file? Thaidog Linux - Newbie 5 10-10-2003 11:28 PM
How to rename a file? juanb Linux - General 4 03-19-2003 12:20 PM


All times are GMT -5. The time now is 07:21 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration