LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-19-2003, 08:38 AM   #1
juanb
Member
 
Registered: May 2002
Posts: 401

Rep: Reputation: 30
Talking How to rename a file?


what is the command to rename a file ?

thanks .
 
Old 03-19-2003, 08:47 AM   #2
NGene
Member
 
Registered: Mar 2001
Location: Turku, Finland
Distribution: Ubuntu
Posts: 66

Rep: Reputation: 16
mv

You use it like: mv oldfile newfile

That's what you get as a result when you enter the words "renaming", "files" and "linux" into google...
 
Old 03-19-2003, 10:48 AM   #3
stikboy
Member
 
Registered: Mar 2003
Location: Colorado
Distribution: RedHat 7.1/Redhat 8.0/Gentoo 1.4
Posts: 45

Rep: Reputation: 15
There is also a rename command, although I can't find a whole lot of info on it

http://unix.about.com/library/tips/bltip052.htm

that's the first page I found that looked useful, but do some digging if you need it - unlike mv, rename can do wildcards (i.e. rename *.txt *.html) but it's been awhile and I don't remember if that's the exact sytax or not
 
Old 03-19-2003, 11:12 AM   #4
kublador
Member
 
Registered: Aug 2002
Location: Philippines
Distribution: Slackware, CentOS, Ubuntu
Posts: 325

Rep: Reputation: 30
how do you move files then?
 
Old 03-19-2003, 11:20 AM   #5
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
same command.
mv oldfile /new/path/newfile

As long as you can see the file and its name as detached entities, a move and a rename are basically the same operation, aren't they? You are making a new directory entry somewhere in the directory-tree and attaching the file's inode to it.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple File Rename windisch Linux - General 11 11-10-2005 12:19 PM
How can i Rename file? Khmer Linux - Newbie 4 10-21-2005 08:09 AM
rename file with a pattern sujith_deva Programming 7 12-16-2004 07:39 PM
Can't rename file with parenthesis in name pleasehelp Linux - Newbie 4 03-16-2004 03:01 PM
How do I rename a file? Thaidog Linux - Newbie 5 10-10-2003 10:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:00 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
Open Source Consulting | Domain Registration