Hello Peoples,
Again in my studies I have came across a cool bash trick that I tested on my Red Hat Linux Server.
For someone who does not always use the tab completion for traversing directory hierarchy. Then you may find this hack interesting.
If you edit with your favorite editor your .basrc file in your home directory. You can add this text to the file to assist you with misspelled directory changes. Have a look:
First edit your .bashrc file in the home directory.
Code:
[root@radio5 ~]# vi ~/.bashrc
Now add the following to the file.
Now logout and log back in. And check if it is working by miss typing a directory change.
Code:
[root@radio5 ~]# cd /var/lg
/var/log
[root@radio5 log]#
As you can see I tried to type cd /var/log however I miss typed /var/lg missing the o.
Bash automatically spits out the correct path.
Have fun,
Jaysunn