From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#62096: 30.0.50; find-dired, dired-goto-file and spaces Date: Fri, 10 Mar 2023 22:20:21 +0000 Message-ID: References: <87edpw1wt3.fsf@ledu-giraud.fr> <877cvofvgg.fsf@gmx.net> <87a60k1nus.fsf@ledu-giraud.fr> <87y1o4zau7.fsf@ledu-giraud.fr> <87356c8hja.fsf@ledu-giraud.fr> <87ttys70mz.fsf@ledu-giraud.fr> <87lek46z7f.fsf@ledu-giraud.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24470"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "62096@debbugs.gnu.org" <62096@debbugs.gnu.org>, Stephen Berman To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 10 23:21:22 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pal73-00067e-CF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Mar 2023 23:21:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pal6v-0003vh-2D; Fri, 10 Mar 2023 17:21:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pal6l-0003q4-Bj for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2023 17:21:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pal6k-0005vc-R6 for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2023 17:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pal6k-0003Vv-Cn for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2023 17:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Mar 2023 22:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62096 X-GNU-PR-Package: emacs Original-Received: via spool by 62096-submit@debbugs.gnu.org id=B62096.167848683613455 (code B ref 62096); Fri, 10 Mar 2023 22:21:02 +0000 Original-Received: (at 62096) by debbugs.gnu.org; 10 Mar 2023 22:20:36 +0000 Original-Received: from localhost ([127.0.0.1]:56093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pal6H-0003Uu-AL for submit@debbugs.gnu.org; Fri, 10 Mar 2023 17:20:36 -0500 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:28752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pal6B-0003Ui-Ne for 62096@debbugs.gnu.org; Fri, 10 Mar 2023 17:20:31 -0500 Original-Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32ALhskl026765; Fri, 10 Mar 2023 22:20:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=kG5Tvz+iHuPbrGPew1XVcdDLQsWSSHejCQqnLCnsWnk=; b=Y6SXGXtCOYOTENdSc2Yuti1sA6WFcIS6ADNIA12z3a/OOPd1nINnfojbsMkKg7fsumBD qPNYIonn8Lld7Ef+3c2C8P+Y7YVPkkrgCZsWJxoOr3v0NGHSYE5uWuwpMs8dmiVlORRj H8Wnfk7MtJ7MyINFTzi3QWIE9OCYxkdePrspNAtPDyChtLkOe+QZygtPzka4nxldf5V1 5qNjYe3YaZRwWI9nmNbRsb+22rc8ftrZeNjvwxoCbHVHCFROS9x4/VqGteif18yVkFFm VEnJWndK1zzDqPsw4YkH+URjCezwlOma0TfQPTu4PEmd2zt9b5KGJ/98UxidY/G7YFHj Tw== Original-Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p417cp9qx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Mar 2023 22:20:26 +0000 Original-Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 32ALvM75015678; Fri, 10 Mar 2023 22:20:25 GMT Original-Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2049.outbound.protection.outlook.com [104.47.56.49]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3p6g9x6qyy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Mar 2023 22:20:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lh/HGenWzx6judWfcOUM9I59k5AUE1SEK7aqHMOSXWgW0b/7gM/NcHvyjStoW46tg1TUhQ7boC7sixRdpnxyw7CV0+naq06dOjhdGXEhQqAjehpL7htUdvyKACRjTYiXZqsqToQphWwRtW8EmiS1wXLUUW5dcuCTWJRogtWUA2+xPpXIvP7DMWQ6wGkzrhA5wiQSVe4ltaeuGY6VV/DE0M+GEushRtsV/LYjXQ9mhBvOoLgTngTolTsJfYgCfjTKqWie7we7VSbKbrXDbRHXZdghuGUPNB7Gt6ktLN6Q1zV1P0jBuo/4vSf7tYGY5iPhUy+E+t6xplBR8Yo1+xy2Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kG5Tvz+iHuPbrGPew1XVcdDLQsWSSHejCQqnLCnsWnk=; b=hcihKvc34yfbybqQkpBQXx5Gm4uagg05RVTY+2jV3nARXTnrfClHSyEHsni0XvmFW/69pQr6zwifeH9x1XwMwhqcpfRme8cyy6BIVjLp9bBCZQyoFtbfKpAj1hRSqbfC+BxB/aQ3uq+noI/WDdp5PZqCuf+UpGVslM+R2hRg/yRQKezbi/ex9mkIwy1XaK2HAzKJ3OjXb4tc9CwiTqI5ln1PmJ0FPuZqfVN1IyYPNF1FkOtrUlh1XJ0bwTs5MTJKMf4KKYjCG6mOfNpuKcg8dLrl65J2FY3o6GBobmRq27Oat8uFUCia1yfMvOp5KfA+vNFaeQBUsfY8Xws19vv5fg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kG5Tvz+iHuPbrGPew1XVcdDLQsWSSHejCQqnLCnsWnk=; b=ZiPwDyWfFHp5xGuJLCAEqPj+fLnxVQN44uxoie3JqDKNmp+E1oOcwr9USCKW8ojCpGYzeOZOruHy8aTSgeLIEKQ1DffMQ9y95PQU9SdAIuZx5u3gnD0xJBNZSVRdok0DmHbJbvYQbYa5GNibNHvz+700zNrmBt77aR4aKRqED1A= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by CH0PR10MB5307.namprd10.prod.outlook.com (2603:10b6:610:c0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.20; Fri, 10 Mar 2023 22:20:21 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::32a3:707b:94c1:6e29]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::32a3:707b:94c1:6e29%9]) with mapi id 15.20.6178.019; Fri, 10 Mar 2023 22:20:21 +0000 Thread-Topic: [External] : Re: bug#62096: 30.0.50; find-dired, dired-goto-file and spaces Thread-Index: AQHZU5w0iPjoKy1ZV0C1EOBomJ8OP670lVZQ In-Reply-To: <87lek46z7f.fsf@ledu-giraud.fr> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|CH0PR10MB5307:EE_ x-ms-office365-filtering-correlation-id: 156f7be8-e10f-4dcf-61de-08db21b5a301 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MeNeLMVrppAgRhk4Fo5E4e7chmFYoRBKY/Nl7XOaurM2I+J754A5v1KJLiyGKkmuTbiwfzCqQu9pPydjC/LuP8xs01d5qL8RPFYlrJLV2j02yQH4FKMTh8dbELWqUaoD3am52VFJHQujbMTbedtHjr2qQ63eQ4rpU+XZ7guc3doLG7vv3NiZFCyFBPgQ1S7sgkxKkkcJPFf34560QNFKNh3suDiSwhLgSq0d/2mrgh+BSHbfbZyWhxyRNnHgLaSoVv3PtCHjGhWdHePh5CavtZ0cjuXIrbdjHOqHGgcAzjv0lZZgzsLQie6rCzo/MfivHrliPmMxFWiuuyeNKXeSIZOBvs9brWr+2vPFdVoiJLGJ80Sv7/2iDySyk4GpxTx4GqYpl/ul57O2fGgYT4l3pf0HR+26yLG+erJwLIxzIwebJ67YQu+0oa5KvoaeKeNeQf5CZQBexatqjFU0SqsVl88c/hCwWl1GtGiI5vOh5w9XyG6ZYp4w2YxWZ4032vo8wkCqfgJUsYtGhwur9S7QSKl7CvyCu0KeJ+o8Os8PYnzlD+iY1k74mVUiKJuWiCSuvBh4R3IoEzo7RSZm7uo5twBxctempvmuIOzlu4G6Ni2m5QOFAawjX3/2dJDZefXQgbluJ7AJYocCIMtblZo/iQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(376002)(39860400002)(346002)(136003)(366004)(396003)(451199018)(33656002)(83380400001)(6506007)(7696005)(26005)(186003)(9686003)(71200400001)(966005)(52536014)(66476007)(76116006)(8676002)(86362001)(66556008)(64756008)(66446008)(8936002)(41300700001)(66946007)(4326008)(2906002)(30864003)(5660300002)(6916009)(44832011)(38070700005)(122000001)(38100700002)(55016003)(316002)(478600001)(54906003)(84970400001)(559001)(579004); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: HFoukkuExXSidIBqh0woX39qQwttK+bysSdVPfIFIX9ob1J/194uv5iOwEMqjUXdCY+PeeoN0jRWM7tj8BOU4r+3gAfo/va6TcHbZmfdU7K8h7Fsgp2UTwWaHcZtdJBbpsHIU2n02KnQm9yxt8BWZ5DlsxMy0wNzu8+ElfZxBIBppiKl8VAMA135a+J08asyAelL+aOmsJ38tefrwbrLZ/lAcMxmXXQEPuWfmQU9iC1AvWN9lRbb9bTD4/NcIGeppvcjml3ZcqTpUoO63gkTiJqJRlXgI+AzY2KQD6rgbdaVs1exQxJOtxjBnFQFh9nMXyOf7+TMSsuzkBu5pR5Vh0kQMl6pmRyU0XG60EupGRX0NtARwAtC0XmdoI9Nr2TZ1MN+FIwfHyvFgoKqnYy0fq77f45njhAK0/IDJD2KqEV9rJ7Me2rEIFkTXA41lByojGkNPlelZaXyYslDJEB7jIzApLzCVSIGUH6tfph4yhEizkSk3x6bY4TmbzWUqoNW3Afb0eX4bu4KyzyxCVsVgcYIfHwCKm68Z+oo+Ifwtec+UkppHkGmbVimJshV08zRm5sKBYWv0zQpsPWz6B6Rz4uD4se+V87hNbvE/HZanX50x0NcAkHUpJMwkNubI4QPb6Uo0z2KAZhKhqKDEXbL2zR0nz1MXbFQKHPcShZp2tjfa9Y2kwxfNHgecuXtCibXF/9JV6Mr4ZSH3iv7qWcToY6Cb1MKRVvC5luNemBKR5lh1gWUqbi1awv1MP uzrNCnJQyu9M6hXHObxy4pkBCNC1m/+l+8CfzAs3kKcvPKxqjs3mPFTm/iG2e9TkDgFxBC4t5iuXIK28rmsIhlQoQOBy4z4QbK X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ohECPEtxLlqnA8cERvF1qYPcqsJH/NnqIIA2W5RrEzUNaBVXfhK8eRD0x/847ffOKcmFDLzxlHV2kktFg3EuumlYsGL6yhl+l1Znj0S06gW96ksDJXUl/ouGV0Dd58LxLn8w32S99MqSR3bWBiNQoQWXUsH7ZbsPjHfSbEQAevBXLNe/ZYxi1g5oCNYYKozx0O5a4UbqpGp/B3xWN453GWhRH83BuYNmpLum/jB/LNSBGmGclgbiYppBIT4P+MMeYPjBvzgNAjQ2zeEq+eKaHE6FArYP6acznu4bnhm89E7BjJiWNihI84qw0DGWjjU7YeG5XVq/WzZKiniCLQ2cOwDP3kvtcTBzGVAngVd5LsvPSmgKqEpb0QvHR2JX6SGBF6L/HvuMlpGnoSdrOEpAD7qna53a3LCVQT1WkwrPzzV7WIHFI/1NbgCBFz5EsQmsPpsEWLfVSUCI4rSfC+hkiLHwt03LC1adPOfexw/21CIbJmyVOnMOlY0R9Qi9+hqpM2hIEEYeZ1S0sJppxnT0fdRt+EDe0yP2ajc1h6LZr/lsVqh0X7mYqErsA/S3pI+dVkTufGLQOkt+xB96MqUnQx8aKgd9GKwkZugPl2tBXjgmCF45oaS5ChGQWUQJqJ2nblEyRKSV8RrqlqkX00F6ll538rE0KLSxK/RluoJ7QeBDMRwAcxpLNVBDrEOYKz8vnNdwTH/zF8A3lxOm6OnGiADm91BDr4D42fgocgPdNsZKWo quze6gK+PJYdpSiXDgv4laflOM9YkX67A/Q/LQJZm4sOdQXoWoJ7blOUjEHIuuO/IC2JB7jf15c/SJ1CV5Lcgwbyvla/Obi797 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 156f7be8-e10f-4dcf-61de-08db21b5a301 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Mar 2023 22:20:21.0318 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7zcNe6c8donXRXjKJJWrnNxnRRwNJXRMK9AUfIuFFuIvfTH4zFAseoX2jJF5j+yrWlsfnq+aTnFomOlOzw57Gg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5307 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-10_10,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303100177 X-Proofpoint-GUID: q2u0Dj8vengg5R4dOsXwWJyE2Oz2NYLg X-Proofpoint-ORIG-GUID: q2u0Dj8vengg5R4dOsXwWJyE2Oz2NYLg X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257730 Archived-At: > > Some old Cygwin distribution from 2017. > > `C-h v cygwin-mount' tells me "1.4.8". >=20 > Thanks. If it works, could you send me (off-list if you prefer) the > content of your `M-x man find'? FIND(1) General Commands Manual FIND= (1) NAME find - search for files in a directory hierarchy SYNOPSIS find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point.= ..] [expression] DESCRIPTION This manual page documents the GNU version of find. GNU find searc= hes the directory tree rooted at each given starting-point by evaluat= ing the given expression from left to right, according to the rules = of precedence (see section OPERATORS), until the outcome is known (= the left hand side is false for and operations, true for or), at wh= ich point find moves on to the next file name. If no starting-point= is specified, `.' is assumed. If you are using find in an environment where security is import= ant (for example if you are using it to search directories that = are writable by other users), you should read the "Security Consideratio= ns" chapter of the findutils documentation, which is called Finding Fi= les and comes with findutils. That document also includes a lot m= ore detail and discussion than this manual page, so you may find it a m= ore useful source of information. OPTIONS The -H, -L and -P options control the treatment of symbolic lin= ks. Command-line arguments following these are taken to be names of fi= les or directories to be examined, up to the first argument that beg= ins with `-', or the argument `(' or `!'. That argument and any follow= ing arguments are taken to be the expression describing what is to = be searched for. If no paths are given, the current directory is us= ed. If no expression is given, the expression -print is used (but = you should probably consider using -print0 instead, anyway). This manual page talks about `options' within the expression li= st. These options control the behaviour of find but are specified imme= di- ately after the last path name. The five `real' options -H, -L, -P,= -D and -O must appear before the first path name, if at all. A dou= ble dash -- can also be used to signal that any remaining arguments are = not options (though ensuring that all start points begin with either `= ./' or `/' is generally safer if you use wildcards in the list of st= art points). -P Never follow symbolic links. This is the default behavio= ur. When find examines or prints information a file, and the file= is a symbolic link, the information used shall be taken from = the properties of the symbolic link itself. -L Follow symbolic links. When find examines or prints informat= ion about files, the information used shall be taken from the pr= op- erties of the file to which the link points, not from the l= ink itself (unless it is a broken symbolic link or find is unable= to examine the file to which the link points). Use of this opt= ion implies -noleaf. If you later use the -P option, -noleaf w= ill still be in effect. If -L is in effect and find discover= s a symbolic link to a subdirectory during its search, the subdir= ec- tory pointed to by the symbolic link will be searched. When the -L option is in effect, the -type predicate will alw= ays match against the type of the file that a symbolic link poi= nts to rather than the link itself (unless the symbolic link is b= ro- ken). Actions that can cause symbolic links to become bro= ken while find is executing (for example -delete) can give rise= to confusing behaviour. Using -L causes the -lname and -iln= ame predicates always to return false. -H Do not follow symbolic links, except while processing the c= om- mand line arguments. When find examines or prints informat= ion about files, the information used shall be taken from the pr= op- erties of the symbolic link itself. The only exception to t= his behaviour is when a file specified on the command line is a s= ym- bolic link, and the link can be resolved. For that situati= on, the information used is taken from whatever the link points= to (that is, the link is followed). The information about the l= ink itself is used as a fallback if the file pointed to by the s= ym- bolic link cannot be examined. If -H is in effect and one = of the paths specified on the command line is a symbolic link t= o a directory, the contents of that directory will be exami= ned (though of course -maxdepth 0 would prevent this). If more than one of -H, -L and -P is specified, each overrides the o= th- ers; the last one appearing on the command line takes effect. Since= it is the default, the -P option should be considered to be in eff= ect unless either -H or -L is specified. GNU find frequently stats files during the processing of the comm= and line itself, before any searching has begun. These options also aff= ect how those arguments are processed. Specifically, there are a number= of tests that compare files listed on the command line against a file= we are currently considering. In each case, the file specified on = the command line will have been examined and some of its properties w= ill have been saved. If the named file is in fact a symbolic link, and = the -P option is in effect (or if neither -H nor -L were specified), = the information used for the comparison will be taken from the propert= ies of the symbolic link. Otherwise, it will be taken from the propert= ies of the file the link points to. If find cannot follow the link (= for example because it has insufficient privileges or the link points t= o a nonexistent file) the properties of the link itself will be used. When the -H or -L options are in effect, any symbolic links listed = as the argument of -newer will be dereferenced, and the timestamp will= be taken from the file to which the symbolic link points. The same c= on- sideration applies to -newerXY, -anewer and -cnewer. The -follow option has a similar effect to -L, though it takes eff= ect at the point where it appears (that is, if -L is not used but -fol= low is, any symbolic links appearing after -follow on the command line w= ill be dereferenced, and those before it will not). -D debugoptions Print diagnostic information; this can be helpful to diagn= ose problems with why find is not doing what you want. The list= of debug options should be comma separated. Compatibility of = the debug options is not guaranteed between releases of finduti= ls. For a complete list of valid debug options, see the output = of find -D help. Valid debug options include help Explain the debugging options tree Show the expression tree in its original and optimi= sed form. stat Print messages as files are examined with the stat = and lstat system calls. The find program tries to minim= ise such calls. opt Prints diagnostic information relating to the optimi= sa- tion of the expression tree; see the -O option. rates Prints a summary indicating how often each predicate s= uc- ceeded or failed. -Olevel Enables query optimisation. The find program reorders tests= to speed up execution while preserving the overall effect; that = is, predicates with side effects are not reordered relative to e= ach other. The optimisations performed at each optimisation le= vel are as follows. 0 Equivalent to optimisation level 1. 1 This is the default optimisation level and corresponds= to the traditional behaviour. Expressions are reordered= so that tests based only on the names of files (for exam= ple -name and -regex) are performed first. 2 Any -type or -xtype tests are performed after any te= sts based only on the names of files, but before any te= sts that require information from the inode. On many mod= ern versions of Unix, file types are returned by readdi= r() and so these predicates are faster to evaluate than pr= ed- icates which need to stat the file first. If you use = the -fstype FOO predicate and specify a filesystem type = FOO which is not known (that is, present in `/etc/mtab') = at the time find starts, that predicate is equivalent= to -false. 3 At this optimisation level, the full cost-based qu= ery optimiser is enabled. The order of tests is modified= so that cheap (i.e. fast) tests are performed first and m= ore expensive ones are performed later, if necessary. Wit= hin each cost band, predicates are evaluated earlier or la= ter according to whether they are likely to succeed or n= ot. For -o, predicates which are likely to succeed are eva= lu- ated earlier, and for -a, predicates which are likely= to fail are evaluated earlier. The cost-based optimiser has a fixed idea of how likely = any given test is to succeed. In some cases the probability ta= kes account of the specific nature of the test (for example, -typ= e f is assumed to be more likely to succeed than -type c). = The cost-based optimiser is currently being evaluated. If it d= oes not actually improve the performance of find, it will be remo= ved again. Conversely, optimisations that prove to be reliab= le, robust and effective may be enabled at lower optimisation lev= els over time. However, the default behaviour (i.e. optimisat= ion level 1) will not be changed in the 4.3.x release series. = The findutils test suite runs all the tests on find at each opti= mi- sation level and ensures that the result is the same. EXPRESSION The part of the command line after the list of starting points is = the expression. This is a kind of query specification describing how = we match files and what we do with the files that were matched. = An expression is composed of a sequence of things: Tests Tests return a true or false value, usually on the basis of s= ome property of a file we are considering. The -empty test = for example is true only when the current file is empty. Actions Actions have side effects (such as printing something on = the standard output) and return either true or false, usually ba= sed on whether or not they are successful. The -print action = for example prints the name of the current file on the standard o= ut- put. Global options Global options affect the operation of tests and actions spe= ci- fied on any part of the command line. Global options alw= ays return true. The -depth option for example makes find trave= rse the file system in a depth-first order. Positional options Positional optiona affect only tests or actions which fol= low them. Positional options always return true. The -regext= ype option for example is positional, specifying the regular expr= es- sion dialect for regulat expressions occurring later on the c= om- mand line. Operators Operators join together the other items within the expressi= on. They include for example -o (meaning logical OR) and -a (mean= ing logical AND). Where an operator is missing, -a is assumed. If the whole expression contains no actions other than -prune= or -print, -print is performed on all files for which the whole express= ion is true. The -delete action also acts like an option (since it implies -depth= ). POSITIONAL OPTIONS Positional options always return true. They affect only tests occ= ur- ring later on the command line. -daystart Measure times (for -amin, -atime, -cmin, -ctime, -mmin, = and -mtime) from the beginning of today rather than from 24 ho= urs ago. This option only affects tests which appear later on = the command line. -follow Deprecated; use the -L option instead. Dereference symbo= lic links. Implies -noleaf. The -follow option affects only th= ose tests which appear after it on the command line. Unless the= -H or -L option has been specified, the position of the -fol= low option changes the behaviour of the -newer predicate; any fi= les listed as the argument of -newer will be dereferenced if t= hey are symbolic links. The same consideration applies to -newer= XY, -anewer and -cnewer. Similarly, the -type predicate will alw= ays match against the type of the file that a symbolic link poi= nts to rather than the link itself. Using -follow causes the -ln= ame and -ilname predicates always to return false. -regextype type Changes the regular expression syntax understood by -regex = and -iregex tests which occur later on the command line. To = see which regular expression types are known, use -regextype he= lp. The Texinfo documentation (see SEE ALSO) explains the meaning= of and differences between the various types of regular expressi= on. -warn, -nowarn Turn warning messages on or off. These warnings apply only= to the command line usage, not to any conditions that find mi= ght encounter when it searches directories. The default behavi= our corresponds to -warn if standard input is a tty, and to -now= arn otherwise. If a warning message relating to command-line us= age is produced, the exit status of find is not affected. If = the POSIXLY_CORRECT environment variable is set, and -warn is a= lso used, it is not specified which, if any, warnings will = be active. GLOBAL OPTIONS Global options always return true. Global options take effect even = for tests which occurr earlier on the command line. To prevent confusi= on, global options should specified on the command-line after the list= of start points, just before the first test, positional option or acti= on. If you specify a global option in some other place, find will issu= e a warning message explaining that this can be confusing. The global options occur after the list of start points, and so are = not the same kind of option as -L, for example. -d A synonym for -depth, for compatibility with FreeBSD, NetB= SD, MacOS X and OpenBSD. -depth Process each directory's contents before the directory itse= lf. The -delete action also implies -depth. -help, --help Print a summary of the command-line usage of find and exit. -ignore_readdir_race Normally, find will emit an error message when it fails to s= tat a file. If you give this option and a file is deleted betw= een the time find reads the name of the file from the directory = and the time it tries to stat the file, no error message will = be issued. This also applies to files or directories whose na= mes are given on the command line. This option takes effect at = the time the command line is read, which means that you can= not search one part of the filesystem with this option on and p= art of it with this option off (if you need to do that, you w= ill need to issue two find commands instead, one with the option = and one without it). -maxdepth levels Descend at most levels (a non-negative integer) levels of dir= ec- tories below the starting-points. -maxdepth 0 means only apply the tests and actions to the starting-poi= nts themselves. -mindepth levels Do not apply any tests or actions at levels less than levels= (a non-negative integer). -mindepth 1 means process all fi= les except the starting-points. -mount Don't descend directories on other filesystems. An altern= ate name for -xdev, for compatibility with some other versions = of find. -noignore_readdir_race Turns off the effect of -ignore_readdir_race. -noleaf Do not optimize by assuming that directories contain 2 fe= wer subdirectories than their hard link count. This option = is needed when searching filesystems that do not follow the U= nix directory-link convention, such as CD-ROM or MS-DOS filesyst= ems or AFS volume mount points. Each directory on a normal U= nix filesystem has at least 2 hard links: its name and its = `.' entry. Additionally, its subdirectories (if any) each hav= e a `..' entry linked to that directory. When find is examining= a directory, after it has statted 2 fewer subdirectories than = the directory's link count, it knows that the rest of the entries= in the directory are non-directories (`leaf' files in the direct= ory tree). If only the files' names need to be examined, there = is no need to stat them; this gives a significant increase= in search speed. -version, --version Print the find version number and exit. -xdev Don't descend directories on other filesystems. TESTS Some tests, for example -newerXY and -samefile, allow compari= son between the file currently being examined and some reference file sp= ec- ified on the command line. When these tests are used, the interpre= ta- tion of the reference file is determined by the options -H, -L and= -P and any previous -follow, but the reference file is only examined on= ce, at the time the command line is parsed. If the reference file can= not be examined (for example, the stat(2) system call fails for it), = an error message is issued, and find exits with a nonzero status. Numeric arguments can be specified as +n for greater than n, -n for less than n, n for exactly n. -amin n File was last accessed n minutes ago. -anewer file File was last accessed more recently than file was modified. = If file is a symbolic link and the -H option or the -L option is= in effect, the access time of the file it points to is always us= ed. -atime n File was last accessed n*24 hours ago. When find figures = out how many 24-hour periods ago the file was last accessed, = any fractional part is ignored, so to match -atime +1, a file has= to have been accessed at least two days ago. -cmin n File's status was last changed n minutes ago. -cnewer file File's status was last changed more recently than file was mo= di- fied. If file is a symbolic link and the -H option or the= -L option is in effect, the status-change time of the file = it points to is always used. -ctime n File's status was last changed n*24 hours ago. See the comme= nts for -atime to understand how rounding affects the interpretat= ion of file status change times. -empty File is empty and is either a regular file or a directory. -executable Matches files which are executable and directories which = are searchable (in a file name resolution sense). This takes i= nto account access control lists and other permissions artefa= cts which the -perm test ignores. This test makes use of = the access(2) system call, and so can be fooled by NFS servers wh= ich do UID mapping (or root-squashing), since many systems implem= ent access(2) in the client's kernel and so cannot make use of = the UID mapping information held on the server. Because this t= est is based only on the result of the access(2) system call, th= ere is no guarantee that a file for which this test succeeds = can actually be executed. -false Always false. -fstype type File is on a filesystem of type type. The valid filesys= tem types vary among different versions of Unix; an incomplete l= ist of filesystem types that are accepted on some version of Unix= or another is: ufs, 4.2, 4.3, nfs, tmp, mfs, S51K, S52K. You = can use -printf with the %F directive to see the types of y= our filesystems. -gid n File's numeric group ID is n. -group gname File belongs to group gname (numeric group ID allowed). -ilname pattern Like -lname, but the match is case insensitive. If the = -L option or the -follow option is in effect, this test retu= rns false unless the symbolic link is broken. -iname pattern Like -name, but the match is case insensitive. For example, = the patterns `fo*' and `F??' match the file names `Foo', `FO= O', `foo', `fOo', etc. The pattern `*foo*` will also match a f= ile called '.foobar'. -inum n File has inode number n. It is normally easier to use = the -samefile test instead. -ipath pattern Like -path. but the match is case insensitive. -iregex pattern Like -regex, but the match is case insensitive. -iwholename pattern See -ipath. This alternative is less portable than -ipath. -links n File has n links. -lname pattern File is a symbolic link whose contents match shell pattern p= at- tern. The metacharacters do not treat `/' or `.' specially. = If the -L option or the -follow option is in effect, this t= est returns false unless the symbolic link is broken. -mmin n File's data was last modified n minutes ago. -mtime n File's data was last modified n*24 hours ago. See the comme= nts for -atime to understand how rounding affects the interpretat= ion of file modification times. -name pattern Base of file name (the path with the leading director= ies removed) matches shell pattern pattern. Because the lead= ing directories are removed, the file names considered for a ma= tch with -name will never include a slash, so `-name a/b' will ne= ver match anything (you probably need to use -path instead).= A warning is issued if you try to do this, unless the environm= ent variable POSIXLY_CORRECT is set. The metacharacters (`*', `= ?', and `[]') match a `.' at the start of the base name (this is= a change in findutils-4.2.2; see section STANDARDS CONFORMA= NCE below). To ignore a directory and the files under it, = use -prune; see an example in the description of -path. Braces = are not recognised as being special, despite the fact that s= ome shells including Bash imbue braces with a special meaning= in shell patterns. The filename matching is performed with the = use of the fnmatch(3) library function. Don't forget to encl= ose the pattern in quotes in order to protect it from expansion = by the shell. -newer file File was modified more recently than file. If file is a s= ym- bolic link and the -H option or the -L option is in effect, = the modification time of the file it points to is always used. -newerXY reference Succeeds if timestamp X of the file being considered is ne= wer than timestamp Y of the file reference. The letters X and= Y can be any of the following letters: a The access time of the file reference B The birth time of the file reference c The inode status change time of reference m The modification time of the file reference t reference is interpreted directly as a time Some combinations are invalid; for example, it is invalid fo= r X to be t. Some combinations are not implemented on all syste= ms; for example B is not supported on all systems. If an invalid= or unsupported combination of XY is specified, a fatal er= ror results. Time specifications are interpreted as for the ar= gu- ment to the -d option of GNU date. If you try to use the bi= rth time of a reference file, and the birth time cannot be det= er- mined, a fatal error message results. If you specify a t= est which refers to the birth time of files being examined, t= his test will fail for any files where the birth time is unknown. -nogroup No group corresponds to file's numeric group ID. -nouser No user corresponds to file's numeric user ID. -path pattern File name matches shell pattern pattern. The metacharacters = do not treat `/' or `.' specially; so, for example, find . -path "./sr*sc" will print an entry for a directory called `./src/misc' (if = one exists). To ignore a whole directory tree, use -prune rat= her than checking every file in the tree. For example, to skip = the directory `src/emacs' and all files and directories under = it, and print the names of the other files found, do something l= ike this: find . -path ./src/emacs -prune -o -print Note that the pattern match test applies to the whole file na= me, starting from one of the start points named on the command li= ne. It would only make sense to use an absolute path name here = if the relevant start point is also an absolute path. This me= ans that this command will never match anything: find bar -path /foo/bar/myfile -print Find compares the -path argument with the concatenation of= a directory name and the base name of the file it's examini= ng. Since the concatenation will never end with a slash, -path ar= gu- ments ending in a slash will match nothing (except perhap= s a start point specified on the command line). The predicate -p= ath is also supported by HP-UX find and will be in a forthcom= ing version of the POSIX standard. -perm mode File's permission bits are exactly mode (octal or symboli= c). Since an exact match is required, if you want to use this f= orm for symbolic modes, you may have to specify a rather comp= lex mode string. For example `-perm g=3Dw' will only match = files which have mode 0020 (that is, ones for which group write p= er- mission is the only permission set). It is more likely that = you will want to use the `/' or `-' forms, for example `-perm -g= =3Dw', which matches any file with group write permission. See = the EXAMPLES section for some illustrative examples. -perm -mode All of the permission bits mode are set for the file. Symbo= lic modes are accepted in this form, and this is usually the way= in which you would want to use them. You must specify `u', `g' = or `o' if you use a symbolic mode. See the EXAMPLES section = for some illustrative examples. -perm /mode Any of the permission bits mode are set for the file. Symbo= lic modes are accepted in this form. You must specify `u', `g'= or `o' if you use a symbolic mode. See the EXAMPLES section = for some illustrative examples. If no permission bits in mode = are set, this test matches any file (the idea here is to be cons= is- tent with the behaviour of -perm -000). -perm +mode This is no longer supported (and has been deprecated si= nce 2005). Use -perm /mode instead. -readable Matches files which are readable. This takes into acco= unt access control lists and other permissions artefacts which = the -perm test ignores. This test makes use of the access(2) sys= tem call, and so can be fooled by NFS servers which do UID mapp= ing (or root-squashing), since many systems implement access(2) = in the client's kernel and so cannot make use of the UID mapp= ing information held on the server. -regex pattern File name matches regular expression pattern. This is a ma= tch on the whole path, not a search. For example, to match a f= ile named `./fubar3', you can use the regular expression `.*bar.'= or `.*b.*3', but not `f.*r3'. The regular expressions underst= ood by find are by default Emacs Regular Expressions, but this = can be changed with the -regextype option. -samefile name File refers to the same inode as name. When -L is in effe= ct, this can include symbolic links. -size n[cwbkMG] File uses n units of space, rounding up. The following suffi= xes can be used: `b' for 512-byte blocks (this is the default if no suffix= is used) `c' for bytes `w' for two-byte words `k' for Kilobytes (units of 1024 bytes) `M' for Megabytes (units of 1048576 bytes) `G' for Gigabytes (units of 1073741824 bytes) The size does not count indirect blocks, but it does co= unt blocks in sparse files that are not actually allocated. Bear= in mind that the `%k' and `%b' format specifiers of -printf han= dle sparse files differently. The `b' suffix always deno= tes 512-byte blocks and never 1 Kilobyte blocks, which is differ= ent to the behaviour of -ls. The + and - prefixes signify grea= ter than and less than, as usual, but bear in mind that the size = is rounded up to the next unit (so a 1-byte file is not matched= by -size -1M). -true Always true. -type c File is of type c: b block (buffered) special c character (unbuffered) special d directory p named pipe (FIFO) f regular file l symbolic link; this is never true if the -L option or = the -follow option is in effect, unless the symbolic link= is broken. If you want to search for symbolic links when= -L is in effect, use -xtype. s socket D door (Solaris) -uid n File's numeric user ID is n. -used n File was last accessed n days after its status was last chang= ed. -user uname File is owned by user uname (numeric user ID allowed). -wholename pattern See -path. This alternative is less portable than -path. -writable Matches files which are writable. This takes into acco= unt access control lists and other permissions artefacts which = the -perm test ignores. This test makes use of the access(2) sys= tem call, and so can be fooled by NFS servers which do UID mapp= ing (or root-squashing), since many systems implement access(2)= in the client's kernel and so cannot make use of the UID mapp= ing information held on the server. -xtype c The same as -type unless the file is a symbolic link. For s= ym- bolic links: if the -H or -P option was specified, true if = the file is a link to a file of type c; if the -L option has b= een given, true if c is `l'. In other words, for symbolic lin= ks, -xtype checks the type of the file that -type does not check. -context pattern (SELinux only) Security context of the file matches glob p= at- tern. ACTIONS -delete Delete files; true if removal succeeded. If the removal fail= ed, an error message is issued. If -delete fails, find's exit s= ta- tus will be nonzero (when it eventually exits). Use of -del= ete automatically turns on the `-depth' option. Warnings: Don't forget that the find command line is evalua= ted as an expression, so putting -delete first will make find try= to delete everything below the starting points you specified. W= hen testing a find command line that you later intend to use w= ith -delete, you should explicitly specify -depth in order to av= oid later surprises. Because -delete implies -depth, you can= not usefully use -prune and -delete together. -exec command ; Execute command; true if 0 status is returned. All follow= ing arguments to find are taken to be arguments to the command un= til an argument consisting of `;' is encountered. The string `= {}' is replaced by the current file name being processed everywh= ere it occurs in the arguments to the command, not just in argume= nts where it is alone, as in some versions of find. Both of th= ese constructions might need to be escaped (with a `\') or quoted= to protect them from expansion by the shell. See the EXAMPLES s= ec- tion for examples of the use of the -exec option. The specif= ied command is run once for each matched file. The command is e= xe- cuted in the starting directory. There are unavoidable se= cu- rity problems surrounding use of the -exec action; you sho= uld use the -execdir option instead. -exec command {} + This variant of the -exec action runs the specified command= on the selected files, but the command line is built by append= ing each selected file name at the end; the total number of invo= ca- tions of the command will be much less than the number = of matched files. The command line is built in much the same = way that xargs builds its command lines. Only one instance of `= {}' is allowed within the command. The command is executed in = the starting directory. If find encounters an error, this can so= me- times cause an immediate exit, so some pending commands may = not be run at all. This variant of -exec always returns true. -execdir command ; -execdir command {} + Like -exec, but the specified command is run from the subdir= ec- tory containing the matched file, which is not normally = the directory in which you started find. This a much more sec= ure method for invoking commands, as it avoids race conditions d= ur- ing resolution of the paths to the matched files. As with = the -exec action, the `+' form of -execdir will build a command l= ine to process more than one matched file, but any given invocat= ion of command will only list files that exist in the same subdir= ec- tory. If you use this option, you must ensure that your $P= ATH environment variable does not reference `.'; otherwise,= an attacker can run any commands they like by leaving an approp= ri- ately-named file in a directory in which you will run -execd= ir. The same applies to having entries in $PATH which are empty = or which are not absolute directory names. If find encounters= an error, this can sometimes cause an immediate exit, so some pe= nd- ing commands may not be run at all. The result of the act= ion depends on whether the + or the ; variant is being us= ed; -execdir command {} + always returns true, while -execdir c= om- mand {} ; returns true only if command returns 0. -fls file True; like -ls but write to file like -fprint. The output f= ile is always created, even if the predicate is never matched. = See the UNUSUAL FILENAMES section for information about how unus= ual characters in filenames are handled. -fprint file True; print the full file name into file file. If file does = not exist when find is run, it is created; if it does exist, it = is truncated. The file names `/dev/stdout' and `/dev/stderr' = are handled specially; they refer to the standard output and st= an- dard error output, respectively. The output file is always c= re- ated, even if the predicate is never matched. See the UNUS= UAL FILENAMES section for information about how unusual charact= ers in filenames are handled. -fprint0 file True; like -print0 but write to file like -fprint. The out= put file is always created, even if the predicate is never match= ed. See the UNUSUAL FILENAMES section for information about = how unusual characters in filenames are handled. -fprintf file format True; like -printf but write to file like -fprint. The out= put file is always created, even if the predicate is never match= ed. See the UNUSUAL FILENAMES section for information about = how unusual characters in filenames are handled. -ls True; list current file in ls -dils format on standard outp= ut. The block counts are of 1K blocks, unless the environment va= ri- able POSIXLY_CORRECT is set, in which case 512-byte blocks = are used. See the UNUSUAL FILENAMES section for information ab= out how unusual characters in filenames are handled. -ok command ; Like -exec but ask the user first. If the user agrees, run = the command. Otherwise just return false. If the command is r= un, its standard input is redirected from /dev/null. The response to the prompt is matched against a pair of regu= lar expressions to determine if it is an affirmative or negat= ive response. This regular expression is obtained from the sys= tem if the `POSIXLY_CORRECT' environment variable is set, or oth= er- wise from find's message translations. If the system has = no suitable definition, find's own definition will be used. = In either case, the interpretation of the regular expression its= elf will be affected by the environment variables 'LC_CTYPE' (ch= ar- acter classes) and 'LC_COLLATE' (character ranges and equi= va- lence classes). -okdir command ; Like -execdir but ask the user first in the same way as for -= ok. If the user does not agree, just return false. If the comm= and is run, its standard input is redirected from /dev/null. -print True; print the full file name on the standard output, follo= wed by a newline. If you are piping the output of find i= nto another program and there is the faintest possibility that = the files which you are searching for might contain a newline, t= hen you should seriously consider using the -print0 option inst= ead of -print. See the UNUSUAL FILENAMES section for informat= ion about how unusual characters in filenames are handled. -print0 True; print the full file name on the standard output, follo= wed by a null character (instead of the newline character t= hat -print uses). This allows file names that contain newlines= or other types of white space to be correctly interpreted by p= ro- grams that process the find output. This option corresponds= to the -0 option of xargs. -printf format True; print format on the standard output, interpreting = `\' escapes and `%' directives. Field widths and precisions can= be specified as with the `printf' C function. Please note t= hat many of the fields are printed as %s rather than %d, and t= his may mean that flags don't work as you might expect. This a= lso means that the `-' flag does work (it forces fields to be le= ft- aligned). Unlike -print, -printf does not add a newline at = the end of the string. The escapes and directives are: \a Alarm bell. \b Backspace. \c Stop printing from this format immediately and flush = the output. \f Form feed. \n Newline. \r Carriage return. \t Horizontal tab. \v Vertical tab. \0 ASCII NUL. \\ A literal backslash (`\'). \NNN The character whose ASCII code is NNN (octal). A `\' character followed by any other character is treated as= an ordinary character, so they both are printed. %% A literal percent sign. %a File's last access time in the format returned by th= e C `ctime' function. %Ak File's last access time in the format specified by = k, which is either `@' or a directive for the C `strfti= me' function. The possible values for k are listed bel= ow; some of them might not be available on all systems, = due to differences in `strftime' between systems. @ seconds since Jan. 1, 1970, 00:00 GMT, with fr= ac- tional part. Time fields: H hour (00..23) I hour (01..12) k hour ( 0..23) l hour ( 1..12) M minute (00..59) p locale's AM or PM r time, 12-hour (hh:mm:ss [AP]M) S Second (00.00 .. 61.00). There is a fractio= nal part. T time, 24-hour (hh:mm:ss) + Date and time, separated by `+', for exam= ple `2004-04-28+22:22:05.0'. This is a GNU extensi= on. The time is given in the current timezone (wh= ich may be affected by setting the TZ environm= ent variable). The seconds field includes a fr= ac- tional part. X locale's time representation (H:M:S) Z time zone (e.g., EDT), or nothing if no time z= one is determinable Date fields: a locale's abbreviated weekday name (Sun..Sat) A locale's full weekday name, variable length (S= un- day..Saturday) b locale's abbreviated month name (Jan..Dec) B locale's full month name, variable length (Ja= nu- ary..December) c locale's date and time (Sat Nov 04 12:02:33 = EST 1989). The format is the same as for ctime(3) = and so to preserve compatibility with that form= at, there is no fractional part in the seconds fiel= d. d day of month (01..31) D date (mm/dd/yy) h same as b j day of year (001..366) m month (01..12) U week number of year with Sunday as first day= of week (00..53) w day of week (0..6) W week number of year with Monday as first day = of week (00..53) x locale's date representation (mm/dd/yy) y last two digits of year (00..99) Y year (1970...) %b The amount of disk space used for this file in 512-b= yte blocks. Since disk space is allocated in multiples = of the filesystem block size this is usually greater t= han %s/512, but it can also be smaller if the file is= a sparse file. %c File's last status change time in the format returned= by the C `ctime' function. %Ck File's last status change time in the format specified= by k, which is the same as for %A. %d File's depth in the directory tree; 0 means the file i= s a starting-point. %D The device number on which the file exists (the st_= dev field of struct stat), in decimal. %f File's name with any leading directories removed (o= nly the last element). %F Type of the filesystem the file is on; this value can = be used for -fstype. %g File's group name, or numeric group ID if the group = has no name. %G File's numeric group ID. %h Leading directories of file's name (all but the last e= le- ment). If the file name contains no slashes (since it= is in the current directory) the %h specifier expands = to ".". %H Starting-point under which file was found. %i File's inode number (in decimal). %k The amount of disk space used for this file in 1K bloc= ks. Since disk space is allocated in multiples of = the filesystem block size this is usually greater t= han %s/1024, but it can also be smaller if the file is= a sparse file. %l Object of symbolic link (empty string if file is no= t a symbolic link). %m File's permission bits (in octal). This option uses = the `traditional' numbers which most Unix implementati= ons use, but if your particular implementation uses = an unusual ordering of octal permissions bits, you will = see a difference between the actual value of the file's m= ode and the output of %m. Normally you will want to hav= e a leading zero on this number, and to do this, you sho= uld use the # flag (as in, for example, `%#m'). %M File's permissions (in symbolic form, as for ls). T= his directive is supported in findutils 4.2.5 and later. %n Number of hard links to file. %p File's name. %P File's name with the name of the starting-point un= der which it was found removed. %s File's size in bytes. %S File's sparseness. This is calculated as (BLO= CK- SIZE*st_blocks / st_size). The exact value you will = get for an ordinary file of a certain length is system-dep= en- dent. However, normally sparse files will have val= ues less than 1.0, and files which use indirect blocks = may have a value which is greater than 1.0. The value u= sed for BLOCKSIZE is system-dependent, but is usually = 512 bytes. If the file size is zero, the value printed = is undefined. On systems which lack support for st_bloc= ks, a file's sparseness is assumed to be 1.0. %t File's last modification time in the format returned = by the C `ctime' function. %Tk File's last modification time in the format specified= by k, which is the same as for %A. %u File's user name, or numeric user ID if the user has = no name. %U File's numeric user ID. %y File's type (like in ls -l), U=3Dunknown type (shou= ldn't happen) %Y File's type (like %y), plus follow symlinks: L=3D= loop, N=3Dnonexistent %Z (SELinux only) file's security context. %{ %[ %( Reserved for future use. A `%' character followed by any other character is discard= ed, but the other character is printed (don't rely on this, as f= ur- ther format characters may be introduced). A `%' at the end= of the format argument causes undefined behaviour since there is= no following character. In some locales, it may hide your d= oor keys, while in others it may remove the final page from = the novel you are reading. The %m and %d directives support the # , 0 and + flags, but = the other directives do not, even if they print numbers. Nume= ric directives that do not support these flags include G, U, b, D= , k and n. The `-' format flag is supported and changes the ali= gn- ment of a field from right-justified (which is the default)= to left-justified. See the UNUSUAL FILENAMES section for information about = how unusual characters in filenames are handled. -prune True; if the file is a directory, do not descend into it. = If -depth is given, false; no effect. Because -delete impl= ies -depth, you cannot usefully use -prune and -delete together. -quit Exit immediately. No child processes will be left running, = but no more paths specified on the command line will be process= ed. For example, find /tmp/foo /tmp/bar -print -quit will print o= nly /tmp/foo. Any command lines which have been built up w= ith -execdir ... {} + will be invoked before find exits. The e= xit status may or may not be zero, depending on whether an error = has already occurred. OPERATORS Listed in order of decreasing precedence: ( expr ) Force precedence. Since parentheses are special to the she= ll, you will normally need to quote them. Many of the examples = in this manual page use backslashes for this purpose: `\(...= \)' instead of `(...)'. ! expr True if expr is false. This character will also usually n= eed protection from interpretation by the shell. -not expr Same as ! expr, but not POSIX compliant. expr1 expr2 Two expressions in a row are taken to be joined with an impl= ied "and"; expr2 is not evaluated if expr1 is false. expr1 -a expr2 Same as expr1 expr2. expr1 -and expr2 Same as expr1 expr2, but not POSIX compliant. expr1 -o expr2 Or; expr2 is not evaluated if expr1 is true. expr1 -or expr2 Same as expr1 -o expr2, but not POSIX compliant. expr1 , expr2 List; both expr1 and expr2 are always evaluated. The value = of expr1 is discarded; the value of the list is the value of exp= r2. The comma operator can be useful for searching for several d= if- ferent types of thing, but traversing the filesystem hierar= chy only once. The -fprintf action can be used to list the vari= ous matched items into several different output files. UNUSUAL FILENAMES Many of the actions of find result in the printing of data which= is under the control of other users. This includes file names, siz= es, modification times and so forth. File names are a potential prob= lem since they can contain any character except `\0' and `/'. Unus= ual characters in file names can do unexpected and often undesirable thi= ngs to your terminal (for example, changing the settings of your funct= ion keys on some terminals). Unusual characters are handled differently= by various actions, as described below. -print0, -fprint0 Always print the exact filename, unchanged, even if the out= put is going to a terminal. -ls, -fls Unusual characters are always escaped. White space, backsla= sh, and double quote characters are printed using C-style escap= ing (for example `\f', `\"'). Other unusual characters are prin= ted using an octal escape. Other printable characters (for -ls = and -fls these are the characters between octal 041 and 0176) = are printed as-is. -printf, -fprintf If the output is not going to a terminal, it is printed as-= is. Otherwise, the result depends on which directive is in use. = The directives %D, %F, %g, %G, %H, %Y, and %y expand to values wh= ich are not under control of files' owners, and so are printed = as- is. The directives %a, %b, %c, %d, %i, %k, %m, %M, %n, %s, = %t, %u and %U have values which are under the control of files' o= wn- ers but which cannot be used to send arbitrary data to the t= er- minal, and so these are printed as-is. The directives %f, = %h, %l, %p and %P are quoted. This quoting is performed in the s= ame way as for GNU ls. This is not the same quoting mechanism= as the one used for -ls and -fls. If you are able to decide w= hat format to use for the output of find then it is normally bet= ter to use `\0' as a terminator than to use newline, as file na= mes can contain white space and newline characters. The setting= of the `LC_CTYPE' environment variable is used to determine wh= ich characters need to be quoted. -print, -fprint Quoting is handled in the same way as for -printf and -fprin= tf. If you are using find in a script or in a situation where = the matched files might have arbitrary names, you should consi= der using -print0 instead of -print. The -ok and -okdir actions print the current filename as-is. This = may change in a future release. STANDARDS CONFORMANCE For closest compliance to the POSIX standard, you should set = the POSIXLY_CORRECT environment variable. The following options are spe= ci- fied in the POSIX standard (IEEE Std 1003.1, 2003 Edition): -H This option is supported. -L This option is supported. -name This option is supported, but POSIX conformance depends on = the POSIX conformance of the system's fnmatch(3) library functi= on. As of findutils-4.2.2, shell metacharacters (`*', `?' or `= []' for example) will match a leading `.', because IEEE PASC int= er- pretation 126 requires this. This is a change from previ= ous versions of findutils. -type Supported. POSIX specifies `b', `c', `d', `l', `p', `f' = and `s'. GNU find also supports `D', representing a Door, where = the OS provides these. -ok Supported. Interpretation of the response is according to = the "yes" and "no" patterns selected by setting the `LC_MESSAG= ES' environment variable. When the `POSIXLY_CORRECT' environm= ent variable is set, these patterns are taken system's definition= of a positive (yes) or negative (no) response. See the syste= m's documentation for nl_langinfo(3), in particular YESEXPR = and NOEXPR. When `POSIXLY_CORRECT' is not set, the patterns = are instead taken from find's own message catalogue. -newer Supported. If the file specified is a symbolic link, it= is always dereferenced. This is a change from previous behavio= ur, which used to take the relevant time from the symbolic link; = see the HISTORY section below. -perm Supported. If the POSIXLY_CORRECT environment variable is = not set, some mode arguments (for example +a+x) which are not va= lid in POSIX are supported for backward-compatibility. Other predicates The predicates -atime, -ctime, -depth, -group, -links, -mti= me, -nogroup, -nouser, -print, -prune, -size, -user and -x= dev `-atime', `-ctime', `-depth', `-group', `-links', `-mtim= e', `-nogroup', `-nouser', `-perm', `-print', `-prune', `-siz= e', `-user' and `-xdev', are all supported. The POSIX standard specifies parentheses `(', `)', negation `!' and = the `and' and `or' operators ( -a, -o). All other options, predicates, expressions and so forth are extensi= ons beyond the POSIX standard. Many of these extensions are not unique = to GNU find, however. The POSIX standard requires that find detects loops: The find utility shall detect infinite loops; that is, enter= ing a previously visited directory that is an ancestor of the l= ast file encountered. When it detects an infinite loop, find sh= all write a diagnostic message to standard error and shall eit= her recover its position in the hierarchy or terminate. GNU find complies with these requirements. The link count of direc= to- ries which contain entries which are hard links to an ancestor w= ill often be lower than they otherwise should be. This can mean that = GNU find will sometimes optimise away the visiting of a subdirectory wh= ich is actually a link to an ancestor. Since find does not actually en= ter such a subdirectory, it is allowed to avoid emitting a diagnostic m= es- sage. Although this behaviour may be somewhat confusing, it= is unlikely that anybody actually depends on this behaviour. If the l= eaf optimisation has been turned off with -noleaf, the directory entry w= ill always be examined and the diagnostic message will be issued where = it is appropriate. Symbolic links cannot be used to create filesys= tem cycles as such, but if the -L option or the -follow option is in use= , a diagnostic message is issued when find encounters a loop of symbo= lic links. As with loops containing hard links, the leaf optimisation w= ill often mean that find knows that it doesn't need to call stat()= or chdir() on the symbolic link, so this diagnostic is frequently not n= ec- essary. The -d option is supported for compatibility with various BSD syste= ms, but you should use the POSIX-compliant option -depth instead. The POSIXLY_CORRECT environment variable does not affect the behavi= our of the -regex or -iregex tests because those tests aren't specified= in the POSIX standard. ENVIRONMENT VARIABLES LANG Provides a default value for the internationalization variab= les that are unset or null. LC_ALL If set to a non-empty string value, override the values of = all the other internationalization variables. LC_COLLATE The POSIX standard specifies that this variable affects the p= at- tern matching to be used for the -name option. GNU find u= ses the fnmatch(3) library function, and so support for `LC_COLLA= TE' depends on the system library. This variable also affects = the interpretation of the response to -ok; while the `LC_MESSAG= ES' variable selects the actual pattern used to interpret = the response to -ok, the interpretation of any bracket expressi= ons in the pattern will be affected by `LC_COLLATE'. LC_CTYPE This variable affects the treatment of character classes used= in regular expressions and also with the -name test, if the s= ys- tem's fnmatch(3) library function supports this. This varia= ble also affects the interpretation of any character classes in = the regular expressions used to interpret the response to the pro= mpt issued by -ok. The `LC_CTYPE' environment variable will a= lso affect which characters are considered to be unprintable w= hen filenames are printed; see the section UNUSUAL FILENAMES. LC_MESSAGES Determines the locale to be used for internationalised messag= es. If the `POSIXLY_CORRECT' environment variable is set, this a= lso determines the interpretation of the response to the prompt m= ade by the -ok action. NLSPATH Determines the location of the internationalisation message c= at- alogues. PATH Affects the directories which are searched to find the execu= ta- bles invoked by -exec, -execdir, -ok and -okdir. POSIXLY_CORRECT Determines the block size used by -ls and -fls. If POSIXLY_C= OR- RECT is set, blocks are units of 512 bytes. Otherwise they = are units of 1024 bytes. Setting this variable also turns off warning messages (that = is, implies -nowarn) by default, because POSIX requires that ap= art from the output for -ok, all messages printed on stderr = are diagnostics and must result in a non-zero exit status. When POSIXLY_CORRECT is not set, -perm +zzz is treated just l= ike -perm /zzz if +zzz is not a valid symbolic mode. W= hen POSIXLY_CORRECT is set, such constructs are treated as an err= or. When POSIXLY_CORRECT is set, the response to the prompt made = by the -ok action is interpreted according to the system's mess= age catalogue, as opposed to according to find's own message tra= ns- lations. TZ Affects the time zone used for some of the time-related for= mat directives of -printf and -fprintf. EXAMPLES find /tmp -name core -type f -print | xargs /bin/rm -f Find files named core in or below the directory /tmp and delete th= em. Note that this will work incorrectly if there are any filenames c= on- taining newlines, single or double quotes, or spaces. find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f Find files named core in or below the directory /tmp and delete th= em, processing filenames in such a way that file or directory names c= on- taining single or double quotes, spaces or newlines are correctly h= an- dled. The -name test comes before the -type test in order to av= oid having to call stat(2) on every file. find . -type f -exec file '{}' \; Runs `file' on every file in or below the current directory. Not= ice that the braces are enclosed in single quote marks to protect them f= rom interpretation as shell script punctuation. The semicolon is simila= rly protected by the use of a backslash, though single quotes could h= ave been used in that case also. find / \( -perm -4000 -fprintf /root/suid.txt '%#m %u %p\n' \) , \ \( -size +100M -fprintf /root/big.txt '%-10s %p\n' \) Traverse the filesystem just once, listing setuid files and director= ies into /root/suid.txt and large files into /root/big.txt. find $HOME -mtime 0 Search for files in your home directory which have been modified in = the last twenty-four hours. This command works this way because the t= ime since each file was last modified is divided by 24 hours and = any remainder is discarded. That means that to match -mtime 0, a file w= ill have to have a modification in the past which is less than 24 ho= urs ago. find /sbin /usr/sbin -executable \! -readable -print Search for files which are executable but not readable. find . -perm 664 Search for files which have read and write permission for their own= er, and group, but which other users can read but not write to. Fi= les which meet these criteria but have other permissions bits set (= for example if someone can execute the file) will not be matched. find . -perm -664 Search for files which have read and write permission for their ow= ner and group, and which other users can read, without regard to the pr= es- ence of any extra permission bits (for example the executable bi= t). This will match a file which has mode 0777, for example. find . -perm /222 Search for files which are writable by somebody (their owner, or th= eir group, or anybody else). find . -perm /220 find . -perm /u+w,g+w find . -perm /u=3Dw,g=3Dw All three of these commands do the same thing, but the first one u= ses the octal representation of the file mode, and the other two use = the symbolic form. These commands all search for files which are writa= ble by either their owner or their group. The files don't have to = be writable by both the owner and group to be matched; either will do. find . -perm -220 find . -perm -g+w,u+w Both these commands do the same thing; search for files which = are writable by both their owner and their group. find . -perm -444 -perm /222 ! -perm /111 find . -perm -a+r -perm /a+w ! -perm /a+x These two commands both search for files that are readable for eve= ry- body ( -perm -444 or -perm -a+r), have at least one write bit se= t ( -perm /222 or -perm /a+w) but are not executable for anybody ( ! -p= erm /111 and ! -perm /a+x respectively). cd /source-dir find . -name .snapshot -prune -o \( \! -name *~ -print0 \)| cpio -pmd0 /dest-dir This command copies the contents of /source-dir to /dest-dir, but om= its files and directories named .snapshot (and anything in them). It a= lso omits files or directories whose name ends in ~, but not their c= on- tents. The construct -prune -o \( ... -print0 \) is quite common. = The idea here is that the expression before -prune matches things which = are to be pruned. However, the -prune action itself returns true, so = the following -o ensures that the right hand side is evaluated only = for those directories which didn't get pruned (the contents of the pru= ned directories are not even visited, so their contents are irrelevan= t). The expression on the right hand side of the -o is in parentheses o= nly for clarity. It emphasises that the -print0 action takes place o= nly for things that didn't have -prune applied to them. Because = the default `and' condition between tests binds more tightly than -o, t= his is the default anyway, but the parentheses help to show what is go= ing on. find repo/ -exec test -d {}/.svn \; -or \ -exec test -d {}/.git \; -or -exec test -d {}/CVS \; \ -print -prune Given the following directory of projects and their associated = SCM administrative directories, perform an efficient search for = the projects' roots: repo/project1/CVS repo/gnu/project2/.svn repo/gnu/project3/.svn repo/gnu/project3/src/.svn repo/project4/.git In this example, -prune prevents unnecessary descent into director= ies that have already been discovered (for example we do not sea= rch project3/src because we already found project3/.svn), but ensures s= ib- ling directories (project2 and project3) are found. EXIT STATUS find exits with status 0 if all files are processed successful= ly, greater than 0 if errors occur. This is deliberately a very br= oad description, but if the return value is non-zero, you should not r= ely on the correctness of the results of find. When some error occurs, find may stop immediately, without complet= ing all the actions specified. For example, some starting points may = not have been examined or some pending program invocations for -exec ...= {} + or -execdir ... {} + may not have been performed. SEE ALSO locate(1), locatedb(5), updatedb(1), xargs(1), chmod(1), fnmatch(= 3), regex(7), stat(2), lstat(2), ls(1), printf(3), strftime(3), ctime(3) The full documentation for find is maintained as a Texinfo manual. = If the info and find programs are properly installed at your site, = the command info find should give you access to the complete manual. HISTORY As of findutils-4.2.2, shell metacharacters (`*', `?' or `[]' for ex= am- ple) used in filename patterns will match a leading `.', because I= EEE POSIX interpretation 126 requires this. As of findutils-4.3.3, -perm /000 now matches all files instead= of none. Nanosecond-resolution timestamps were implemented in findutils-4.3.3= . As of findutils-4.3.11, the -delete action sets find's exit status t= o a nonzero value when it fails. However, find will not exit immediate= ly. Previously, find's exit status was unaffected by the failure = of -delete. Feature Added in Also occurs in -newerXY 4.3.3 BSD -D 4.3.1 -O 4.3.1 -readable 4.3.0 -writable 4.3.0 -executable 4.3.0 -regextype 4.2.24 -exec ... + 4.2.12 POSIX -execdir 4.2.12 BSD -okdir 4.2.12 -samefile 4.2.11 -H 4.2.5 POSIX -L 4.2.5 POSIX -P 4.2.5 BSD -delete 4.2.3 -quit 4.2.3 -d 4.2.3 BSD -wholename 4.2.0 -iwholename 4.2.0 -ignore_readdir_race 4.2.0 -fls 4.0 -ilname 3.8 -iname 3.8 -ipath 3.8 -iregex 3.8 The syntax -perm +MODE was removed in findutils-4.5.12, in favour= of -perm /MODE. The +MODE syntax had been deprecated since fin= du- tils-4.2.21 which was released in 2005. NON-BUGS $ find . -name *.c -print find: paths must precede expression Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates= |opt|exec] [path...] [expression] This happens because *.c has been expanded by the shell resulting= in find actually receiving a command line like this: find . -name bigram.c code.c frcode.c locate.c -print That command is of course not going to work. Instead of doing thi= ngs this way, you should enclose the pattern in quotes or escape the wi= ld- card: $ find . -name '*.c' -print $ find . -name \*.c -print BUGS There are security problems inherent in the behaviour that the PO= SIX standard specifies for find, which therefore cannot be fixed. = For example, the -exec action is inherently insecure, and -execdir sho= uld be used instead. Please see Finding Files for more information. The environment variable LC_COLLATE has no effect on the -ok action. The best way to report a bug is to use the form at http://sav= an- nah.gnu.org/bugs/?group=3Dfindutils. The reason for this is that= you will then be able to track progress in fixing the problem. Other c= om- ments about find(1) and about the findutils package in general can = be sent to the bug-findutils mailing list. To join the list, send em= ail to bug-findutils-request@gnu.org. FIND= (1)