2

My PC is Mac pro.

I removed x for rm in case of delete files by accident:
sudo chmod o-x /bin/rm

However, when I reboot my PC, I got one message on the terminal:

-bash: /bin/rm: Permission denied

If I do o+x for bin/rm, the message will disappear.

So I just want to know that which files are automatically removed when the system starts up.

Yves
  • 3,161
  • 7
  • 26
  • 54
  • 2
    `chmod o-x /bin/rm`? That's insane. Who knows how many processes may need to delete files for whatever reason? Better create an alias or something instead of this. – muru Feb 03 '17 at 01:30
  • or write a wrapper around /bin/rm that displays the parent process and/or parameters, then calls the real rm – Jeff Schaller Feb 03 '17 at 02:55

1 Answers1

4

There is a lot of cleanup at startup, for example removing files in /tmp. So you shouldn't change /bin/rm permissions.

If you fear to delete files by accident you can alias rm to rm -i so that you will be always prompted for confirmation. alias rm='rm -i' in /etc/profile or /etc/bash.bashrc or equivalent.

jordanm
  • 41,988
  • 9
  • 116
  • 113
Patrick Mevzek
  • 3,130
  • 2
  • 20
  • 30