Bug 3520

Summary: mv will copy a directory into itself in certain situations
Product: [Retired] Red Hat Linux Reporter: alborchers
Component: fileutilsAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-09-25 03:04:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description alborchers 1999-06-17 05:03:30 UTC
"mv * newdir" creates newdir/newdir and copies files twice.
Recursion stops after one level (thankfully) and only the
files, not subdirectories are copied into newdir/newdir.

This only happens if there are other subdirectories that are
being moved; for example, in the following script, there is
no problem if the subdirectory "dir" is not present.

   Example script:
[test] ls
[test] > file1
[test] mkdir dir newdir
[test] mv * newdir
mv: newdir/newdir/dir: won't create hard link `newdir/dir'
to directory `(null)'
[test] ls -R
.:
newdir

newdir:
dir  file1  newdir

newdir/dir:

newdir/newdir:
file1

Comment 1 Jeff Johnson 1999-06-17 15:29:59 UTC
I'm changing component to fileutils.

Comment 2 Bill Nottingham 1999-09-25 03:04:59 UTC
Should be fixed in the latest fileutils in Raw Hide.