Git Terminal vs Node Terminal vs Windows Terminal

Asked

Viewed 218 times

2

I’m having some difficulty realizing the need to have so many terminals installed on the computer when I need to use git or Node.js. What are the differences between the terminals, what can one do and the other not? For example: I wanted to check if I had Node.js installed on my Windows 10, so I did which node in the Windows terminal and without success, I realize that this command is not implemented in this terminal and I have to use another one (Git gave me the installation path), but how to know which one to use for each task if the article/tutorial is not specified?

  • If you have done the installation as global any of the terminals will do what you want. The problem is that the windows terminal does not recognize the "which" command, but for all essential operations it works perfectly.

1 answer

3


Quite simply, the "terminals" (as they are called) or CLIs (Command Line Interface) is software that allows you to execute commands, such commands may be other software compiled or simple scripts written specifically for CLI "x" and interpreted also by it.

Why so many?

There is no real need to have all, the main difference of each is how it is configured and written, which ends up implying the commands that it will be able to run.

The Node terminal, for example, already comes with the command node available, other than Gitbash, which comes with the commands of git available, while the standard Windows terminal has none of them.

Where do these commands come from?

Each terminal will search for compatible commands in the places it is configured to search. Windows CMD, for example, will consume the environment variable PATH, indexing all compatible commands when opening the terminal and every time you give a command, CMD will try to use one of these commands and if it has found it, it will execute it.

These "commands" can be files .exe and, in the CMD .bat. Terminal on Mac can run files .bash, but not the .bat and so on.

Which is best?

It goes from taste and need, I use quite (in Windows environment) the emulator Cmder, the CLI Gitbash and the CLI CMD.

You can still add the program you want (provided it is compatible) on any CLI, to add the node in CMD, for example, you only need to include the file path node.exe in PATH windows. And this means that you can choose and use the CLI you want.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.