GNU Findutils Finding Files Version 4.8.0, 7 January 2021

GNU Findutils Finding Files Version 4.8.0, 7 January 2021

GNU Findutils Finding files version 4.8.0, 7 January 2021 by David MacKenzie and James Youngman This manual documents version 4.8.0 of the GNU utilities for finding files that match certain criteria and performing various operations on them. Copyright c 1994{2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled \GNU Free Documentation License". i Table of Contents 1 Introduction ::::::::::::::::::::::::::::::::::::: 1 1.1 Scope :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.2 Overview ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 2 Finding Files ::::::::::::::::::::::::::::::::::::: 4 2.1 find Expressions ::::::::::::::::::::::::::::::::::::::::::::::: 4 2.2 Name :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.2.1 Base Name Patterns ::::::::::::::::::::::::::::::::::::::: 5 2.2.2 Full Name Patterns :::::::::::::::::::::::::::::::::::::::: 5 2.2.3 Fast Full Name Search ::::::::::::::::::::::::::::::::::::: 7 2.2.4 Shell Pattern Matching :::::::::::::::::::::::::::::::::::: 8 2.3 Links ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 8 2.3.1 Symbolic Links :::::::::::::::::::::::::::::::::::::::::::: 8 2.3.2 Hard Links ::::::::::::::::::::::::::::::::::::::::::::::: 10 2.4 Time :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 11 2.4.1 Age Ranges::::::::::::::::::::::::::::::::::::::::::::::: 11 2.4.2 Comparing Timestamps :::::::::::::::::::::::::::::::::: 12 2.5 Size ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 2.6 Type :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 2.7 Owner :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 15 2.8 File Mode Bits :::::::::::::::::::::::::::::::::::::::::::::::: 15 2.9 Contents :::::::::::::::::::::::::::::::::::::::::::::::::::::: 18 2.10 Directories ::::::::::::::::::::::::::::::::::::::::::::::::::: 18 2.11 Filesystems::::::::::::::::::::::::::::::::::::::::::::::::::: 20 2.12 Combining Primaries With Operators::::::::::::::::::::::::: 21 3 Actions:::::::::::::::::::::::::::::::::::::::::: 22 3.1 Print File Name ::::::::::::::::::::::::::::::::::::::::::::::: 22 3.2 Print File Information ::::::::::::::::::::::::::::::::::::::::: 22 3.2.1 Escapes :::::::::::::::::::::::::::::::::::::::::::::::::: 23 3.2.2 Format Directives :::::::::::::::::::::::::::::::::::::::: 24 3.2.2.1 Name Directives ::::::::::::::::::::::::::::::::::::: 24 3.2.2.2 Ownership Directives :::::::::::::::::::::::::::::::: 25 3.2.2.3 Size Directives ::::::::::::::::::::::::::::::::::::::: 25 3.2.2.4 Location Directives :::::::::::::::::::::::::::::::::: 26 3.2.2.5 Time Directives:::::::::::::::::::::::::::::::::::::: 26 3.2.2.6 Other Directives ::::::::::::::::::::::::::::::::::::: 26 3.2.2.7 Reserved and Unknown Directives:::::::::::::::::::: 27 3.2.3 Time Formats :::::::::::::::::::::::::::::::::::::::::::: 27 3.2.3.1 Time Components ::::::::::::::::::::::::::::::::::: 27 3.2.3.2 Date Components:::::::::::::::::::::::::::::::::::: 27 3.2.3.3 Combined Time Formats::::::::::::::::::::::::::::: 28 ii 3.2.4 Formatting Flags ::::::::::::::::::::::::::::::::::::::::: 28 3.3 Run Commands ::::::::::::::::::::::::::::::::::::::::::::::: 28 3.3.1 Single File :::::::::::::::::::::::::::::::::::::::::::::::: 29 3.3.2 Multiple Files :::::::::::::::::::::::::::::::::::::::::::: 30 3.3.2.1 Unsafe File Name Handling :::::::::::::::::::::::::: 31 3.3.2.2 Safe File Name Handling::::::::::::::::::::::::::::: 32 3.3.2.3 Unusual Characters in File Names ::::::::::::::::::: 32 3.3.2.4 Limiting Command Size ::::::::::::::::::::::::::::: 34 3.3.2.5 Controlling Parallelism::::::::::::::::::::::::::::::: 34 3.3.2.6 Interspersing File Names ::::::::::::::::::::::::::::: 36 3.3.3 Querying ::::::::::::::::::::::::::::::::::::::::::::::::: 37 3.4 Delete Files ::::::::::::::::::::::::::::::::::::::::::::::::::: 38 3.5 Adding Tests :::::::::::::::::::::::::::::::::::::::::::::::::: 38 4 File Name Databases :::::::::::::::::::::::::: 40 4.1 Database Locations:::::::::::::::::::::::::::::::::::::::::::: 40 4.2 Database Formats ::::::::::::::::::::::::::::::::::::::::::::: 40 4.2.1 LOCATE02 Database Format::::::::::::::::::::::::::::: 41 4.2.2 Sample LOCATE02 Database::::::::::::::::::::::::::::: 41 4.2.3 slocate Database Format:::::::::::::::::::::::::::::::::: 42 4.2.4 Old Database Format ::::::::::::::::::::::::::::::::::::: 42 4.3 Newline Handling ::::::::::::::::::::::::::::::::::::::::::::: 43 5 File Permissions :::::::::::::::::::::::::::::::: 44 5.1 Structure of File Permissions :::::::::::::::::::::::::::::::::: 44 5.2 Symbolic Modes ::::::::::::::::::::::::::::::::::::::::::::::: 45 5.2.1 Setting Permissions ::::::::::::::::::::::::::::::::::::::: 45 5.2.2 Copying Existing Permissions ::::::::::::::::::::::::::::: 46 5.2.3 Changing Special Permissions ::::::::::::::::::::::::::::: 46 5.2.4 Conditional Executability ::::::::::::::::::::::::::::::::: 47 5.2.5 Making Multiple Changes::::::::::::::::::::::::::::::::: 47 5.2.6 The Umask and Protection ::::::::::::::::::::::::::::::: 48 5.3 Numeric Modes ::::::::::::::::::::::::::::::::::::::::::::::: 48 6 Date input formats::::::::::::::::::::::::::::: 50 6.1 General date syntax ::::::::::::::::::::::::::::::::::::::::::: 50 6.2 Calendar date items ::::::::::::::::::::::::::::::::::::::::::: 51 6.3 Time of day items ::::::::::::::::::::::::::::::::::::::::::::: 52 6.4 Time zone items::::::::::::::::::::::::::::::::::::::::::::::: 53 6.5 Combined date and time of day items:::::::::::::::::::::::::: 53 6.6 Day of week items ::::::::::::::::::::::::::::::::::::::::::::: 53 6.7 Relative items in date strings :::::::::::::::::::::::::::::::::: 54 6.8 Pure numbers in date strings :::::::::::::::::::::::::::::::::: 55 6.9 Seconds since the Epoch ::::::::::::::::::::::::::::::::::::::: 55 6.10 Specifying time zone rules :::::::::::::::::::::::::::::::::::: 55 6.11 Authors of parse_datetime :::::::::::::::::::::::::::::::::: 56 iii 7 Configuration ::::::::::::::::::::::::::::::::::: 57 7.1 Leaf Optimisation ::::::::::::::::::::::::::::::::::::::::::::: 57 7.2 d type Optimisation ::::::::::::::::::::::::::::::::::::::::::: 57 8 Reference ::::::::::::::::::::::::::::::::::::::: 58 8.1 Invoking find ::::::::::::::::::::::::::::::::::::::::::::::::: 58 8.1.1 Filesystem Traversal Options ::::::::::::::::::::::::::::: 58 8.1.2 Warning Messages :::::::::::::::::::::::::::::::::::::::: 59 8.1.3 Optimisation Options ::::::::::::::::::::::::::::::::::::: 59 8.1.4 Debug Options ::::::::::::::::::::::::::::::::::::::::::: 60 8.1.5 Find Expressions ::::::::::::::::::::::::::::::::::::::::: 60 8.2 Invoking locate::::::::::::::::::::::::::::::::::::::::::::::: 60 8.3 Invoking updatedb :::::::::::::::::::::::::::::::::::::::::::: 63 8.4 Invoking xargs :::::::::::::::::::::::::::::::::::::::::::::::: 64 8.4.1 xargs options ::::::::::::::::::::::::::::::::::::::::::::: 64 8.4.2 Conflicting options ::::::::::::::::::::::::::::::::::::::: 66 8.4.3 Invoking the shell from xargs ::::::::::::::::::::::::::::: 67 8.5 Regular Expressions ::::::::::::::::::::::::::::::::::::::::::: 68 8.5.1 `findutils-default' regular expression syntax ::::::::::: 68 8.5.2 `emacs' regular expression syntax ::::::::::::::::::::::::: 70 8.5.3 `gnu-awk' regular expression syntax ::::::::::::::::::::::: 71 8.5.4 `grep' regular expression syntax :::::::::::::::::::::::::: 72 8.5.5 `posix-awk' regular expression syntax::::::::::::::::::::: 73 8.5.6 `awk' regular expression syntax:::::::::::::::::::::::::::: 74 8.5.7 `posix-basic' regular expression syntax :::::::::::::::::: 74 8.5.8 `posix-egrep' regular expression syntax :::::::::::::::::: 75 8.5.9 `egrep' regular expression syntax ::::::::::::::::::::::::: 76 8.5.10 `posix-extended' regular expression syntax:::::::::::::: 76 8.6 Environment Variables :::::::::::::::::::::::::::::::::::::::: 77 9 Common Tasks ::::::::::::::::::::::::::::::::: 79 9.1 Viewing And Editing :::::::::::::::::::::::::::::::::::::::::: 79 9.2 Archiving ::::::::::::::::::::::::::::::::::::::::::::::::::::: 79 9.3 Cleaning Up::::::::::::::::::::::::::::::::::::::::::::::::::: 80 9.4 Strange File Names:::::::::::::::::::::::::::::::::::::::::::: 81 9.5 Fixing Permissions :::::::::::::::::::::::::::::::::::::::::::: 81 9.6 Classifying Files ::::::::::::::::::::::::::::::::::::::::::::::: 82 10 Worked Examples::::::::::::::::::::::::::::: 83 10.1 Deleting Files :::::::::::::::::::::::::::::::::::::::::::::::: 83 10.1.1 The Traditional Way :::::::::::::::::::::::::::::::::::: 83 10.1.2 Making Use of xargs :::::::::::::::::::::::::::::::::::: 84 10.1.3 Unusual characters in filenames :::::::::::::::::::::::::: 84 10.1.4 Going back to -exec :::::::::::::::::::::::::::::::::::: 84 10.1.5 A more secure version of -exec :::::::::::::::::::::::::: 85 10.1.6 Using the -delete action :::::::::::::::::::::::::::::::: 86 10.1.7 Improving things still further :::::::::::::::::::::::::::: 86 iv 10.1.8 Conclusion :::::::::::::::::::::::::::::::::::::::::::::: 87 10.2 Copying A Subset of Files :::::::::::::::::::::::::::::::::::: 87 10.3 Updating A Timestamp File :::::::::::::::::::::::::::::::::: 88 10.3.1 Updating the Timestamp The Wrong Way ::::::::::::::: 88 10.3.2 Using the test utility to compare timestamps::::::::::::: 88 10.3.3

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    117 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us