GNU bug report logs - #14564
A confusing problem about 'mv'

Previous Next

Package: coreutils;

Reported by: Je Li <jerryli8664 <at> gmail.com>

Date: Thu, 6 Jun 2013 06:57:01 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14564 in the body.
You can then email your comments to 14564 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#14564; Package coreutils. (Thu, 06 Jun 2013 06:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Je Li <jerryli8664 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 06 Jun 2013 06:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Je Li <jerryli8664 <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: A confusing problem about 'mv'
Date: Thu, 6 Jun 2013 14:52:36 +0800
[Message part 1 (text/plain, inline)]
Today I just used a command as below:

$ mv win_* *

and got an unexpected result.

Of course I had some folders named with 'win_*' under current directory,
such as 'win_core'. After the command is done, I can not find these folders
anywhere in the file system.

It is a bit confusing, the destination does not seem valid apparently but
the command is executed without any warnings, and unluckily, my files are
gone.

My OS: Ubuntu 13.04
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#14564; Package coreutils. (Thu, 06 Jun 2013 23:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 14564 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Je Li <jerryli8664 <at> gmail.com>
Cc: 14564 <at> debbugs.gnu.org
Subject: Re: bug#14564: A confusing problem about 'mv'
Date: Fri, 07 Jun 2013 00:38:36 +0100
tag 14564 notabug
close 14564
stop

On 06/06/2013 07:52 AM, Je Li wrote:
> Today I just used a command as below:
> 
> $ mv win_* *
> 
> and got an unexpected result.
> 
> Of course I had some folders named with 'win_*' under current directory,
> such as 'win_core'. After the command is done, I can not find these folders
> anywhere in the file system.
> 
> It is a bit confusing, the destination does not seem valid apparently but
> the command is executed without any warnings, and unluckily, my files are
> gone.
> 
> My OS: Ubuntu 13.04

Unfortunately coreutils can't do anything here as the shell
is interpreting the command line and just passing the resultant
file list to mv.

Note the last param to mv is generally a single
directory and so '*' would be incorrect,
even if suitably quoted to avoid shell globbing.

thanks,
Pádraig.




Added tag(s) notabug. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Thu, 06 Jun 2013 23:39:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 14564 <at> debbugs.gnu.org and Je Li <jerryli8664 <at> gmail.com> Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Thu, 06 Jun 2013 23:39:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#14564; Package coreutils. (Thu, 06 Jun 2013 23:57:02 GMT) Full text and rfc822 format available.

Message #15 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Rob Wortman <wyrm <at> haell.com>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#14564: A confusing problem about 'mv'
Date: Thu, 6 Jun 2013 16:56:10 -0700
On 2013-06-07 at 00:38:36 +0100, P <at> draigBrady.com wrote:
> On 06/06/2013 07:52 AM, Je Li wrote:
> > Today I just used a command as below:
> > 
> > $ mv win_* *
> > 
> > and got an unexpected result.
> > 
> > Of course I had some folders named with 'win_*' under current
> > directory, such as 'win_core'. After the command is done, I can not
> > find these folders anywhere in the file system.
> > 
> > It is a bit confusing, the destination does not seem valid
> > apparently but the command is executed without any warnings, and
> > unluckily, my files are gone.
> > 
> > My OS: Ubuntu 13.04
> 
> Unfortunately coreutils can't do anything here as the shell
> is interpreting the command line and just passing the resultant
> file list to mv.
> 
> Note the last param to mv is generally a single
> directory and so '*' would be incorrect,
> even if suitably quoted to avoid shell globbing.

To expand a bit, Je Li, your files are probably not gone. You very
probably got an error message very much like

	mv: cannot move `foo' to a subdirectory of itself, `foo/foo'

where "foo" is one of your directories. That directory is probably still
there and everything else is probably inside it. For what you wanted to
do, you will want to familiarize yourself with the `rename` command on
your system. There are several variants about, so consult your local
manpage.

-- 
The way to make incompetent individuals realize
their own incompetence is to make them competent.
  -- Kruger and Dunning




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 05 Jul 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 352 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.