Turing Completeness of GNU Find: From Mkdir-Assisted Loops to Standalone Comput
Source: Hacker News
Abstract
The Unix command find is among the first commands taught to beginners, yet remains indispensable for experienced engineers. In this paper, we demonstrate that find possesses unexpected computational power, establishing three Turing‑completeness results using the GNU implementation (a standard in Linux distributions).
find+mkdir(a system that has onlyfindandmkdir) is Turing complete: by encoding computational states as directory paths and using regex back‑references to copy substrings, we simulate 2‑tag systems.- GNU
find4.9.0+ alone is Turing complete: by reading and writing to files during traversal, we simulate a two‑counter machine withoutmkdir. find+mkdirwithout regex back‑references is still Turing complete: by a trick of encoding regex patterns directly into directory names, we achieve the same power.
These results place find among the “surprisingly Turing‑complete” systems, highlighting the hidden complexity within seemingly simple standard utilities.