Customization How To   
   

Customization How To

Here is a list of little tidbits that I have done to my Linux to make it a more user-friendly experience. The whole point of Linux is to get it to fit your needs as easy as possible. So make life easier.

  • Change your shell to BASH (defualt in Ubuntu).

  • Edit your $HOME/.bashrc to suit your needs. This file gets executed every time you log into a terminal, so if there is an environment variable you always want initialized, put it in here somewhere near the end. For example, suppose you always want your own $HOME/bin to be on the $PATH variable, do the following:
    • export PATH="$PATH:~/bin"

  • Add the following aliases (just because I am lazy and I don't like to type out the whole word!)
    • alias x='exit'
    • alias l='ls -la'
    • alias c='clear'

  • If you ssh constantly to the same host or always change to the same directory
    • alias myssh='ssh username@some.domain'
    • alias ccdd='cd /path/to/constantly/used/directory/'

  • The following are pretty useful for anybody who programs and gets compiled code. The first one recursively finds any .pyc file starting from the current directory and removes it. The other two are similar for backup files that end with ~ and for Java class files. The -v option for rm gives verbose output to see what was exactly deleted. Be aware, rm permanently deletes the files!
    • alias rmpyc='rm -vrf `find -name "*.pyc" -type f`'
    • alias rmbak='rm -vrf `find -name "*~" -type f`'
    • alias rmcla='rm -vrf `find -name "*.class" -type f`'

  • The following is great when you have deleted a project from SVN and want to delete all the .svn housekeeping folders but keep the project content. It is tedious to go through every folder and subfolder and subsubfolder and... you get the idea. So, just like above, the following deletes every folder named .svn from the current directory and below.
    • alias rmsvn='rm -vrf `find -name .svn -type d`'

  • Add the following to your /etc/inputrc file. These commands must explicitly go into your inputrc the file pointed to by the $INPUTRC environment variable. If you are using an MSDL machine, you don't have root access, so you can't modify /etc/inputrc. The easiest thing to do is to copy /etc/inputrc to your home directory, call it whatever you want (by convention you should call it .inputrc) and then APPEND the above commands to the end of the file. Now in your .bashrc file in your home directory, add the line export INPUTRC="~/.inputrc" (or whatever you called the inputrc file). This way, everytime you start your shell, your $INPUTRC variable is properly set. Also, we copied the original /etc/inputrc and added our own stuff to it because the default inputrc file sets other variables and we didn't want to lose that. Obviously, the proper thing to do is create your own inputrc file and first source the global one and then add your own commands. This was just much lazier...I mean easier :)
    • set completion-ignore-case on
    • set show-if-all-ambiguous on
    If you are lazy...let me rephrase that...if you like to use all the functionality of Linux and like TAB completion so that you don't have to type out your entire command or filename, then this one is a must. The first one makes TAB completion case-insensitive, so if you have a file called "FiLe", both "fil" and "Fil" will TAB complete to it. The second one says that if there is more than one completion, show all of them.

  • Use CTRL-R as often as you can. In BASH, this searches through all of your old commands (well not all of them, maybe the last 500 or 1000, depending on what your $HISTSIZE environment variable is set at) and lets you use it. Hit CTRL-R, start typing the command and it will show you the match.
Some extra healthy tidbits!!!
  • Change your terminal color to a dark background and a bright font. The reason for this is that human eyes react to light, so it makes sense for your eyes to react to what you want to read, not the background that you are trying to ignore. I have my background set to brown/black and font set to green. The Matrix anyone?

  • Make sure your computer monitor is at eye level so that you don't have to look up or down. Looking slightly down is "apparently" okay since most people walk with their head looking straight ahead or slightly down (but if you ever stop in downtown Montreal to look up at the tall buildings, you will notice that you can only do it for a short while). The monitor should also be directly in front of you and not off to one side of you desk. You don't want to always be looking to one side. Both these issues have an effect on your neck, so take care.

  • If you start to feel pain in your wrists, take a break. If it is constant, see a doctor. But most importantly, look at your keyboard configuration. Is it to high up that you have to bend your wrists backwards to type, or too low that you have to constantly stretch to reach the top row of keys? It is bad but keyboards only come with two settings, high or low and nothing in between. I suggest pulling out some old books and placing them under the keyboard to get the proper level for your wrists. Contrary to popular belief, constant computer use is NOT related to carpal tunnel syndrome.

Maintained by Reehan Shaikh. Last Modified: 2008/10/02 18:03:44.