Reputation: 2427
Say I have a programme that's run from a shell script:
cd /path/to/file/
./programme
How would I bind that to a single command so I only have to type one thing? ie for most installed programmes I can just type the name of the programme and it's running
programme
Upvotes: 0
Views: 1126
Reputation: 26
you must add your script path in $PATH
variable in ~/.bashrc
file ,like this:
export PATH=$PATH:/path/to/file
or put your script in linux binary directory like /usr/local/bin
, /usr/bin
Upvotes: 1
Reputation: 53
For this you need to create a script with a name and give execute permission to it. Then Copy that script to /usr/bin directory . Now you can run your scrpt as a command in terminal. For details please refer the link https://devopsmanual.in/2018/04/17/create-our-own-script-in-linux/
Upvotes: 0