Skip to content

Instantly share code, notes, and snippets.

@saltnlight5
Created October 26, 2012 16:04
Show Gist options
  • Save saltnlight5/3959642 to your computer and use it in GitHub Desktop.
Save saltnlight5/3959642 to your computer and use it in GitHub Desktop.
linux_tips.sh
# Set bash shell prompt - show current working dir and shell name in two lines.
# The '\e]2;\w\a' will set and update the term title bar
export PS1='\e]2;\w\a\e[32m\]\u@\h:\e[33m\]\w\e[0m\]
$(basename $SHELL)> '
# Set kshshell prompt - show current working dir and shell name in two lines.
export PS1='$USER@$HOSTNAME:$PWD
$(basename $SHELL)> '
# Grep dir recursively with certain file types only
grep -r --include='*.hbm.xml' Account *
grep -r --include='*.{spring.xml,java}' AccountManager *
# See TCP connection by PID
netstat -antp |grep <PID>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment