Re: Why mv have no '-R'
- From: Janis Papanagnou <Janis_Papanagnou@xxxxxxxxxxx>
- Date: Sat, 05 Jan 2008 16:41:58 +0100
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
.
- Follow-Ups:
- Re: Why mv have no '-R'
- From: Maxwell Lol
- Re: Why mv have no '-R'
- References:
- Why mv have no '-R'
- From: Listen Up
- Re: Why mv have no '-R'
- From: Maxwell Lol
- Re: Why mv have no '-R'
- From: Joachim Schmitz
- Re: Why mv have no '-R'
- From: Listen Up
- Why mv have no '-R'
- Prev by Date: Re: Why mv have no '-R'
- Next by Date: Comparing two strings (one may be a null)
- Previous by thread: Re: Why mv have no '-R'
- Next by thread: Re: Why mv have no '-R'
- Index(es):
Relevant Pages
|
|