Skip to content

Instantly share code, notes, and snippets.

@gabssnake
Last active December 17, 2015 15:19
Show Gist options
  • Save gabssnake/5630786 to your computer and use it in GitHub Desktop.
Save gabssnake/5630786 to your computer and use it in GitHub Desktop.
bash_profile file for terminal
export PATH=/Applications/MAMP/Library/bin/:/Applications/MAMP/bin/php/php5.3.6/bin/:/opt/local/bin:/opt/local/sbin:$PATH
# coloring the terminal
# turn on colors
export CLICOLOR=1
# change colors
# http://www.macosxhints.com/article.php?story=20031025162727485
# http://hints.macworld.com/article.php?story=20031025162727485
#export LSCOLORS=exfxcxdxbxegedabagacad #default
#export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export LSCOLORS=gxBxhxDxfxhxhxhxhxGxGx
# Mayuscules are bold version
# a A black
# b B red
# c C green
# d D yellow
# e E blue
# f F purple
# g G teal
# h H light grey
# x default foreground or background
# They are set in pairs, foreground (f) then background (b)
# i.e. fbfbfbfbfbfbfbfbfbfbfb for all 11 settings
# 1 directory
# 2 symbolic link
# 3 socket
# 4 pipe
# 5 executable
# 6 block special
# 7 character special
# 8 executable with setuid bit set
# 9 executable with setgid bit set
# 10 directory writable to others, with sticky bit
# 11 directory writable to others, without sticky bit
# shown each line like: user@host ~ $
# http://www.arwin.net/tech/bash.php
export PS1='\[\e[0;36m\]\u@\h \[\e[0;34m\]\w \$ \[\e[m\]'
# \u@\h # user@host
# \w # current directory - complete
# \W # current directory - just folder
# \$ # dollar sign
# \[\e[m\] # no color
# \[\e[0;30m\] # black
# \[\e[0;31m\] # red
# \[\e[0;32m\] # green
# \[\e[0;33m\] # orange
# \[\e[0;34m\] # blue
# \[\e[0;35m\] # purple
# \[\e[0;36m\] # teal
# Black 0;30 Dark Gray 1;30
# Blue 0;34 Light Blue 1;34
# Green 0;32 Light Green 1;32
# Cyan 0;36 Light Cyan 1;36
# Red 0;31 Light Red 1;31
# Purple 0;35 Light Purple 1;35
# Brown 0;33 Yellow 1;33
# Light Gray 0;37 White 1;37
# -G show colors
# -p add a slash to folders
# -F adds more flags to other files
# -h adds human readable dates
alias ls='ls -GpFhl'
alias cd..='cd ..'
# -i prompts confirmation
# -v verbose mode
alias rm='rm -iv'
alias mv='mv -iv'
alias cp='cp -iv'
# make rm command send stuff to .trash
function rm () {
local path
for path in "$@"; do
# ignore any arguments
if [[ "$path" = -* ]]; then :
else
local dst=${path##*/}
# append the time if necessary
while [ -e ~/.Trash/"$dst" ]; do
dst="$dst "$(date +%H-%M-%S)
done
mv "$path" ~/.Trash/"$dst"
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment