Score:0

How to make ubuntu know a terminal command for the entire machine?

cn flag

I have a lot of projects. And for each project, I have two files in them: setup and serve.

Each developer follows these simple three steps to start coding:

  1. git clone ...
  2. ./setup
  3. ./serve

The problem is that ./setup is not easy to type. And since this is a microservice architecture with a lot of repositories, ./setup and ./serve would be used frequently.

How can I make ubuntu understand that any time I write setup anywhere I mean there is a file called setup and you should run it.

This way developers would only configure their machines once, and then start coding using clone,setup,serve paradigm.

guiverc avatar
cn flag
There are a number of ways; `/usr/local/bin` for example is a directory searched by all users on the system, thus files (or shortcuts) placed in that directory will be found and run, as will anywhere in $PATH... If you're using commands that different products use (setup, clone are commands used by other software too) you'll have to be careful though... (you can also make $PWD part of your path.. but there are risks with that which is why it's not default!)
sudodus avatar
jp flag
There is a bit of explanation of PATH for executable files (binary programs, shellscripts etc) at [this link](https://askubuntu.com/questions/1344556/why-we-use-instead-of-just-typing-its-name-when-running-the-script/) and links from it.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.