Launching the Editor
Know how you can launch your source code editor using a terminal.
We'll cover the following
There are several ways to run the source code editor. The first option is using the GUI of your OS. We can launch the editor via the “Start” menu or the desktop icon. It is the same way we run any other program.
Using CLI
The second option is using the command-line interface (CLI). This approach is more convenient in some cases. Here is an example of when we would need it. We call the find
utility for searching several files. We can pass the find
output to the source code editor input and open all found files. This is possible because most modern editors support CLI.
There are three ways to run an application in Bash:
- By the name of the executable.
- By the absolute path.
- By the relative path.
The first approach is the most convenient one. However, we need to add the installation path of the application to the PATH
variable. Then, Bash can find the program’s executable when we call it.
Let’s suppose that we use Windows with the MSYS2 environment and we have the Notepad++ editor installed. Let’s consider how to run it by the executable name. The program has the following installation path by default:
C:\Program Files (86)\Notepad++
Clarify the installation path of our editor in the properties of its desktop icon or the “Start” menu item.
When we work in the MSYS2 environment, the Notepad++ installation path looks like this:
/c/Program Files (x86)/Notepad++
Let’s try to run the editor using this absolute path. The following figure shows that it does not work. Bash reports about the syntax error in this case.
Get hands-on with 1200+ tech skills courses.