Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Ubuntu quick question?
I am the system administrator for my university's CS lab, and I want to know if it is possible to run a command every time any user logs in through the console (not remotely).
If so, what files would I need to edit or what procedure do I need to go through?
1 Answer
- PacoLv 41 decade agoFavorite Answer
There are a few ways to do it. One way is to put the command in /etc/profile and /etc/login. Make sure to check two things. 1. Is it an "interactive" shell? Don't do your thing if it's not. Second, check if the terminal is a pseudoterminal or a console. I forget the exact name of the real console devices, but that is what you check.
If its an interactive shell AND it's on the console, run your program. Test carefully. This can go very wrong.
Source(s): http://theory.uwinnipeg.ca/localfiles/infofiles/ba... http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x721.html