bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14564: A confusing problem about 'mv'


From: Rob Wortman
Subject: bug#14564: A confusing problem about 'mv'
Date: Thu, 6 Jun 2013 16:56:10 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

On 2013-06-07 at 00:38:36 +0100, address@hidden 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]