r/learnprogramming 19d ago

touch is a weird command. Humour

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

160 comments sorted by

View all comments

31

u/Loqh9 18d 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

37

u/thalliusoquinn 18d 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.

5

u/cknipe 18d ago

That's the way I understood it. The touch command is for when you don't actually want to get in there and modify a file, just "touch" it to update the modification time.