GNU bug report logs - #12551
ls -l

Previous Next

Package: coreutils;

Reported by: "Chen,Wei" <weichen <at> mdanderson.org>

Date: Mon, 1 Oct 2012 15:35:01 UTC

Severity: normal

Tags: moreinfo

Done: Assaf Gordon <assafgordon <at> gmail.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 12551 in the body.
You can then email your comments to 12551 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#12551; Package coreutils. (Mon, 01 Oct 2012 15:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Chen,Wei" <weichen <at> mdanderson.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 01 Oct 2012 15:35:02 GMT) Full text and rfc822 format available.

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

From: "Chen,Wei" <weichen <at> mdanderson.org>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: ls -l
Date: Mon, 1 Oct 2012 09:41:38 -0500
[Message part 1 (text/plain, inline)]
When I typed 'ls -l *chr4*' in linux, it gave me this:

bash-4.1$  ls -l *chr4*
ls: invalid option -- '4'
Try `ls --help' for more information.

It used to work for me, why?

Thanks!

Wei
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#12551; Package coreutils. (Mon, 01 Oct 2012 16:50:01 GMT) Full text and rfc822 format available.

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

From: Bob Proulx <bob <at> proulx.com>
To: "Chen,Wei" <weichen <at> mdanderson.org>
Cc: 12551 <at> debbugs.gnu.org
Subject: Re: bug#12551: ls -l
Date: Mon, 1 Oct 2012 10:49:08 -0600
tag 12551 + moreinfo
thanks

Chen,Wei wrote:
> When I typed 'ls -l *chr4*' in linux, it gave me this:
> 
> bash-4.1$  ls -l *chr4*
> ls: invalid option -- '4'
> Try `ls --help' for more information.
> 
> It used to work for me, why?

You are expanding a file glob "*chr4*" in the current directory.  This
will be expanded to match any files in the current directory.  If any
of those files start with a dash character '-' then the string will be
interpreted as an option.

You can see the problem by using echo to print the file glob.

  echo ls -l *chr4*

To avoid it you will need to force an end of option argument
processing or force the string to not start with a dash.

  ls -l -- *chr4*
  ls -l ./*chr4*

Please see this FAQ and the next two related ones after it too.

  http://www.gnu.org/software/coreutils/faq/#How-do-I-remove-files-that-start-with-a-dash_003f

Bob




Added tag(s) moreinfo. Request was from Bob Proulx <bob <at> proulx.com> to control <at> debbugs.gnu.org. (Mon, 01 Oct 2012 16:50:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#12551; Package coreutils. (Tue, 23 Oct 2018 22:08:01 GMT) Full text and rfc822 format available.

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

From: Assaf Gordon <assafgordon <at> gmail.com>
To: 12551 <at> debbugs.gnu.org
Subject: Re: bug#12551: ls -l
Date: Tue, 23 Oct 2018 16:07:02 -0600
close 12551
stop

(triaging old bugs)

On 01/10/12 10:49 AM, Bob Proulx wrote:
> 
> Chen,Wei wrote:
>> When I typed 'ls -l *chr4*' in linux, it gave me this:
>>
>> bash-4.1$  ls -l *chr4*
>> ls: invalid option -- '4'
>> Try `ls --help' for more information.
>>
>> It used to work for me, why?
> 
> You are expanding a file glob "*chr4*" in the current directory.  This
> will be expanded to match any files in the current directory.  If any
> of those files start with a dash character '-' then the string will be
> interpreted as an option.
> 

With no further comments to Bob's explanation,
I'm closing this bug.

-assaf





bug closed, send any further explanations to 12551 <at> debbugs.gnu.org and "Chen,Wei" <weichen <at> mdanderson.org> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 23 Oct 2018 22:08:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 21 Nov 2018 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 268 days ago.

Previous Next


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