-4

I tested freeBSD in a virtual machine on my Linux pc, and I kinda like it. I noticed that the file structure is similar to that of Linux, and many Linux commands will also work on freeBSD. My question is that will my programs that I made for Linux run on freeBSD? They are mainly written in c++ (which would be pre-compiled on Linux) with a few bash scripts (.sh)? .They are all console programs. Also, does freeBSD ship with the BASH shell by default? Thank you in advance!!

3
  • In response to "will my programs that I made for Linux run on freeBSD?": it depends on whether you wrote them to be portable or instead used Linux-specific code in them! In any case, you can easily find out by trying them in your VM!
    – Celada
    Jan 27, 2015 at 3:35
  • 1
    In response to "does freeBSD ship with the BASH shell by default", why don't you just have a look to see whether or not it's installed/available in your VM?
    – Celada
    Jan 27, 2015 at 3:36
  • This depends. No way to say. Jan 27, 2015 at 12:32

1 Answer 1

4

You are asking multiple questions here.

FreeBSD can run Linux programs without recompiling, you would have to test yours. See https://www.freebsd.org/doc/handbook/linuxemu.html

Now, I would recompile them on FreeBSD and see if they work - if you can get them compiled without FreeBSD compiler/linker complaining there are good chances they will just work.

As for "any Linux commands will also work on freeBSD."

Watch out, here, FreeBSD sed is not quite the same as GNU sed, for example. A lot of programs have small differences when it comes to behavior/parameters. Besides, with "Linux commands" you mean "Unix tools".

For other readers, the Unix tools on FreeBSD are much more similar to the Unix tools on Darwin (aka Mac OS X).

1
  • FreeBSD also has different tar (bsdtar), than Linux (GNU tar)
    – AntonioK
    Apr 8, 2015 at 13:33

You must log in to answer this question.