LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Command line interface question (https://www.linuxquestions.org/questions/linux-newbie-8/command-line-interface-question-4175424665/)

punchy71 08-29-2012 07:19 PM

Command line interface question
 
In the command line interface, are all the Linux commands universally the same to all Linux "distro's" and will work with all of them? Is there some incompatibility? Are there some "distro's" that have specific commands just to that "distro" and if so which "distro's" have them? How does the BSD's compare to Linux commands? Will Linux commands work under the BSD's? How about vice versa? If I remember correctly (I'm just going by memory here); Mac OS X is based on FreeBSD, so how does it's command's cross compatibility compare with all the above?

Thank you

KinnowGrower 08-29-2012 07:24 PM

Compare BSD and Linux

pixellany 08-29-2012 07:27 PM

For details, you'd need to go thru the documentation. Here is an "introductory" answer.....

First, it all begins with Unix---for any Unix-like system, you will find strong similarities.

Second, there is a distinction between the shell language, and the various utilities. For example, the most common Linux shell is BASH. You can have some assurance that this will be the same across various distros. Similarly, the core utilities also tend to be standard.

Short answer: When comparing unix-like systems, you will find much more that same than different. The exceptions is where you will spend your time.

vtel57 08-29-2012 07:30 PM

For further enlightenment --> http://www.linuxcommand.org/index.php

David the H. 08-30-2012 05:17 PM

Much of the *nix world revolves around the POSIX standard; a large, complex specification that defines a minimally-compatible operating system. Most *nix-style OSes try to conform to this standard at least in part, and so should have at least a basic level of compatibility. Above and beyond POSIX, however, individual operating systems are free to add or alter their features and behavior as they will, just as long as the POSIX behavior is still available when needed.

For example, POSIX specifies that the system must include a basic shell (/bin/sh) that supports certain features and syntax, and a set of core utilities such as grep, sed, and awk. So on Linux you have bash, and on some other systems you might be using ksh or another shell. ksh and bash are both POSIX compatible, and have many other syntax similarities, but there are also many differences as well. Similarly BSD has its own home-grown version of grep and sed, as does AIX, among others, and Linux uses versions written by the GNU project (bash is also a GNU program). These tools are again all broadly compatible at the POSIX level, but often also include features that go above and beyond the standard, which are not compatible. The gnu coreutils in particular have been expanded far beyond POSIX and include many useful features not found elsewhere.

What it all boils down to is that if you stick with POSIX, you can be fairly guaranteed that what you use is cross-platform (or at least can be made to be with minimal effort), but outside of that you have to check the documentation for the platform in question.


All times are GMT -5. The time now is 06:04 AM.