Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStats

Categories

πŸ€– Artificial Intelligence
☁️ Cloud and Infrastructure
πŸ’Ύ Data and Databases
πŸ’Ό Professional Skills
🎯 Programming and Development
πŸ”’ Security and Networking
πŸ“š Specialized Topics
HomeAboutTopicsPricingMy VaultStats
LEVEL 0
0/5 XP
GitHub
Β© 2026 CheatGridβ„’. All rights reserved.
Privacy PolicyTerms of UseAboutContact

find and File Search Commands in Linux Cheat Sheet

find and File Search Commands in Linux Cheat Sheet

Back to Operating Systems and CLI
Updated 2026-05-20
Next Topic: Firebase CLI Cheat Sheet

The find command is the cornerstone of file searching in Linux β€” a recursive filesystem traversal tool that filters files by name, type, size, time, permissions, ownership, and more. Unlike locate, which queries a prebuilt index, find walks the live filesystem in real time, making it accurate but slower on large trees. The critical mental model: every flag is a test that filters which files are passed to actions (-exec, -delete, -print), and tests are combined with implicit AND by default β€” so understanding precedence and short-circuit evaluation is essential for writing correct, efficient commands.

What This Cheat Sheet Covers

This topic spans 15 focused tables and 152 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Core Name and Path MatchingTable 2: File Type FilteringTable 3: Depth and Traversal ControlTable 4: Size and Empty File TestsTable 5: Time-Based TestsTable 6: Permission and Ownership TestsTable 7: Actions β€” Execution and OutputTable 8: Logical Operators and GroupingTable 9: Inode and Hard Link TestsTable 10: Combining find with xargsTable 11: locate and updatedb (Index-Based Search)Table 12: fd β€” Modern find AlternativeTable 13: ripgrep (rg) β€” Content SearchingTable 14: Glob Patterns in Shell and findTable 15: Common Patterns, Gotchas, and Best Practices

Table 1: Core Name and Path Matching

Name and path matching are the most common entry points for any find invocation. These tests filter files based on their basename or full path, with both case-sensitive and case-insensitive variants available.

CommandExampleDescription
-name
find /var/log -name '*.log'
Match basename against a shell glob pattern; case-sensitive. Always quote the pattern to prevent shell expansion.
-iname
find ~ -iname 'readme*'
Case-insensitive version of -name; matches README.md, Readme.txt, etc.
-path
find . -path '*/tests/*.py'
Match against the full path (not just basename); / is allowed in the pattern.
-ipath
find . -ipath '*/src/*.c'
Case-insensitive full-path match; useful on case-folded filesystems.

More in Operating Systems and CLI

  • File Permissions Cheat Sheet
  • Firebase CLI Cheat Sheet
  • AWS CLI Cheat Sheet
  • GCP CLI Cheat Sheet
  • macOS Usage Cheat Sheet
  • Windows 11 Troubleshooting Cheat Sheet
View all 31 topics in Operating Systems and CLI