I have a shell script that I want to be run each time a user logs on. I use Ubuntu as the OS. The script should be run after user logon in ubuntu.

Thanks for your help


In Ubuntu, any script ending in .sh that's placed in /etc/profile.d/ will be run whenever a user logs in. That's what lines 4-11 of /etc/profile do.

| improve this answer | |

take a look at /etc/profile

| improve this answer | |
  • Yes i have look at that, but i can't figure out where to put my shell script path so it should be run when user has logon to the computer. – Frozzare Oct 24 '09 at 23:12
  • all files in /etc/profile.d/ are executed automatically, you dont have to setup an specail script path (whatever this should be) – evildead Oct 25 '09 at 0:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.