I have the question as the title. In Ubuntu or Linux, I changed my keyboard layout. change I mean I actually remap entire keyboard. For example, I map the tab key to ctrl, assign third-level key to caps, so that when I press caps (it's now the third-level key) and h, it prints {.
And in Linux, it stores keyboard layout in /usr/share/X11/xkb/symbols/.
So where is the location in the Mac?
Maybe this will help:
In System Preferences | Keyboard | Modifier Keys you can swap keys