[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#11228: Bug in ls?
From: |
Pádraig Brady |
Subject: |
bug#11228: Bug in ls? |
Date: |
Thu, 12 Apr 2012 09:33:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 |
On 04/12/2012 07:53 AM, Chris Jones wrote:
> On Wed, Apr 11, 2012 at 10:49:41PM EDT, Eric Blake wrote:
>
>> tag 11228 notabug
>> thanks
>>
>> On 04/11/2012 06:13 PM, dfm wrote:
>
> [..]
>
>> Indeed - POSIX requires that file names beginning with '.' do not
>> match a glob starting with '*'; if you want to list such files, you
>> have to explicitly match the leading dot.
>
> Is there any way you can list dot & non-dot files whose names share
> a pattern in one pass:
>
> | $ tree -a /tmp/z
> | /tmp/z/
> | ├── bk
> | ├── .bk
> | ├── .bkn
> | └── bkx
>
> Or move, copy, delete, etc.
>
> I tend to do stuff like:
>
> | $ find /tmp/z -name '*bk*' -ls
> | $ mv $(find /tmp/z1 -name '*bk*') /tmp/z2 .. etc.
>
> But that's hardly elegant and since things can get rather complicated,
> it could even prove dangerous when you're doing something potentially
> destructive.
I usually do the above with something like:
(shopt -s dotglob; mv /tmp/z1/*bz* /tmp/z2)
Note find is more general for scripts etc.
as it can deal with an arbitrary amount of files,
but only when used in the form:
find /tmp/z1 -name '*bk*' -print0 | xargs -r0 mv -t /tmp/z2
> P.S. Just following up on the existing thread but this hardly belongs to
> this mailing list. Is there a help-coreutils for issues that are not
> related to a suspected bug?
Well we don't really have a help-coreutils,
but the general coreutils discussion list is:
address@hidden
cheers,
Pádraig.