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!!

  • 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 '15 at 3:35
  • 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 '15 at 3:36
  • This depends. No way to say. – DisplayName Jan 27 '15 at 12:32

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).

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.