Posterous theme by Cory Watilo

Filed under: Linux

Swap caps and control keys in Gnu/Linux

If you are an Emacs user then you will definitely understand the importance of control key. So, emacs user usually shift their ctrl to some different key for the sake of saving their little finger. In my case i swapped my ctrl and caps keys. Open the /etc/X11/xorg.conf file and add the following line in the Section "InputDevice" Option "XkbOptions" "ctrl:swapcaps" Now your caps is ctrl and ctrl is caps.

Grep

GREP:: Prints line matching a pattern. While digging out for pattern matching stuffs, i came across a brilliant search utility that works fine on Gnu/Linux. Actually all my mobile numbers were scattered in different files and each file containing huge amount of text including mobile numbers!! And i only wanted those numbers.<br />

 

atif@ct:~$ grep [0-9] home/atif/foo home/atif/bar
home/atif/foo:+91 9930001234
home/atif/foo:+91 9833730782
home/atif/foo:+91 9890422344
home/atif/bar:+91 9878565545
home/atif/bar:+91 9890786567