3

I understand that the bashrc and inputrc are used to configure the shell. I'm also assuming that making changes to the versions in /etc apply to all users and the versions in ~./ are for the current user.

So if for example /etc/inputrc and ~/.inputrc are identical have different settings, which one takes priority?

I am trying to add history search from the command prompt while typing and I don't seem to have a ~./inputrc. One suggestion I saw was to copy the one from /etc/inputrc to ~./inputrc and then add the lines in my ~./inputrc. But why do that instead of just creating a new ~./inputrc and adding the lines there, assuming they will be "merged" with what is in the /etc/inputrc? What is the right/best way to handle these types of tweaks?

Eliah Kagan
  • 116,445
  • 54
  • 318
  • 493
mo_maat
  • 161
  • 2
  • 9
  • `inputrc` is used to configure the Readline library, which is used not just by `bash`, but by other programs as well. – chepner Oct 02 '17 at 20:12

1 Answers1

5

You always want to add the lines to your local ~/.inputrc, it will be "merged" with the global one in places where you haven't made any tweaks.

I think people tend to suggest copying the global file because then you don't get any surprises if the global file is updated during an upgrade (though in practice, I find this to be incredibly rare and there's usually a good reason for the change).

TheOdd
  • 2,972
  • 1
  • 21
  • 41
pleia2
  • 51
  • 2
  • Thanks. That's what I assumed, but what had me doubting is that tab completion was not working on my bash terminal until I uncommented the appropriate section in my /etc/bashrc. However, the sections were already uncommented in my ~/.bashrc. So does the "local" file specific to my user not take priority? In that case I'm thinking it would be best to make the change in /etc/... – mo_maat Oct 02 '17 at 16:04
  • The local one definitely takes priority, I'm wondering if there's something else going on here, like something earlier in your local file over-riding the customization. – pleia2 Oct 02 '17 at 16:09
  • Got it. Confirms my assumptions. I'll just have to do a compare and figure out what is off. Thanks again. – mo_maat Oct 02 '17 at 16:18