I haven't used ‘touch’ to create a file in more than 30 years, and it really surprises me to find anyone still suggesting it as the ‘normal’ way to create files.
*Any* program that opens an output file is valid for this purpose, as long as it can be convinced not to write anything, or only to write harmless stuff (which is context dependent). Picking on ‘touch’ as somehow special in this respect is just weird very very old school. In particular, the null command, with a redirection, is both shorter and less ambiguous than ‘touch’. (*1) So I use and recommend just ‘> *target*’, with ‘noclobber’ set to force the user to think about what they want to happen to an existing file (choosing either ‘>> *target*’ or ‘>| *target*’ or nothing). Very rarely it matters that st_mtime gets set to ‘now’, in which case ‘touch *target*’ might be considered, but then so could ‘echo >> *target*’ if you don't care what's actually in the file. -Martin (*1: Check what happens when you try to use ‘touch’ on a filename that looks like a timestamp.) On Fri, 28 Nov 2025 at 21:21, Thomas Webbers <[email protected]> wrote: > Hi, thank you for taking the time to read this. > > tldr; I suggest adding the word "create" to the description of touch in the > man page such that "apropos file | grep create" can suggest touch. > > Longer explanation: > > The command: "apropos file | grep create" Does not suggest the "touch" > command As stated on: man apropos > https://www.man7.org/linux/man-pages/man1/apropos.1.html > > apropos - search the manual page names and descriptions > > > Meaning it does not go beyond the description. > Touch does mention that leaving out the -c OPTION will result in no files > being created if > they don't exist hence it can be inferred that using touch > without -c will result in files being created. > > However despite touch being frequently used for file creation touch man > page does not use the word "create" > > Hence apropos is unable to suggest the most used file creation > method (that truthfully is a by product of in-built functionality rather > than intend of the function) > > > Therefore I would suggest changing the description of the man page of touch > slightly > to include the word create or even an addition that this utility is often > used to create files as well. > > > > With Kind regards, > > Thomas Webbers > > > > P.S if I wasted your time my apologies, > I was merely trying to have this fixed for the programmer that comes after > me. >
