Use “touch” to create files in windows
Unix commands like touch
will not work in windows system so, I created a node based command line tool called “touch” to create files using touch(create) command in the terminal of windows.
Here I created a npm package called @ritikchoure/touch which will allow us to use touch
command.
npm i -g @ritikchoure/touch
this command will install the @ritikchoure/touch tool globally so we can use it in any folder.
To check the successful installation, run below command in terminal
touch
and check whether your result is looks like below image -
If you will get some error, go to below section.
You can check version using below command -
touch -v
or
touch --version
Now we can create file using below command -
touch <filename>.<extension>
Note: if you get below error,
touch : File C:\Users\<username>\AppData\Roaming\npm\touch.ps1 cannot be loaded because running scripts is disabled on this
system.
so just go to -
C:\Users\<username>\AppData\Roaming\npm
And find touch.ps1 file and delete it.
Thank you for reading!
If you like this article, Unicorn this one! Heart/Like this one and save it for reading it later.