This is Unix/Linux-specific again, but for a coarse result, you could run
which on Linux should say "Linux". See the command line options for more information; for a quickie, try
There is no standard, universal way to get to know what operating system there is at the other end--how could there be, given that they are all different? You can always take a look at the filesystem, e.g., what kind of things you can find at the top-level/root directory, which may give you clues about what system you're on (look at things that are "unique" to some systems, such as /Volumes on a Mac OS X, or drive names like C: on Windows, and so on). Once you know if it's Windows, some kind of Unix-like system or something else, you can get into details for that system family.
Edit: a thought crossed my mind, but I take it you didn't mean the hostname, which you'd get (on *nix) by running