If you made a new or clean installation of OS X version 10.3 or later, the default user terminal shell is bash.
Bash is essentially an extended and free version of GNU's original Bourne shell, sh. If you have previous experience with bash (often by default in GNU / Linux installations), this makes the OS X command line work familiar, otherwise consider switching your shell to either tcsh or zsh, as some find it friendly .
If you upgraded or used OS X version 10.2.x, 10.1.x or 10.0.x, the default user shell is tcsh, an extended version of csh ('c-shell'). The early implementations were a little flawed, and the programming syntax was a little weird, so he developed a bad rap.
There are still some fundamental differences between mac and linux, since Gordon Davisson lists them so precisely, for example, no useradd on Mac and ifconfig works differently.
The following table is useful for knowing the various unix shells.
sh The original Bourne shell Present on every unix system ksh Original Korn shell Richer shell programming environment than sh csh Original C-shell C-like syntax; early versions buggy tcsh Enhanced C-shell User-friendly and less buggy csh implementation bash GNU Bourne-again shell Enhanced and free sh implementation zsh Z shell Enhanced, user-friendly ksh-like shell
You can also find helpful tips:
http://homepage.mac.com/rgriff/files/TerminalBasics.pdf
http://guides.macrumors.com/Terminal
http://www.ofb.biz/safari/article/476.html
Finally, I am on Linux (Ubuntu 11) and Mac osX, so I use bash and I like setting up the .bashrc file (source'd from .bash_profile on OSX) with aliases, some examples below. Now I put all my aliases in a separate .bash_aliases file and included it with:
if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
in a .bashrc or .bash_profile file.
Note that this is an example of the difference in mac-linux, since on Mac you cannot have --color=auto . The first time I did this (without knowing), I redefined ls as invalid, which was a little disturbing until I deleted --auto-color !
You can also find https://unix.stackexchange.com/q/127799/10043 useful
# ~/.bash_aliases # ls variants #alias l='ls -CF' alias la='ls -A' alias l='ls -alFtr' alias lsd='ls -d .*' # Various alias h='history | tail' alias hg='history | grep' alias mv='mv -i' alias zap='rm -i' # One letter quickies: alias p='pwd' alias x='exit' alias {ack,ak}='ack-grep' # Directories alias s='cd ..' alias play='cd ~/play/' # Rails alias src='script/rails console' alias srs='script/rails server' alias raked='rake db:drop db:create db:migrate db:seed' alias rvm-restart='source '\''/home/durrantm/.rvm/scripts/rvm'\''' alias rrg='rake routes | grep ' alias rspecd='rspec --drb ' # # DropBox - syncd WORKBASE="~/Dropbox/97_2012/work" alias work="cd $WORKBASE" alias code="cd $WORKBASE/ror/code" # # DropNot - NOT syncd ! WORKBASE_GIT="~/Dropnot" alias {dropnot,not}="cd $WORKBASE_GIT" alias {webs,ww}="cd $WORKBASE_GIT/webs" alias {setups,docs}="cd $WORKBASE_GIT/setups_and_docs" alias {linker,lnk}="cd $WORKBASE_GIT/webs/rails_v3/linker" # # git alias {gsta,gst}='git status' # Warning: gst conflicts with gnu-smalltalk (when used). alias {gbra,gb}='git branch' alias {gco,go}='git checkout' alias {gcob,gob}='git checkout -b ' alias {gadd,ga}='git add ' alias {gcom,gc}='git commit' alias {gpul,gl}='git pull ' alias {gpus,gh}='git push ' alias glom='git pull origin master' alias ghom='git push origin master' alias gg='git grep ' # # vim alias v='vim' # # tmux alias {ton,tn}='tmux set -g mode-mouse on' alias {tof,tf}='tmux set -g mode-mouse off' # # dmc alias {dmc,dm}='cd ~/Dropnot/webs/rails_v3/dmc/' alias wf='cd ~/Dropnot/webs/rails_v3/dmc/dmWorkflow' alias ws='cd ~/Dropnot/webs/rails_v3/dmc/dmStaffing'