Running a command from anywhere
Hi all,
Running Slackware 9.1, and havesetup the sudoers file to allow shutdown for all users. How can I get it so I can type shutdown in any directory (logged in as a user) and it being able to run instead of changing to /sbin to run it? Thanks |
Put /sbin in your path, or just make an alias in your bash profile.
eg Code:
alias shutdown='/sbin/shutdown' |
Hi,
Fellow Sydney nix user :) Where do I put that in? where's the file? :confused: |
Good to see fellow Aussie Linux users around here :-)
It depends on the distro, but ~/.bash_profile for per user setting and /etc/profile for system wide should work most of the time. If it worked you should see it when you type "alias". |
So if I dont have a bash_profile or bashrc, when I create one, what do these need to contain?
|
something like
Code:
#!/bin/bash |
All times are GMT -5. The time now is 12:45 AM. |