D
D
Danny132020-09-24 12:52:52
Command line
Danny13, 2020-09-24 12:52:52

How to create a file via terminal in Visual Studio Code in a specific folder with one command?

Good afternoon,

I know that I can create a file in the C:\Users\Danny\Desktop\ myapp directory by entering the command:

echo $null >> filename.js
or
type NUL > filename.js

then the file will be created directly in the myapp folder .

But what if I want to create a file in myapp/components ?
I already have a components folder in myapp folder .

How then to create a file filename.js in the components folder without entering it through the "cd components" command, but by entering it
echo $null >> filename.jsat once?

Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shvedov, 2020-09-24
@Danny13

echo $null >> ./components/filename.js
And prettier like this:
touch ./components/filename.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question