Skip to content

Instantly share code, notes, and snippets.

@vicly
Created September 23, 2018 23:36
Show Gist options
  • Save vicly/4bab423e0ba378cf9c61cdaca6d5f4d6 to your computer and use it in GitHub Desktop.
Save vicly/4bab423e0ba378cf9c61cdaca6d5f4d6 to your computer and use it in GitHub Desktop.
[bash profile] #Bash #Shell #Handy
# Terminal
export TERM="xterm-color"
PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ '
export CLICOLOR=1
export LSCOLORS=Exfxcxdxbxegedabagacad
export GREP_OPTIONS='--color=auto'
# Alias
alias ll='ls -FGlAhp'
alias cpwd="pwd | tr -d '\n' | pbcopy"
alias f='open -a Finder ./' # f: Opens current directory in MacOS Finder
alias c='clear'
# lr: Full Recursive Directory Listing
# ------------------------------------------
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'' | less'
# -------------------------------
# FILE AND FOLDER MANAGEMENT
# -------------------------------
zipf () { zip -r "$1".zip "$1" ; } # zipf: To create a ZIP archive of a folder
alias numFiles='echo $(ls -1 | wc -l)' # numFiles: Count of non-hidden files in current dir
alias make1mb='mkfile 1m ./1MB.dat' # make1mb: Creates a file of 1mb size (all zeros)
alias make5mb='mkfile 5m ./5MB.dat' # make5mb: Creates a file of 5mb size (all zeros)
alias make10mb='mkfile 10m ./10MB.dat' # make10mb: Creates a file of 10mb size (all zeros)
# Init jenv
if which jenv > /dev/null; then eval "$(jenv init -)"; fi
# JDK
export JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home'
# Git
source /Users/liuy5/vic_bash/git-completion.sh
# Custom bash scripts
source /Users/liuy5/vic_bash/vic-commands.sh
# see https://natelandau.com/my-mac-osx-bash_profile/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment