0

I want to send an email when someone runs specific command on linux like cp (copy) or rm(remove) command.Can anybody tell me how it is possible ?

Mian Anjum
  • 379
  • 2
  • 3
  • 16

1 Answers1

2

You can use aliases: Creating permanent executable aliases

For example you can add in your ~/.bashrc :

alias rm='my_script.sh' 

where my_script.sh is a script which can send an email.

Community
  • 1
  • 1
Pierre
  • 1,162
  • 12
  • 29