Windows does not recognize touch command

0

I try to execute the command: "touch .gitignore" but it gives me this error

    
asked by Sergio A Castañeda Venegas 29.07.2018 в 00:26
source

2 answers

0
  

This answer is copied from    here

In the command window you can do

type nul > tuarchivo.txt

This will create a file of 0 bytes with the name tuarchivo.txt

Another way to do it is by using the echo command

echo.>tuarchivo.txt

echo. - will create the file with only one empty row inside it.

    
answered by 29.07.2018 в 01:04
0

There is no touch command included by default in Windows. You can use some equivalent command or install some version for windows.

  • You can install a version of touch for Windows
  • If you want to use other commands used in Linux, you can install the utilities of GNU Win32 coreutils or the utilities of MSYS used in MinGW. These are the Linux versions compiled again in Windows.

NOTE: If you want to have a full version of Linux on your machine, you can use the Windows Subsystem for Linux . You can run Linux commands from the command line .

    
answered by 29.07.2018 в 02:07