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.

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

Relevance
  • Paco
    Lv 4
    1 decade ago
    Favorite 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.

Still have questions? Get your answers by asking now.