Turing Completeness of GNU find: From mkdir-assisted Loops to Standalone Computation
Hacker News
February 25, 2026
AI-Generated Deep Dive Summary
The Unix command `find`, often seen as a basic tool for beginners, has been revealed to possess unexpected computational power, achieving Turing completeness under specific conditions. This groundbreaking paper demonstrates that `find` can simulate complex systems, rivaling more advanced programming languages in functionality. The study highlights three key findings: (1) when combined with `mkdir`, `find` can encode computational states as directory paths and manipulate substrings using regex back-references to simulate 2-tag systems; (2) even alone, newer versions of GNU `find` (4.9.0+) can read and write files during traversal, simulating a two-counter machine without needing `mkdir`; and (3) despite the absence of regex back-references, the combination of `find` and `mkdir` remains Turing complete by encoding regex patterns directly into directory names.
The first method uses the filesystem itself as a computational medium. By creating directories that represent states in a 2-tag system, `find` can traverse and modify these paths to perform computations. This approach leverages `find`'s ability to recursively search directories and manipulate filenames, effectively turning the filesystem into a state machine. The second method relies on `find`'s capability to read and write files during traversal, enabling it to simulate a two-counter machine—a model known for its Turing completeness. This shows that even without `mkdir`, `find` can perform complex computations by interacting with file contents.
The third approach circumvents the lack of regex back-references by embedding regex patterns directly into directory names. By encoding these patterns, `find` can still achieve the necessary computational steps to simulate a 2-tag system. This method highlights the flexibility and adaptability of `find`, allowing it to overcome limitations through creative use of its core functionalities.
These findings underscore the hidden complexity within seemingly simple tools, challenging perceptions of their capabilities. For developers and computer scientists, this revelation opens new possibilities for leveraging shell utilities in innovative ways. It also serves as a reminder
Verticals
techstartups
Originally published on Hacker News on 2/25/2026