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?
Asked
Active
Viewed 1.5k times
0
![](../../users/profiles/10732837.webp)
Sean Hetzel
- 301
- 1
- 2
- 7
-
2Have you tried to research?https://stackoverflow.com/questions/1702762/how-to-create-an-empty-file-at-the-command-line-in-windows – Kien Pham Apr 09 '19 at 03:08
-
Yeah I though that was only for .txt but I was mistaken. – Sean Hetzel Apr 09 '19 at 03:16
-
Well, an empty file is an empty file, there is no empty binary or text file since there is no data at all... – aschipfl Apr 09 '19 at 17:14
1 Answers
2
echo some_text > hello_world.rb
![](../../users/profiles/5047627.webp)
Litisqe Kumar
- 2,240
- 4
- 23
- 38
![](../../users/profiles/10732837.webp)
Sean Hetzel
- 301
- 1
- 2
- 7
-
-
4type nul > fileName.txt, This creates empty file and works on windows 10. – renukar Jul 19 '19 at 09:47