From unknown Sun Jun 22 00:46:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14564: A confusing problem about 'mv' Resent-From: Je Li Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 06 Jun 2013 06:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14564 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 14564@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13705017885018 (code B ref -1); Thu, 06 Jun 2013 06:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 Jun 2013 06:56:28 +0000 Received: from localhost ([127.0.0.1]:53501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UkU7X-0001Is-0c for submit@debbugs.gnu.org; Thu, 06 Jun 2013 02:56:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46004) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UkU6G-0001EF-QN for submit@debbugs.gnu.org; Thu, 06 Jun 2013 02:55:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkU41-0004M5-Qm for submit@debbugs.gnu.org; Thu, 06 Jun 2013 02:52:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkU41-0004M1-N1 for submit@debbugs.gnu.org; Thu, 06 Jun 2013 02:52:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkU3v-0000Ni-QL for bug-coreutils@gnu.org; Thu, 06 Jun 2013 02:52:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkU3p-0004LA-KV for bug-coreutils@gnu.org; Thu, 06 Jun 2013 02:52:43 -0400 Received: from mail-ob0-x241.google.com ([2607:f8b0:4003:c01::241]:36341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkU3p-0004L0-Fn for bug-coreutils@gnu.org; Thu, 06 Jun 2013 02:52:37 -0400 Received: by mail-ob0-f193.google.com with SMTP id xk17so935282obc.8 for ; Wed, 05 Jun 2013 23:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=o8YLlx4ewOPGHYZ3Ig8BNmZWPolAhz8J1LOTP4Ce9ns=; b=ZG84XaQERBTOAMo6DNQtFwLQYFqaVdeYol/JyKLzXS2nuAxMEsYrQV7n4f+2Uw0snt xBRRoygFoyokrr7PCBXfzAkwoMszpRRxVSXWQkHrEp3+aATU3FB3DlbUHObaZ5c+QfMg ta1CjGf5RWLJGCRq2gC+8Dr8ahxXxWi+snOyX5nG9/KTywl6c2RnLTT5rGvJyUbNjt4f mgQsPNijZR64ctb7HnEYPaptok4ceR6Vrcq8nMmCPnloWyln1s2OWFEGCYVn8Ut4Od7p 7a6D1wwouo41lNZh5M/jqutueXLQteH9lHqt0ixqRqCV8XMm1cEXjcM/+pPFeXylmpFJ yadA== MIME-Version: 1.0 X-Received: by 10.182.213.10 with SMTP id no10mr12022225obc.76.1370501556237; Wed, 05 Jun 2013 23:52:36 -0700 (PDT) Received: by 10.76.122.83 with HTTP; Wed, 5 Jun 2013 23:52:36 -0700 (PDT) Date: Thu, 6 Jun 2013 14:52:36 +0800 Message-ID: From: Je Li Content-Type: multipart/alternative; boundary=001a11c2deaa6d003904de76c26e X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.2 (---) X-Mailman-Approved-At: Thu, 06 Jun 2013 02:56:24 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --001a11c2deaa6d003904de76c26e Content-Type: text/plain; charset=ISO-8859-1 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 --001a11c2deaa6d003904de76c26e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Today I just used a command as below:<= br>
$ mv win_* *

and got an unexpected result.
Of course I had some folders named with 'win_*' under c= urrent 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
--001a11c2deaa6d003904de76c26e-- From unknown Sun Jun 22 00:46:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14564: A confusing problem about 'mv' Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 06 Jun 2013 23:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14564 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Je Li Cc: 14564@debbugs.gnu.org Received: via spool by 14564-submit@debbugs.gnu.org id=B14564.137056192422992 (code B ref 14564); Thu, 06 Jun 2013 23:39:02 +0000 Received: (at 14564) by debbugs.gnu.org; 6 Jun 2013 23:38:44 +0000 Received: from localhost ([127.0.0.1]:55288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UkjlU-0005yj-7b for submit@debbugs.gnu.org; Thu, 06 Jun 2013 19:38:44 -0400 Received: from mail1.vodafone.ie ([213.233.128.43]:12175) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UkjlQ-0005yJ-NY; Thu, 06 Jun 2013 19:38:42 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjoDAJ4csVFtTtJ3/2dsb2JhbAANTL8xgnUDAYEQgxcBAQEEMgFGEAsNCwkWDwkDAgECAUUGDQEHAQGxHpI/jlNfB4NbA54Ajg8 Received: from unknown (HELO [192.168.1.79]) ([109.78.210.119]) by mail1.vodafone.ie with ESMTP; 07 Jun 2013 00:38:37 +0100 Message-ID: <51B11D7C.1000809@draigBrady.com> Date: Fri, 07 Jun 2013 00:38:36 +0100 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 References: In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) 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. From unknown Sun Jun 22 00:46:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14564: A confusing problem about 'mv' Resent-From: Rob Wortman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 06 Jun 2013 23:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14564 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: 14564@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.137056298328861 (code B ref -1); Thu, 06 Jun 2013 23:57:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Jun 2013 23:56:23 +0000 Received: from localhost ([127.0.0.1]:55318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ukk2Y-0007VP-Uq for submit@debbugs.gnu.org; Thu, 06 Jun 2013 19:56:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57390) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ukk2W-0007V0-59 for submit@debbugs.gnu.org; Thu, 06 Jun 2013 19:56:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ukk2S-0007H0-PN for submit@debbugs.gnu.org; Thu, 06 Jun 2013 19:56:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-99.2 required=5.0 tests=BAYES_50,USER_IN_WHITELIST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukk2S-0007Gv-MS for submit@debbugs.gnu.org; Thu, 06 Jun 2013 19:56:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukk2Q-0006Bj-Jq for bug-coreutils@gnu.org; Thu, 06 Jun 2013 19:56:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ukk2P-0007GY-NH for bug-coreutils@gnu.org; Thu, 06 Jun 2013 19:56:14 -0400 Received: from mx.911domain.com ([64.182.101.216]:33172 helo=box4.7wei.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukk2P-0007GO-Gu for bug-coreutils@gnu.org; Thu, 06 Jun 2013 19:56:13 -0400 Received: from fraenk.haell.com (c-67-166-157-11.hsd1.ca.comcast.net [67.166.157.11]) (authenticated bits=0) by box4.7wei.com (8.13.8/8.13.8) with ESMTP id r56Nu81P026687 for ; Thu, 6 Jun 2013 19:56:09 -0400 X-Service-By: http://www.dnsExit.com/Direct.sv?cmd=mailRelay Relay account will be suspended instantly if Spam Received: by fraenk.haell.com (Postfix, from userid 1000) id 95CD72A05FB; Thu, 6 Jun 2013 16:56:10 -0700 (PDT) Date: Thu, 6 Jun 2013 16:56:10 -0700 From: Rob Wortman Message-ID: <20130606235610.GC25521@fraenk> Mail-Followup-To: bug-coreutils@gnu.org References: <51B11D7C.1000809@draigBrady.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51B11D7C.1000809@draigBrady.com> X-Fortune: B4 I4Q, RU/18 QT 3.1415926535? User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) On 2013-06-07 at 00:38:36 +0100, P@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