Linux

Bash Rc Customization

.bashrc customizations

Any system file in Linux that ends with ‘rc‘ ( rc stands for run command ) will have startup instructions for the associated application.
.bashrc, .vimrc, .mailrc, .chsrc etc are few examples.

Here are some useful customizations in .bashrc file. Once .bashrc is edited, to see its effect, you must run the command :

1. $source ~/.bashrc

1. grep ( global regular expression print )

1. alias grep='grep -i -n -R --color'

This alias is useful in displaying the grep result with more information.

2. to increase the history file size, add these four lines.

1. shopt -s histappend
2. shopt -s cmdhist
3. export HISTSIZE=100000
4. export HISTFILESIZE=100000

This will maintain enough information that are required in most cases.

3. cd followed by ls

Let us define a new function cdl

1. cdl()
2. { command cd "$@" && ls; }

4. to find the size of current folder du -sh

1. alias sd='du -sh'

5. to find the size of all files inside the current folder du -sh *

1. alias sall='du -sh *'

6. df -h is useful to find out how much free space is available in various partitions of the hard disk.

PmWiki

pmwiki.org

Blix theme adapted by David Gilbert, powered by PmWiki