From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 27 10:50:01 2020 Received: (at submit) by debbugs.gnu.org; 27 Apr 2020 14:50:01 +0000 Received: from localhost ([127.0.0.1]:37796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT557-0002Gx-CY for submit@debbugs.gnu.org; Mon, 27 Apr 2020 10:50:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:36888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT4hx-0007wd-N3 for submit@debbugs.gnu.org; Mon, 27 Apr 2020 10:26:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54366) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jT4hx-0003eT-9k for bug-coreutils@gnu.org; Mon, 27 Apr 2020 10:26:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jT4hw-0005wO-TW for bug-coreutils@gnu.org; Mon, 27 Apr 2020 10:26:05 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:44674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jT4hw-0005wH-Fb for bug-coreutils@gnu.org; Mon, 27 Apr 2020 10:26:04 -0400 Received: by mail-lj1-x236.google.com with SMTP id a21so14892730ljj.11 for ; Mon, 27 Apr 2020 07:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=3Drs5+mbcQnXfWnFM/rRqk6X3b0mVP31/GAvfEowoTc=; b=bdjAjcglmlN47E075jOA+qZcCNX/5EqiJgB2Ju1/P1e6tbpeFvVPptf07qB6RIbKBN eCNRlA5LNbzsOI0EbnbVNvAlN/u3ll79BrL5rvAFaLB28Ax+6Ig7yC62Y8CGFDUwyTSS I9gNqXR5rNC1Vb4xjHgNK7I4fVco5beAy9+V7xEO0qJI40DIdmXGUco7tD/+VuVf2Urr yosOrE6apXzZt3K+9BstUeuDZJo06szd7cr6uz2P1Drc9/1AftXa+J3oOAxpR2b8jJY6 hI6bsBTyGPrI2kt5Zxnj+sr5Ty0o3hAqFmgToz/FDadwjzofBAabE2D5BWw1KPTTfAQJ qfDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3Drs5+mbcQnXfWnFM/rRqk6X3b0mVP31/GAvfEowoTc=; b=DMuNIkf+lOTX8T+fAbi9euDuJcyDUHpy0uomPbK9dknsW+5CdKqvt8NgdF/G+Rx7Bc NQbNigNXl0Nlp2CG/W89ng1N5sTZzYY4EybaEYpXYYTwbcnVp2ZdQwkz0iHXzGDPU7kS NsxbyAOX7UcgHwTWIUQeg7l8DgH3TLEWc1YVoJMc/6LhSOzYUBTRHxyDs5GUMEx0msml OZxHEkzSqm35KcKzvwV3CAyD3OdvychREwjkADwRx3zUqtHO+xVY31Y7ALFp2b/Oih0m Zz62yRqAP/q/wJKIcAfdo7yDNL4fHUor2JxEEhJVZgqYx+0Q5EUahicxvjEuw/pNcMc3 S1Lg== X-Gm-Message-State: AGi0PuZm0W0kDV0/JsEhaosxdILUfX1pPKLmTyPgr9Jq/DV0YvyZXbII lAfPl8U4izTbJ85nwsoIL/o+jxHjqG5PmdDH8nZUVg== X-Google-Smtp-Source: APiQypLAj4Yr3ofhCyzydEY0DMbY8WaXsn02SeahhV8cBUGnHHaZJ4pjAYb0gRP2HoDIrFYUaWKZsRAcUeLN+I0G9oo= X-Received: by 2002:a2e:988f:: with SMTP id b15mr14912481ljj.232.1587997562291; Mon, 27 Apr 2020 07:26:02 -0700 (PDT) MIME-Version: 1.0 From: Jim Clark Date: Mon, 27 Apr 2020 07:25:25 -0700 Message-ID: Subject: the "ls -R *.pdf" command does not search recursively only current dir To: Jim Clark , bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary="0000000000009ac8d705a4467eec" Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=jim.clark.ubuntu@gmail.com; helo=mail-lj1-x236.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::236 X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 27 Apr 2020 10:50:00 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --0000000000009ac8d705a4467eec Content-Type: text/plain; charset="UTF-8" Greetings, I found the ls command when used with a pattern does not search recursively. ls -R *.pdf only searches the current directory and not recursively. -- Thank you, Jim Clark --0000000000009ac8d705a4467eec Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Greetings,

I found the ls command when = used with a pattern does not search recursively.

l= s -R *.pdf=C2=A0
only searches the current directory and not recu= rsively.

--
Thank y= ou,

Jim Clark
--0000000000009ac8d705a4467eec-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 27 11:01:00 2020 Received: (at control) by debbugs.gnu.org; 27 Apr 2020 15:01:00 +0000 Received: from localhost ([127.0.0.1]:37842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT5Fk-0002dn-3F for submit@debbugs.gnu.org; Mon, 27 Apr 2020 11:01:00 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:52108 helo=us-smtp-delivery-1.mimecast.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT5Fi-0002dX-8E for control@debbugs.gnu.org; Mon, 27 Apr 2020 11:00:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587999657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Etiw2ntjhW0qXqOmENuvrl0DzP2MSZzOKjl7N1b6fmU=; b=BNDS7RdOE9r9Imb4lwrzg1z4vjZWzRvL893c6cMjdTxfxDtb/L57BuryCl4hsCJVv6p0cK NotiTos3Rg8HSYdoIDlaaeiIvBS800g8n1BUJot4z/fq4J55B7XmitEbYlBuFTnNWRZ2+f PkTLFQuEO1T9hd4ItIGrqUROto8Qemw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-xL_rWBJoM3q_PBdCy8n20Q-1; Mon, 27 Apr 2020 11:00:55 -0400 X-MC-Unique: xL_rWBJoM3q_PBdCy8n20Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 33CE01899521; Mon, 27 Apr 2020 15:00:54 +0000 (UTC) Received: from [10.10.116.80] (ovpn-116-80.rdu2.redhat.com [10.10.116.80]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8BA5F620AB; Mon, 27 Apr 2020 15:00:53 +0000 (UTC) Subject: Re: bug#40903: the "ls -R *.pdf" command does not search recursively only current dir To: Jim Clark , 40903-done@debbugs.gnu.org References: From: Eric Blake Organization: Red Hat, Inc. Message-ID: <7c7d0481-48e8-1b9b-204f-9eab68f234d5@redhat.com> Date: Mon, 27 Apr 2020 10:00:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tag 40903 notabug thanks On 4/27/20 9:25 AM, Jim Clark wrote: > Greetings, > > I found the ls command when used with a pattern does not search recursively. > > ls -R *.pdf > only searches the current directory and not recursively. You are forgetting that globs expand prior to invoking ls. What you have invoked is something like: ls -R a.pdf b.pdf which says to recursively list all files starting with a.pdf or b.pdf, and descending if any of those files are a directory, but neither a.pdf nor b.pdf is a directory, so there is nothing to descend into. Instead of trying to mess with how globbing interacts with ls, you are better off learning how to use 'find', which does recursion and filtering as its primary goal. In this case, you would use: find . -name '*.pdf' which gives you a recursive listing of all directories under '.', then filters it out to files ending in .pdf. As the action of globbing is done by your shell and not by ls, there is nothing to change in coreutils, so I'm closing this as not a bug. But feel free to respond with further questions on the topic. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org From unknown Thu Jun 19 14:15:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 26 May 2020 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator