There is a lot of stuff that is configured using directories in /etc with .d suffix, which stands for "directory" and even though Unix doesn't require such suffix, it is used to avoid name clashing.

It's hard to google it. I wanted to disable one of the scripts in /etc/update-motd.d/ and could not do it. How to disable a script in such .d directory?


It depends a lot on the directory and distro in question. For example:

  • update-motd.d scripts in Ubuntu have to be executable, as the update-motd manpage says:

    Executable  scripts in /etc/update-motd.d/* are executed by pam_motd(8)
  • Files in profile.d in Ubuntu should have the a .sh extension, since /etc/profile contains:

    if [ -d /etc/profile.d ]; then
      for i in /etc/profile.d/*.sh; do
        if [ -r $i ]; then
          . $i
  • Files in sudoers.d shouldn't have extensions, or end with ~:

     ...  For example, given:
         #includedir /etc/sudoers.d
     sudo will read each file in /etc/sudoers.d, skipping file names that end
     in ‘~’ or contain a ‘.’ 

And so on.

All three points also probably apply to Debian.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.