How to create a file in the terminal of VSC?

Viewed 7181

I know how to create a folder in the terminal of vsc mkdir NameOfFolder, but how to create a file in the terminal?

3 Answers

Ctrl + ` to open the terminal in Visual Studio Code.

echo > "File.txt" to create a new .txt file in the current directory.

You can also use:

code filename.filetype

This also works with directories

code app/program.py

This wil open the new file in te editor (if the filetype allows it) and then you can just save it.

Just type square bracket ">" and name in the bash terminal of VScode:

> fileName.txt
Related