Re: Why mv have no '-R'



Listen Up wrote:
Thanks to everybody.

So I can take it this way,
'mv' does not really move data(in one file system), it just renames
something--it can be a file or a directory.
While 'cp' copies data, so I have to 'cp' all the files recurisively,
in order to copy a directory into another one!

But another problem: if file2 already exists, in the following
$mv file1 file2
file1 will be renamed as file2, but file2 still exists 'cause 'mv' did
not move data and file2 won't be overwritten, right?

If the directory entry 'file2' is the only "pointer" to the file (i.e.
no additional "hard links" set and no process accessing the file) then
the file file2 *will* be removed. So, in most cases, you will overwrite
the file by using mv. Use mv -i to get asked whether the file should be
overwritten.

Janis
.



Relevant Pages

  • Re: *nix data wipe tools
    ... >file system to destroy the contents of a file. ... >that overwrite requests will actually overwrite the intended bits. ... encounter; flash memory devices, e.g., only pretend to be an array of bytes; ... Personally I prefer a "lose key, lose data" approach to secure erase; ...
    (Bugtraq)
  • Re: Help with (relatively) securely deleting files?
    ... Would that not overwrite the blocks ... :This depends on the file system. ... :areas, which aren't available for dd, except for the file tail. ... would not be touched by your 'dd' command. ...
    (comp.security.unix)
  • Re: How to get fullpathname form MFT
    ... so CreateFile() fails ... but I can overwrite a.exe file by write sector. ... and most likely damage the file system. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: cant save .rc in 2008 Studio
    ... Sounds like a file system issue. ... overwrite it, and then fails to overwrite since the file is already ... open (duh). ... As long as my editing ...
    (microsoft.public.vc.language)
  • Re: Save as, not overwrite
    ... you just choose to allow it to overwrite ... 'renames it while saving it ... .SaveAs pathToUserDesktop ...
    (microsoft.public.excel.programming)