Technology Weblog

Archive for the ‘commandline’ Category

Disabling the annoying system beep in Linux !

July 28, 2008

System beeps every time you press the backspace key one too many times, or just using emacs, can be quite disturbing. To shut them off: Just open your .bashrc file. vi ~/.bashrc and add the following xset b off xset b 0 0 0 Advertisements

Preventing man page contents from getting cleared

June 19, 2008

man pages are great help for learing new commands in *nix systems. There will be hardly any unix user who have not used it . When learning about new commands or options of commands using man pages it is a annoyance that man page contents get cleared on quiting man. We can change this behiavior […]

Cool trick to navigate directories using cd !

March 4, 2008

Everyone using Linux will like to use it to navigate easily between directories. Add the following code into .bashrc file. Now you can navigate foward and backward using cd ] and cd [ . Cool ! __COUNT=0 __BACK=0 cd () { if [ “${1}” = “[” ]; then if [ “${__BACK}” -lt “${__COUNT}” ]; then […]

Enabling spell checking for bash

December 27, 2007

shopt is a built-in command that controls shell behavior. In order to customize our shell environment we add the shopt commands to our .bashrc file. shopt -s cdspell This will correct the typing mistakes for cd command. eg: We need to go to directory testing/default. But by mistake type # cd tesring/default testing/default Since we […]

Perl commandline search and replace

December 22, 2007

There are many times when we need to search and replace certain words from files. Doing it manually will be very time consuming. One way to do it is using VI ( my favorite editor !) search n’ replace. The better option is using perl command line search and replace option. The syntax is the […]

4 Incredible sites to learn Shell scripting !

December 6, 2007

There are lots of online recources to learn shell scripting. I have list the best 4 of them and they cover mainly the my favourite shell BASH ( the best one too !). Bash tutorial | Programming tutorials Advanced Bash-Scripting Guide BASH Cures Cancer Heiner’s SHELLdorado Enjoy !

Generating Random passwords using mkpasswd utility

December 4, 2007

We can generate random passwords using mkpasswd utility #mkpasswd 3b&Ao2xzM By default mkpasswd generates alpha-numeric passwords of length 9 with one special character. We can define length using -l option and special characters using option -s. Some times special characters in password may cause problems. #mkpasswd -l 8 -s 0 8ns5pTNr The above command creates […]