Swaps the ctrl and cmd keys in Ubuntu
One of the biggest challenges we encounter when switching from OSX to Linux, is the keyboard mapping. We are too accustomed to
command + c to copy and ctrl + c is strange and messes with your muscular memory, from there everything looks harder than it really is, we become frustrated and in the end we just go back to where we were and leave the change as a dream.
That was my story so many times, I got excited with going back to Ubuntu and eventually I said: “Well, Ubuntu it's so close but it's still missing something”. This time I wanted to go further beyond, and started adapting Linux to me instead of trying to adapt myself to Linux.
This is a frequently asked question in forums like Stack Overflow; “How can I map the command button to work as it works in OS X?” You can find a lot of solutions there, some work better than others, some doesn't work at all. At this point, I dedicated some time to investigate and get a deeper insight about why some solutions work for some people, but not for me. The answer to that is the desktop, while the change in gnome 3 is smooth even from a graphic interface; on the other hand the solution for Unity is hackier and requires a terminal to do it.
In this How-to tutorial, I want to share my experience with this problem. It may be useful for you.
My first recommendation is to get Ubuntu Gnome instead of the regular Ubuntu (Unity) flavor; this makes things A LOT easier. If you have Gnome then, you are in a favorable position. Ubuntu Gnome has built-in a packed app named Tweak tool, this application is going to be your ally due to a vast number of switch command key tasks included.
Gnome way
Just open Tweak tool, go to: Typing tab, and choose: Ctrl is mapped to Win keys in Alt/Win key behavior and you are done, it works like a charm.

Regular/Unity way
If you don't have Tweak tool, then you’ll need to get your hands dirty and use Xmodmap, it’s a utility for modifying keymaps and pointer button mappings in Xorg. Once you have the right configuration it's not that hard, all you need to do is to create a file named ~/.Xmodmap and copy and paste these instructions:
remove control = Control_L remove mod4 = Super_L Super_R keysym Control_L = Super_L keysym Super_L = Control_L keysym Super_R = Control_L add control = Control_L Control_R add mod4 = Super_L Super_R
This code setting swaps the left ctrl and the left/right cmd keys. That is, cmd becomes ctrl and ctrl becomes cmd.
Be aware that if you have Unity it's going to become an inconvenience because Ctrl shows the Dash; then you’ll need to change it, and Unity doesn't have any built-in way to achieve that. Therefore, you are going to need Compizconfig. Otherwise, if you have Gnome you are in a safe zone; Gnome has the option to change all those kind of “inconveniences” in the settings.
At this point we just need to make the change for this session. To accomplish that just type in the terminal xmodmap .Xmodmap and you are good to go :)
If this patch doesn't apply automatically after a computer restart, then add this linexmodmap .Xmodmap to ~/.profile file.
This How-to is based on: http://ineed.coffee/881/configure-the-keyboard-for-your-macbook-and-ubuntu-12-04/
Written by Chriss Mejía.