| | |
Rename
Thread Solved |
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
Hey there,
You can use "mv" for files and directories.
Perhaps I'm misunderstanding.
Hope that helps
, Mike
You can use "mv" for files and directories.
Perhaps I'm misunderstanding.
Hope that helps

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
I'm sorry. Looking at your profile, I think you're just kidding
You got me 
,Mike
You got me 
,Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
I'm pretty mv sure it's cp then rm
, Mike

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
•
•
Join Date: Apr 2008
Posts: 58
Reputation:
Solved Threads: 9
No, thats actually exactly wrong.
The mv command does not make a new file. Period. The datablocks holding the information remain unchanged. All that happens is that the entry in the directory file that holds the inode information is copied to the new directory, and then the inode information is removed from the old directory.
To demonstrate this; create a file, and change ownership to someone in your group, but first chmod the file to 600. Chmod the directory the file is located in to 770, and make sure that it is owned by your group and/or you.
Create a new directory (770), with the same ownership. Now, technically, you will not have write access to the file (600 owned by Joe). But, since you have permissions to change the inode information contained in both directory listings, you will be able to run an mv command on the file. You will not, however be able to read from that file to perform the cp command. You can mv, but not cp. You have no access to the stored data, just to the inodes pointing to the data. Therefore, you change the location from which those inodes can be accessed, but do not modify the original file. This is a true mv.
The mv command does not make a new file. Period. The datablocks holding the information remain unchanged. All that happens is that the entry in the directory file that holds the inode information is copied to the new directory, and then the inode information is removed from the old directory.
To demonstrate this; create a file, and change ownership to someone in your group, but first chmod the file to 600. Chmod the directory the file is located in to 770, and make sure that it is owned by your group and/or you.
Create a new directory (770), with the same ownership. Now, technically, you will not have write access to the file (600 owned by Joe). But, since you have permissions to change the inode information contained in both directory listings, you will be able to run an mv command on the file. You will not, however be able to read from that file to perform the cp command. You can mv, but not cp. You have no access to the stored data, just to the inodes pointing to the data. Therefore, you change the location from which those inodes can be accessed, but do not modify the original file. This is a true mv.
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
Well, not exactly 
I threw that one out there without thinking, I'll admit and you are correct in the circumstance that both files are on the same partition.
If you mv /bob/dir1 to /bob/dir2 - assuming /bob is one partition/filesystem containing dir1 and dir2 - then the pointer to inode explanation is correct.
However, if you mv a file from /bob/dir/1 to /joe/dir/1 - assuming /bob is one partition/filesystem and /joe is another partition/filesystem - Unix (at least, Solaris) actually does do a cp and then an rm. The same test you propose will not allow you to mv or cp the file you don't have permissions to access in that situation.
Hopefully, this post is finally resolved. If I'm not mistaken it all started out as a joke
Take care,
Mike

I threw that one out there without thinking, I'll admit and you are correct in the circumstance that both files are on the same partition.
If you mv /bob/dir1 to /bob/dir2 - assuming /bob is one partition/filesystem containing dir1 and dir2 - then the pointer to inode explanation is correct.
However, if you mv a file from /bob/dir/1 to /joe/dir/1 - assuming /bob is one partition/filesystem and /joe is another partition/filesystem - Unix (at least, Solaris) actually does do a cp and then an rm. The same test you propose will not allow you to mv or cp the file you don't have permissions to access in that situation.
Hopefully, this post is finally resolved. If I'm not mistaken it all started out as a joke

Take care,
Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
![]() |
Other Threads in the IT Professionals' Lounge Forum
- Previous Thread: how to create a proper blog
- Next Thread: Trouble playing network games
| Thread Tools | Search this Thread |
Tag cloud for IT Professionals' Lounge
1gbit advertising advice amazon answers archive british broadband business businessprocesses career carrier censorship cern china cio collectiveintelligence connectivity consumer consumers corporateearnings css datatransfer debtcollectors dictionary digg digital ebay ecommerce email employment environment facebook food government grid high-definition hottub infodelivery infotech intel internet interview ipod isp japan kindle lhc library malware marketing mit moonfruit news onlineshopping php piracy piratebay pope porn program questions r&d religion remoteworking research retail security sex shopping simple skype smallbusiness smb sms socialmedia socialnetworking software softwareengineer spam speed spending startrek statistics stumbleupon survey tabletpc technology touch-screen touchscreen training twitter uk vbulletin videoinprint voips web webdesign windows words






