-1

I made a command for a user user1 so when i write in terminal cool-retro-term it runs the application

If I switch user to user2 and I try to run cool-retro-term or sudo cool-retro-term it says the command not found

I want to know how to make the command usable for all users. Until now I installed and compiled the application like they said. then i made a bash script in /home/user1/bin where i added

#!/bin/bash
/home/user1/cool-retro-term/cool-retro-term

to run my application

I modified .bashrc PATH=$PATH:/home/crs/bin and then I ran chmod u+x /home/crs/bin/cool-retro-term

I EDITED my question 

i want to make my command something like ls or cd or other command usable for all users. something like that . ANY IDEAS?

xyz
  • 159

2 Answers2

2

Copy the file over to a directory that is in everyone's $PATH. You can check the path with echo $PATH. This should be a default path:

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

My suggestion would be the bin directory in local. So that would be

/usr/local/bin/

Avoid general bin directories like /bin, /usr/bin, /sbin and /usr/sbin. Keep those directories clean so you know where your system files and your personal files are.


I would also advice something else: if possible (ie. those users are similar in permissions) you can also add both users to the same group. That way permisssions for one also apply to the other.

terdon
  • 104,119
Rinzwind
  • 309,379
1

Move everything from /home/crs/bin to /usr/local/bin.

Be aware, you need to be root to do that.

muru
  • 207,228
Bernd
  • 594