A TikTok user was asking the history of the touch(1) command:
https://www.tiktok.com/t/ZTjgSMyAQ/
Unix history repo let me find the first occurrence in V7:
https://github.com/dspinellis/unix-history-repo/blob/Research-V7-Snapshot-D…
But looking at ls source in V6, it’s clear that stat(2) had st_mtime so touch would have
been useful earlier. I notice make was added at the same time, which cares significantly
about mtime. Was that the impetus?
(Also, wow just writing a single char! Compared to present day impls which give fine
grained control to modify mtime & atime, the original seems both indirect for the
purpose and delightfully literal.)
--
Joseph Holsten
http://josephholsten.com
mailto:joseph@josephholsten.com
tel:+1-360-927-7234