1

I know adding script in startup time. Is it possible, adding script in system shutdown time? For an example Whenever a user, shutdown their PC, I want a history -c command will run in the background so that the user's previous worked commands can be erasing in the terminal. Is it possible?

1 Answers1

2

To execute a script at shutdown:

  1. Put your script in /etc/rc6.d
  2. Make it executable: sudo chmod +x K99_script
  3. Notes:
    • The scripts in this directory are executed in alphabetical order.
    • The name of your script must begin with K99 to run at the right time.

For more info please see this link. Hope this helps.


Sources:

ATR
  • 403
  • 1
  • 5
  • 18