Windows equivalent of 'touch' (i.e. the node.js way to create an index.html)

后端 未结 19 2280
一整个雨季
一整个雨季 2020-11-28 00:47

On a windows machine I get this error

\'touch\' is not recognized as an internal or external command, operable program or batch file.

19条回答
  •  情歌与酒
    2020-11-28 01:24

    You can also use copy con [filename] in a Windows command window (cmd.exe):

    C:\copy con yourfile.txt [enter]
    C:\CTRL + Z [enter] //hold CTRL key & press "Z" then press Enter key.
    ^Z
        1 Files Copied.
    

    This will create a file named yourfile.txt in the local directory.

提交回复
热议问题