Skip to main content

Basic Terminal Commands

Code is like humor. When you have to explain it, it’s bad.
– Cory House
Namaste Developers, 

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>
  • 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?
    1. Open Integrated Terminal from visual studio.
    2. 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.
    3. Now, we type in a command : ls , which lists the items present in the working directory.Check if you can find Desktop there.
    4. 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.
    5. 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.

    We can check whether the folder was created using UI .

  • 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.
Stay Home Stay Safe !

Comments

Popular posts from this blog

My Quarantine "Efforts"

A true relationship is two imperfect people refusing to give up on each other. – Them This blog is on relationships and of course a bit of coding, otherwise it would be stupid to put it here anyways. My girlfriend and I have been having some issues lately regarding the term "Efforts". Now when I put it in front of any of my friends, They have the same reply "Efforts" and when asked what efforts are? … Nothing. I get a supposedly deep answer - Efforts come from within. What does that even mean?. So I tried some stuff to get a response from her. Well for some context we came in relationship on 28 february,2020 and guess when the lockdown started in India. Don't guess, you may as well google it. It was not even a month before the lockdown began and we flew back home. She lives more than 1500km from my state. But you know sometime you just meet the right person and you just know. We knew we had to fight this as we had so much left to say to each ot...

Developing an app with react native and firebase - firestore - Part 1

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. –John F. Woods Let's face it, we are two years into work from home, quarantined from the outside and this makes me wonder that how lucky I am as an engineer to be able to have so many domains open for me to work on, with which I could eventually make money, help others. In other words, it gives me the power to bring a change. I just can't think of a problem where technology cannot help. As soon as I find a problem in minutes my mind starts to work on how it can be solved technically. I think this development is what our college provides us with, to open our technical aspects. Today, I will be talking about react-native and firestore, making app development a little painless and fast. If we are looking to solve a simple everyday problem and want an app to do it for us, an app that is not very complex - react native is the way to go. So,...

What The Hell Is gRPC?

Time is the longest distance between two places. ― Tennessee Williams  If you are a software engineer and you work on websites or any other software which is in high demand by your consumer, but you see that some parts of your application say the products page gets higher demand than any other services you provide at some point of time or let's say you want to loosely couple your application for your application to be developed more easily and flexibly.  These are a few use cases, there are many more. We are seeing a trend in the industry getting more aligned toward following microservices patterns while building the application. The When, Why, Where, and How parts of microservices can be easily found on the internet.  Here I want to talk more about some new technologies which have become an integral part when we talk about microservices. So this blog would be more fruitful for people who know the  When, Why, Where, and How  parts. Today, I will talk a...