GNU bug report logs - #79907
Minor minor bug: apropos does not suggest touch

Previous Next

Package: coreutils;

Reported by: Thomas Webbers <t.webbers.dev <at> gmail.com>

Date: Fri, 28 Nov 2025 11:52:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

To reply to this bug, email your comments to 79907 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#79907; Package coreutils. (Fri, 28 Nov 2025 11:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Webbers <t.webbers.dev <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 28 Nov 2025 11:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thomas Webbers <t.webbers.dev <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Minor minor bug: apropos does not suggest touch
Date: Fri, 28 Nov 2025 12:21:01 +0100
[Message part 1 (text/plain, inline)]
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.
[Message part 2 (text/html, inline)]

Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Fri, 28 Nov 2025 13:48:03 GMT) Full text and rfc822 format available.

Notification sent to Thomas Webbers <t.webbers.dev <at> gmail.com>:
bug acknowledged by developer. (Fri, 28 Nov 2025 13:48:03 GMT) Full text and rfc822 format available.

Message #10 received at 79907-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Thomas Webbers <t.webbers.dev <at> gmail.com>, 79907-done <at> debbugs.gnu.org
Subject: Re: bug#79907: Minor minor bug: apropos does not suggest touch
Date: Fri, 28 Nov 2025 13:47:07 +0000
On 28/11/2025 11:21, Thomas Webbers 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.


I agree. creating a file is core functionality for touch(1).
I've pushed a change to state that in the summary,
so that something like the following can be used to search:

  apropos -s1 -r create.*file

Marking this as done.

cheers,
Padraig




Information forwarded to bug-coreutils <at> gnu.org:
bug#79907; Package coreutils. (Mon, 01 Dec 2025 07:04:01 GMT) Full text and rfc822 format available.

Message #13 received at 79907 <at> debbugs.gnu.org (full text, mbox):

From: Martin D Kealey <martin <at> kurahaupo.gen.nz>
To: Thomas Webbers <t.webbers.dev <at> gmail.com>
Cc: 79907 <at> debbugs.gnu.org
Subject: Re: bug#79907: Minor minor bug: apropos does not suggest touch
Date: Mon, 1 Dec 2025 17:02:57 +1000
[Message part 1 (text/plain, inline)]
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 <t.webbers.dev <at> gmail.com>
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.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#79907; Package coreutils. (Mon, 01 Dec 2025 08:26:01 GMT) Full text and rfc822 format available.

Message #16 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stan Marsh <gazelle <at> xmission.com>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#79907: Minor minor bug: apropos does not suggest touch
Date: Mon, 01 Dec 2025 01:25:01 -0700
From:	Martin D Kealey
Subject: bug#79907: Minor minor bug: apropos does not suggest touch
Date:	Mon, 1 Dec 2025 17:02:57 +1000

>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
>(and) very, very old school.

When you get right down to it, a lot (not all or even most, but a lot)
of "coreutils" is "old school" stuff.  For example, test/[ - nobody
uses the coreutils versions of these anymore, because users of modern
shells all have it builtin.  Ditto for a bunch of other things, e.g.,
"printf".

But that doesn't mean that the coreutils maintainers shouldn't put
effort into keeping things clean and up-to-date.

And, yes, for those of us who remember the old days, "touch" *is* the
classic/normal method of creating an empty file.  Note that "touch"
has the advantage of *not* needing your "noclobber" thing, since it is
noclobber by default.  Incidentally, and this is a bit off-topic, but
I've often wished that "touch" had an option like -c, but the opposite
- that is, *always* create (and generate an error if the file already
exists) (*).

(*) I suppose someone will post that using "noclobber" would handle
this, but as I've mentioned elsewhere, I don't like setting global
options like that if I can avoid it...

>In particular, the null command, with a redirection, is both shorter and
>less ambiguous than 'touch'.

Yes, modern users of modern shells usually do it that way (Just do: > file
alone as a line in your script), but note that the "touch" method
became popular when "csh" (now known as "tcsh") was more commonly used
and the "> file" (alone) trick doesn't work in "csh".

=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.

When responding to my posts, please try to refrain from giving bureaucratic answers.
If you have nothing useful to say, then just click Next and go on.




Information forwarded to bug-coreutils <at> gnu.org:
bug#79907; Package coreutils. (Mon, 01 Dec 2025 16:50:02 GMT) Full text and rfc822 format available.

Message #19 received at 79907 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Martin D Kealey <martin <at> kurahaupo.gen.nz>,
 Thomas Webbers <t.webbers.dev <at> gmail.com>
Cc: 79907 <at> debbugs.gnu.org
Subject: Re: bug#79907: Minor minor bug: apropos does not suggest touch
Date: Mon, 1 Dec 2025 08:49:32 -0800
On 2025-11-30 23:02, Martin D Kealey wrote:
> Very rarely it matters that st_mtime gets set to ‘now’

In my experience it matters reasonably often when "touch" is used, e.g., 
when a makefile action is "touch $@". Yes, "echo >>$@" would usually 
work, but it would chew up space (and therefore could fail when the 
touch would succeed, and the echo is less intuitive because it's not 
always immediately obvious that the file contents are irrelevant.




Information forwarded to bug-coreutils <at> gnu.org:
bug#79907; Package coreutils. (Mon, 01 Dec 2025 16:55:01 GMT) Full text and rfc822 format available.

Message #22 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stan Marsh <gazelle <at> xmission.com>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#79907: Minor minor bug: apropos does not suggest touch
Date: Mon, 01 Dec 2025 09:53:48 -0700
From:	Stan Marsh
Subject: bug#79907: Minor minor bug: apropos does not suggest touch
Date:	Mon, 01 Dec 2025 01:25:01 -0700

> Yes, modern users of modern shells usually do it that way (Just do: > file
> alone as a line in your script), but note that the "touch" method
> became popular when "csh" (now known as "tcsh") was more commonly used
> and the "> file" (alone) trick doesn't work in "csh".

I should add, for completeness, that tcsh does have the ':'
(null/equivalent to "true") command, so this works (just tested it):

    % : > file

Don't know if this was in original csh.

=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.

When responding to my posts, please try to refrain from giving bureaucratic 
answers.
If you have nothing useful to say, then just click Next and go on.





Information forwarded to bug-coreutils <at> gnu.org:
bug#79907; Package coreutils. (Wed, 03 Dec 2025 03:35:02 GMT) Full text and rfc822 format available.

Message #25 received at 79907 <at> debbugs.gnu.org (full text, mbox):

From: Martin D Kealey <martin <at> kurahaupo.gen.nz>
To: 79907 <at> debbugs.gnu.org
Subject: Re: bug#79907: Minor minor bug: apropos does not suggest touch
Date: Wed, 3 Dec 2025 13:33:54 +1000
[Message part 1 (text/plain, inline)]
TL;DR: the change we're discussing is adding a hint for users who may be
unaware of the using “touch” to create files.

   - If a user already likes to use “touch” to create files, they don't
   need the hint;
   - if they don't already know about it, are we sure we're doing them a
   favour by recommending it?

On Mon, 1 Dec 2025 at 18:25, Stan Marsh <gazelle <at> xmission.com> wrote:

> When you get right down to it, a lot (not all or even most, but a lot)
> of "coreutils" is "old school" stuff.  […]
>
> But that doesn't mean that the coreutils maintainers shouldn't put
> effort into keeping things clean and up-to-date.
>

I completely agree on this point, but to my mind, being "clean" would
include *avoiding* suggesting obsolete features to newer users who are as
yet unaware of them.


> And, yes, for those of us who remember the old days, "touch" *is* the
> classic/normal method of creating an empty file.


Clearly I'm also in that category, (*1) and let's just say, there's scope
for disagreement: s/is/was/

Note that "touch" has the advantage of *not* needing your "noclobber" thing


Using “> *target_file*” does not *need* noclobber, but if the user has
enabled noclobber in their interactive shell, they will be forced to think
about what should happen to an existing file; and that is noclobber working
as intended.

>In particular, the null command, with a redirection, is both shorter and
> >less ambiguous than 'touch'.
>
> Yes, modern users of modern shells usually do it that way (Just do: > file
> alone as a line in your script), but note that the "touch" method
> became popular when "csh" (now known as "tcsh") was more commonly used
>

Let's be honest, we're talking about 40 years ago. Some things can and
should have changed since then.


> and the "> file" (alone) trick doesn't work in "csh".
>

The csh equivalent was “: > *target_file*”, which still works in both csh
and sh.

-Martin

(*1: Csh was my primary shell between 1985 and 1987. After that I switched
to /bin/sh for scripting, because its grammar was more orthogonal. I kept
csh as my login shell until I started using Bash, which allowed me to use
!-history expansions.)
[Message part 2 (text/html, inline)]

This bug report was last modified 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.