Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the 'touch' command equivalent in Windows Terminal?

I’m trying to make a new folder in the directory I just created and in the tutorial video they told me to use ‘touch example.js’ but I get the error ‘touch: The term "touch" is not recognized as the name of a cmdlet, function, script file, or operable program.

I haven’t tried anything else but decided to come here to see if I could receive a quick answer.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

in linux, touch command is typically used to create an empty file, not a directory! but in Windows Command Prompt(CMD) you can do like this to make a folder :

mkdir your_folder_name

or you can do it in Windows PowerShell like this

New-Item -ItemType Directory -Name your_folder_name

but if you want to create a new file with for example .txt extension, you can use the echo command like this in CMD:

echo. > my_empty_file.txt

or in PowerShell like this:

"" > my_empty_file.txt

good luck !

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading