1

In Mac OS a new file can be created from the terminal by using the touch command. For example:

$ touch hello_world.rb.

Is there a way to create a new file of any type in cmd for Windows?

Sean Hetzel
  • 448
  • 1
  • 3
  • 13

1 Answers1

10

To make a file with some text, do

echo some_text > hello_world.rb

Or, as seen in the comments,

type nul > hello_world.rb

(Note that you actually type type.)

Brōtsyorfuzthrāx
  • 4,387
  • 4
  • 34
  • 56
Sean Hetzel
  • 448
  • 1
  • 3
  • 13