I’ve been using Ubuntu for the last four years.
I have a basic knowledge of shell commands and I prefer working in a terminal rather than using a GUI. Recently I’ve started using a Mac.
I’ve tried a few terminal commands (that I use on Ubuntu) in the Mac terminal and it seems to respond in mostly the same way.
Are there any significant differences in the commands I use, the task(s) they perform or the shell environment that I should be aware of?
If you did a new or clean install of OS X version 10.3 or more recent, the default user terminal shell is bash.
Bash is essentially an enhanced and GNU freeware version of the original Bourne shell, sh. If you have previous experience with bash (often the default on GNU/Linux installations), this makes the OS X command-line experience familiar, otherwise consider switching your shell either to tcsh or to zsh, as some find these more user-friendly.
If you upgraded from or use OS X version 10.2.x, 10.1.x or 10.0.x, the default user shell is tcsh, an enhanced version of csh(‘c-shell’). Early implementations were a bit buggy and the programming syntax a bit weird so it developed a bad rap.
There are still some fundamental differences between mac and linux as Gordon Davisson so aptly lists, for example no
useraddon Mac andifconfigworks differently.The following table is useful for knowing the various unix shells.
You may also find these guides helpful:
http://homepage.mac.com/rgriff/files/TerminalBasics.pdf
http://guides.macrumors.com/Terminal
http://www.ofb.biz/safari/article/476.html
On a final note, I am on Linux (Ubuntu 11) and Mac osX so I use bash and the thing I like the most is customizing the .bashrc (source’d from
.bash_profileon OSX) file with aliases, some examples below.I now placed all my aliases in a separate .bash_aliases file and include it with:
in the .bashrc or .bash_profile file.
Note that this is an example of a mac-linux difference because on a Mac you can’t have the
--color=auto. The first time I did this (without knowing) I redefinedlsto be invalid which was a bit alarming until I removed--auto-color!You may also find https://unix.stackexchange.com/q/127799/10043 useful