Skip to content

Instantly share code, notes, and snippets.

@PardhuMadipalli
Created June 4, 2020 14:11
Show Gist options
  • Save PardhuMadipalli/42ce33fe7b0a1530daa69fe1354f6a23 to your computer and use it in GitHub Desktop.
Save PardhuMadipalli/42ce33fe7b0a1530daa69fe1354f6a23 to your computer and use it in GitHub Desktop.
Bash profile with a few useful settings for Linux
#Command to edit bash_profile from any directory
alias bashedit='vi ~/.bash_profile'
# Command to source the current .bash_profile file from any directory. After successful soouricng, it saves a copy of the file as .bash_profile.backup
alias bashsource='source ~/.bash_profile && cp ~/.bash_profile ~/.bash_profile.backup'
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$"
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
export TZ=Asia/Kolkata
# Command o see which files occupy the maximum space in your home directory
alias dutop='du -Sh | sort -rh | head -5'
alias ls='ls -GFlh --color=auto'
# Command to list only directories
alias l.='ls -d .* --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# If you are in India, set the timezone to Kolkata
# Use command findf followed by a string to seach for that file/directory name.
# This function will add wildcard character * at the beginning and at the end.
# usage example: "findf hello"
findf ()
{
string1=*;
string2=*;
searchstring=$string1$1$string1;
find . -iname $searchstring
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment