Use grep
as a Substitute for cat
I came across a fascinating and educative article, Unix Recovery Legend, when someone posted a link to it on Reddit. The article presents a story of the writer, Mario Wolczko, and some other colleagues attempting to recover a system partially destructed by rm -rf /. The rm command was interrupted before it scraped off directories like /usr, but it was too late to save /bin, /dev and /etc, which were respectively the directory for basic executable programs, device files, and system configuration files. Commands like ls and ps were now on strike since their executables were in /bin, the backup tape could not be mounted because the tape deck’s device entries were gone with /dev, and absence of network configuration files in /etc denied any possibility to rescue the system through the network. …