Pages

Monday, March 5, 2012

Use shopt In Linux

shopt is used in Toggle the values of variables controlling optional shell behavior.We can use cdspell along with Shopt to automatically correct mistyped directory names on cdlike [root@vx111a ~]# shopt -s cdspell[root@vx111a ~]# cd /var/ttp/var/tmp[root@vx111a tmp]# cd /var/tmp[root@vx111a tmp]# cd /var/fmp/var/tmp[root@vx111a tmp]# cd /var/fup/var/f...
Read More

Push and Pop Directories on to Stack

Linux allows us to push directories on to the stack and pop them when needed. Pushd : used to push directories on to the stackPopd   : used to pop directories from the stackDirs    : allows us to see what directories are available on the stack One thing to remember is that what ever the directory that is currently pushed is the one that popped first. Consider if I push /etc/ and then /var, then if I...
Read More

Using CDPATH

We are already aware of the PATH variables in linux.The locations specified in the PATH are searched for something it that is not currently found in the current directory. Linux also supports CDPATH which provides directories to look when cd command changes to other locations like [root@vx111a ~]# export CDPATH=/etc[root@vx111a ~]# cd mail/etc/mail[root@vx111a mail]# pwd/etc/mail[root@vx111a mail]# cd -/root[root@vx111a ~]#...
Read More