If you are only concerned with files that are actually executed, such as .bash_profiles and friends, you may be able to get away with using e.g. uname to differentiate based on the system the code runs on.
For example, completely untested and with the caveat that I don't have an OS X to try things on, if you currently have on Linux:
alias ll='ls -lFA'
and on Mac OS X:
alias ll='ls -lFAx'
(where -x makes OS X's ls do something which GNU ls does by default), then they can be combined into something like this:
OS="$(uname -s)"
if test "$OS" = "Darwin"; then
alias ll='ls -lFAx'
# ...other OS X-specific things go here...
else if test "$OS" = "Linux"; then
alias ll='ls -lFA'
# ...other Linux-specific things go here...
fi
# ...generic things go here...
The only requirement then is that uname -s works in mostly the same way (it should, since both systems are reasonably POSIX-y and uname -s is required by POSIX (thanks Marco for pointing this out)), and that the syntax for shell script branching based on a string comparison is the same. You can probably test based on other criteria as well; e.g., you could look for /etc/lsb_release, check whether /proc/sys/kernel/ostype contains "Linux", or whatever other tests you can come up with.