What's the difference between BSD-style and Unix-style command line options?

5,574

Solution 1

It depends on the program. ps is the one that you encounter the most often - somebody who grew up in a BSD environment will type ps auwwx while somebody who grew up in a System V environment will type ps -ef even though ps these days supports both types of options now.

Solution 2

Much and little, see:

Also worry about:

Case sensitivity e.g.

mailx -R  [email protected] .....  # GNU/Linux
mailx -r  [email protected] .....  # Unix

Options required in some flavours but not others e.g.

/usr/bin/echo -e "This\nis a\n test"  # GNU/Linux
/bin/echo        "This\nis a\n test"  # Unix

Additional options e.g.

last -y  # BSD  - include year
last -a  # GNU/Linux - include hostname

Solution 3

One of the major differences across the platform is positional arguments. Most of the command line utilities will enforce that flags come before positional arguments. That is, on a GNU system, the following is fine:

ls / -la

On BSD, these are typically not valid. Obviously, this isn't the extent of the differences between the two, but its one of the differences that drives me up the wall when I switch between them.

Share:
5,574

Related videos on Youtube

Eugene Yarmash
Author by

Eugene Yarmash

By day, a software engineer. By night, also a software engineer.

Updated on September 17, 2022

Comments

  • Eugene Yarmash
    Eugene Yarmash over 1 year

    I tried to google it but to no avail. Can anybody help me with this?