Showing posts with label path shell. Show all posts
Showing posts with label path shell. Show all posts

Saturday, May 5, 2012

How to run a unix command as a USER on startup?

To run a unix command on startup you may use the command below (add it to the /etc/rc.local file):
su USER -c 'your_command &'

How to make stable $PATH when using sudo command?

To make your sudo commands works with the $PATH of your logged-in user you just type the following command and then close all your terminals and login again:

echo "alias sudo='sudo env PATH=$PATH'" >> ~/.bashrc

Sunday, October 16, 2011

Learn path and shell of current user on unix

To find the shell type of current user:
echo $SHELL

To find the paths of current user:
echo $PATH