13

What is the simplest way to create a file using a command-line? Usually I use:

touch filename

But is this the simplest/fastest way?

18

This will save you five keypresses relative to touch filename

>filename

but is not the equivalent of touch as it will truncate filename if it exists. The following does what you want

>>filename

but note that it is not equivalent to touch either, as it does not update filename's modification timestamp.

|improve this answer|||||
  • 7
    Could also add alias t='touch' to your .bashrc :P – azz Sep 23 '13 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.