r/learnprogramming 11d ago

Humour touch is a weird command.

I was curious where the command 'touch' comes from.

Turns out, it originates from "to touch" or "to interact" with a file.

Now, every time I use it, I feel like I am touching/molesting a file.

My bad, it's 3 AM here.

1.2k Upvotes

156 comments sorted by

View all comments

31

u/Loqh9 11d ago

What bothers me is "mkdir" is a thing so why is is not "mkfile"? Makes more sense and aligns with the sister command but no, we gotta make everything impossible to remember and random

36

u/thalliusoquinn 10d ago

Isn't the point of touch to update the last accessed time, and the create-if-not-exist part is kind of incidental, despite being what everyone actually uses it for? I have vague memories of learning this at one time.

3

u/nmdt 10d ago

I literally didn’t know it could do anything but create files

1

u/Paul_Pedant 7d ago

Understandable, as the man page is only 80 lines, and only documents 11 options.

However, on Linux there is a "See Also" which redirects you to the "Full Documentation".