Code is like humor. When you have to explain it, it’s bad.Namaste Developers,
– Cory House
Let us have a look at some basic commands which we would like to run from our integrated terminal inside Visual Studio Code or may be outside it through command prompt or may be on a remote computer.
Let us understand some basic commands and their relevance while developing a website:
- Change Directory Command : cd <directory name>
- Open Integrated Terminal from visual studio.
- We can see on the left of the integrated terminal, where our cursor is blinking,an address "C:\Users\pguleria".This is our present working directory or the folder we are currently present in.This can also be checked by using pwd command.
- Now, we type in a command : ls , which lists the items present in the working directory.Check if you can find Desktop there.
- Now let us navigate to desktop using command: cd Desktop , note after this command, the address changes to "C:\Users\pguleria\Desktop" which points that we are in the Desktop folder. You can do "ls" again here to check where you want to go next.
- Now we again navigate to terminal_example using command cd terminal_example.
- Make Directory Command <mkdir> Using this command we can create a folder.Say we want to create a folder inside our terminal_example folder. Command used : mkdir example_folder . This command creates a folder inside our terminal_example folder.To navigate inside this folder you can again use cd example_folder command.
- List command <ls> This command lists all the files and folders present in the present working directory.
- Command to create a file with some text <echo helloworld > "helloworld.txt"> This command is either used to create new file inside the folder we are in or the present working directory. Say we want to create a file named "helloworld.txt" and have hello world written in it. So we navigate to our example_folder and type the command: echo helloworld > helloworld.txt
- Edit file using notepad using command <notepad helloworld.txt> This opens the mentioned file inside the notepad, where we can edit and save it.
- Remove Directory <rmdir "directory address"> This command removes the directory mentioned. These are some of the commands we will be using while creating our website from the integrated terminal of visual studio code inside our project directory.
This command is used to navigate to various directories/folders present in our system. First we should understand where we are at in the terminal and then navigate from there to our working directory or else we can just write the whole address after cd. For Example : Say we want to navigate to folder named terminal_example in our desktop. With User interface you can just navigate to desktop and double click on folder to open.
But, during creation of our project, we may want to navigate to our project present working directory, where we would like to install some packages through commands such as npm install.Doing this through User Interface would increase our work load and also increase complexity in our project. Consider the folder directory_name to be the directory where we want to create our new angular app. How do we navigate to this folder using visual studio integrated terminal?We can check whether the folder was created using UI .










Comments
Post a Comment