There are variations amongst Unices and variations amongst Linuces so the question is not really answerable. Some system administration utilities are very specific to a particular vendor or platform, or even version. The basic shell commands generally work the same, although there are some minor differences in behavior. The manual pages for individual commands should ideally tell you whether they conform to a standard such as
POSIX or XPG4 which is usually a sign that they are reasonably portable.
In general, the
GNU coreutils (basic commands you are likely to be learning if you are new to Unix / Linux) are somewhat more flexible and feature-rich than what
POSIX requires, and thus the non-
POSIX extensions are somewhat likely to be missing from the same commands as supplied by a commercial vendor (but usually you can get the
GNU coreutils for any platform if you require them, unless there is some silly artificial political / managerial restriction to obstruct you). The
GNU suite is installed by default on Linux, but even the free *BSDs have their own versions of the same utilities, with a slightly different set of features and options. (In fact some of the BSD utilities trace their lineage pretty much all the way back to the original AT&T versions, whereas the
GNU utilities are newer reimplementations, as a rule.)
Some vendors have a basic feature set which predates
POSIX, and they don't want to change it in order to be backwards-compatible with themselves, and so
POSIX or XPG4 versions of the basic tools is an optional add-on.
For these and related reasons, truly portable shell scripts are hard to write, but if you restrict yourself to the documented
POSIX feature set, your scripts should be fairly portable to any modern
POSIX platform. Even experienced scripters sometimes get these things wrong, and if you mainly just want to learn, you don't need to worry about these things at this point.