LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-17-2003, 11:59 PM   #1
hct224
Member
 
Registered: Jun 2003
Distribution: Redhat
Posts: 87

Rep: Reputation: 15
rename file/folder command


Can anyone please tell me the command to rename the file/folder. I do a lot of serach and can not find it. seem to me that most of books which I have read only talk about copy(cp) delete(rm) create directory(mkdir)....

thanks

ps. I try rn filename but no go...
 
Old 09-18-2003, 12:01 AM   #2
Saraev
Member
 
Registered: Apr 2002
Location: Los Gatos, CA
Distribution: boring redhat 9
Posts: 163

Rep: Reputation: 30
mv oldname newname
 
Old 09-18-2003, 06:36 AM   #3
zaphod_es
Member
 
Registered: Jun 2003
Location: Brazil
Distribution: Ubuntu
Posts: 137

Rep: Reputation: 15
The answer is 100% correct but I will add a little to it as it totally confused me when I first used Linux.

"I do not want to move the file, I just want to rename it" was myMSDOS thought process. Well the mv command does both at the same time.

The following variations may help.

mv /oldlocation/oldname /oldlocation/newname
mv /oldlocation/oldname /newlocation/newname
mv /oldlocation/oldname /newlocation/oldname

Sorry if this is stating the obvious

ZB
 
Old 09-18-2003, 02:02 PM   #4
Saraev
Member
 
Registered: Apr 2002
Location: Los Gatos, CA
Distribution: boring redhat 9
Posts: 163

Rep: Reputation: 30
Yeah, he's got a point. Moving the file from it's old name to it's new name is really what you're doing, but it doesn't "seem" like what you want to do.
 
Old 09-19-2003, 09:44 AM   #5
hct224
Member
 
Registered: Jun 2003
Distribution: Redhat
Posts: 87

Original Poster
Rep: Reputation: 15
Thanks all.
 
  


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
How to rename a file from command line ??? waelaltaqi Linux - Software 1 11-17-2005 01:49 PM
How to rename a file from command line ??? waelaltaqi Linux - Software 2 11-17-2005 01:43 PM
rename reboot command coco03 Linux - General 6 04-19-2005 02:11 AM
rename file with "mv" not working for folder? Niceman2005 Linux - Newbie 2 03-13-2005 09:34 PM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 02:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:25 PM.

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
Open Source Consulting | Domain Registration