where do i put my written scripts
hi
i have written a few scripts i want to be able to run them from any user and any directory i have changed the permissions i just cant remember where to put the script so i can run it like any normal command for example when you run $ls i want to run my script like that from anywhere |
When you write your own scripts, you want to put them in a directory that's added to your $PATH environment variable. To see which directories are included in your $PATH, type
Code:
$ echo $PATH Note, to copy a script over to any of the directories listed in your $PATH, you more than likely need to be root; Code:
$ su Code:
$ mkdir ~/bin Code:
$ echo "export PATH=$PATH:/home/user/bin" >> ~/.bashrc" PS. In case you're wondering, the '>>' means append whatever is on the left of it, to the file to the right of the sign. |
Most users have access to /usr/local/bin which exists for local binaries and related files -- I generally throw my systemwide scripts there.
|
All times are GMT -5. The time now is 01:54 AM. |