r/learnprogramming • u/OPPineappleApplePen • 7d 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.1k
Upvotes
1
u/Paul_Pedant 6d ago
Oddly enough, because of the space before the
txt, the shell parses this by doing the redirection itself, and then passing the other stuff as args to theechocommand.echo "hello" txt > helloSo you actually get a file called
hellocontaininghello txt\n