Monday, December 4, 2023
rated 0 times [  4] [ 0]  / answers: 1 / hits: 3630  / 1 Year ago, sun, august 7, 2022, 5:07:30

I have a bat file that I want to be able to call from everywhere, by simply calling it's name. In windows I simply had to add the folder where the .bat file is located, to the windows PATH. I have no idea how to do this in Ubuntu though. I'm guessing there's something similar..

Can someone explain how to do this.

More From » command-line


if you want to shortcut the program, and leave it where it is you can either use sym. links or the alias command.

(note this assumes you've made it executable, chmod +x [script file])

sym links allow you to create a shortcut that behaves like the file in question.

sudo ln -s [script start-up file] /usr/bin/[name]

despite being in /usr/bin it will start in the directory you call it from.

alias allows you to give an name to a command, or series of piped commans, that you use regually, for example its fairly common to have the update/upgrade commands combined into a single, alias'd, one.

alias [name]="sh /path/to/script/[file name]"

assuming that your script runs with sh, (this could also be bash, for more complex tasks there is a difference).

[#44817] Sunday, August 7, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 184
Total Questions: 115
Total Answers: 112

Location: Colombia
Member since Thu, Sep 29, 2022
1 Year ago
ainbby questions
Thu, Mar 23, 23, 10:26, 9 Months ago
Wed, May 10, 23, 00:10, 7 Months ago
Fri, Apr 15, 22, 10:11, 2 Years ago