8 ms·
FreeBSD Commands Cheat Sheet
- tannhaeuser 6y agoHope FBSD makes a comeback in mainstream computing. Used FreeBSD 4 for a mail server with sendmail until early 2000s with vinum RAID and afs distributed FS. Such an orderly, unconfused O/S.
- nix23 6y agoTesting out OpenServer6 with bhyve on FBSD12.2 ATM...so much for mainstream ;)
- cyri 6y agosame here! Until 2008/2009 I ran FreeBSD 5/6 on one of my internal business SCSI RAID servers, AKA home business cloud ;-) Compiled it myself, compiled PHP/MySQL/Apache, tweaked it and it always worked.
- Zenst 6y agoWell the Sony Playstation 4 based it's OS upon FreeBSD9 and they still update that today (3 days ago last checked). Unsure upon what the PS5 runs for certain, but can be sure that FBSD will live on and amazing how much from that codebase that people use. So whilst Linux for many put BSD's to distant past memories, the amount of code from it that is used in other projects/products down the line is larger than many realise and can imagine that more people run lines of code with FreeBSD origins today than early 2000's.
- trasz 6y agoThere's plenty of products based on FreeBSD, not just PlayStation: https://en.wikipedia.org/wiki/List_of_products_based_on_FreeBSD https://en.wikipedia.org/wiki/List_of_products_based_on_Free...
- nix23 6y ago>>Regarding the use of FreeBSD 12 As an operating system in PS5 https://tekdeeps.com/ps5-will-have-an-825gb-ssd-but-only-700gb-free/ https://tekdeeps.com/ps5-will-have-an-825gb-ssd-but-only-700... They even asked Dev's from FreeBSD ;)
- MaxBarraclough 6y agoDoes the PS5 use FreeBSD?
- deleted 6y ago[deleted]
- drewg123 6y agoThere are still some companies using FreeBSD. At Netflix, we serve a large percentage of the internet's traffic using our Open Connect CDN, which runs FreeBSD-current. WRT to the C10K problem mentioned below... We find FreeBSD scales quite well to at least several hundred thousand connections. Our largest experimental machines can serve nearly 400Gb/s of real customer traffic across hundreds of thousands of TCP conns from a single-socket AMD Rome. This is all with a "traditional" kernel-based workflow, serving media files with sendfile, and doing encryption of HTTPS traffic via kTLS (with NIC-based hardware TLS offload in this case). There is no DPDK or other userspace networking or storage.
- gonzo 6y agoNetgate uses FreeBSD as the base for pfSense, and Scott Long (formerly of Netflix) now leads that effort.
- chaosharmonic 6y agoThere's also Sony, which has been using custom FreeBSD derivatives to power PlayStations since the PS3.
- chaosharmonic 6y ago...disregard this. I managed to reply to the wrong parent, I think :-/
- hnlmorg 6y agoWasn't some of Nintendo's consoles also FreeBSD based?
- 0xcde4c3db 6y agoThey've used some code originating from BSD, but as far as I've read their actual operating systems have had a proprietary "embedded RTOS"-ish architecture rather than being based on (or even loosely resembling) any Unix lineage.
- hnlmorg 6y agoI doubt we'll even know for sure, but there is a FreeBSD kernel license in the Switch's copyright notices[1] though Wikipedia does paint a very different picture[2] [1] https://www.freebsdnews.com/2017/03/08/nintendo-switch-runs-freebsd/ https://www.freebsdnews.com/2017/03/08/nintendo-switch-runs-... [2] https://en.wikipedia.org/wiki/Nintendo_Switch_system_software https://en.wikipedia.org/wiki/Nintendo_Switch_system_softwar...
- 0xcde4c3db 6y agoAccording to the primary author of the Atmosphère custom firmware (which now contains an open-source clone of the Switch kernel), the "FreeBSD Kernel" copyright notice is only there because Nintendo used FreeBSD's sys/tree.h, with the actual kernel bearing no resemblance to FreeBSD [1]. [1] https://old.reddit.com/r/emulation/comments/hygtnx/mesosphere_opensource_nintendo_switch_kernel_now/fzhnjed/ https://old.reddit.com/r/emulation/comments/hygtnx/mesospher...
- hnlmorg 6y agoInteresting. Thanks for sharing
- tyingq 6y agoI'd like that as well, but my suspicion is that Linux is now "good enough" via things like io_uring that a highly visible comeback for *BSD is less likely.
- nix23 6y agoTo be honest, Linux is also not highly visible, sure for the HN-Community it is. But for normal Customers? They know Android, Windows, MacOS..that's it.
- tyingq 6y agoI had assumed "comeback" meant in the backend server space.
- tutfbhuf 6y agoWell Android is a Linux distro with a kernel patchset for smartphones.
- bch 6y agoWell... tell somebody you run a Unix operating system instead of Windows or Mac and keep notes on how many people say “Oh, you mean Linux?” Keep a smaller piece of paper for all the combined responses of “Oh, you mean [Open|Free|Net|Dragon Fly]BSD?” I’d be surprised if you need that second piece of paper at all. Written as a satisfied NetBSD user.
- Number157 6y agoFreeBSD is awesome.
- Fnoord 6y agomacOS and FreeBSD user-land have some similarities (because some of macOS user-land is based on FreeBSD) such as ifconfig(8), route(8), and netstat(1) (only 1 of these 3 is mentioned). Knowing one makes using the other one (or *BSD in general) easier.
- loeg 6y agoThe BSD parts of the macOS userland are directly copied from an old version of FreeBSD (more or less). So it's less that they're similar, and more that they are direct copies (at a point in time — they've since diverged somewhat).
- waynesonfire 6y agoI'm switching to FreeBSD for my current project and most likely future ones. Been setting things up and migrating the last few days. In fact, I'll probably convert my Linux dev box to FreeBSD and run Linux in a VM. Why the swtich? I'm really hoping that FreeBSD brings me some stability. I'm frustrated of learning how Ubuntu does things with every new named release. In a commercial environment, I'm aware and comfortable with the vast amount of infrastructure that's deployed to make our applications operable. One of my goals for FreeBSD is to come back to fundamentals and build my applications in an environment that I can understand and maintain without fully staffed teams. Couple things I noticed. As a Linux user for many years, I am working my way through the FreeBSD Handbook docs. Most of the material I'm familiar with so it's a fast read but have on numerous occasions learned new information. Especially useful since I'm learning how FreeBSD does things. It's no diferent than learning a new programming language in a paradigm that one would considers themselves an expert in. As a primarily app developer, rc(8) is just the right amount of abstraction and it makes sense. I get it intuitively. I really find it joyful when I encounter such designs. I love how FreeBSD is organized. This must be attributed to it being designed by a cohesive team. Great job, I noticed and very quickly. One downside so far, Google seems to answer _every_ linux / ubuntu question I throw at it or at least guides me close enough that I can sort my way through a problem. This hasn't been my experience with the FreeBSD system. Though I've tackled all my issues, it took more time. I should provide an update to this in the future since it could very well be because it's a new system. I'll also miss cgroups. FreeBSD has rctl(8) and it looks like jails have resources parameters as well. cgroups are very well deigned for the problem that they're solving for me. It gives the right control over the right resources in a cohesive manner. I'll end this with things that I'm excited for. I find learning new things does this to me so I'll share just for fun. I'm excited to learn jails and hope that I find it an improvement over Docker. I'm excited to deploy my erlang application and host my postgres database. I'm excited for root zfs. I'm excited to UPGRADE when the next version of FreeBSD comes out. This should work right? I _never_ upgrade my Ubuntu dev box. I'm excited that Wireguard is getting native kernel support in BSDs [https://www.phoronix.com/scan.php?page=news_item&px=WireGuard-For-OpenBSD-Kernel https://www.phoronix.com/scan.php?page=news_item&px=WireGuar...]
- drewg123 6y ago
- doublerabbit 6y agoFreeBSD has bHyve which when using bHyve in production is a bit of a chunky cog; however when it's turning, it turns. One of my servers just scored over 400 days uptime, hosting: Windows with a mixed various other *nix distributions adding failing RAM to the mix, I am astonished that I've had no issues. If you use the latest release it's no-longer experimental to having a jail with it's own network adapter. In theory this allows you to then host multiple bHyve instances; in that if a user somehow breaks out of their Virtual Machine they are stuck to the jail rather then the Host-OS. With such of a feature you can then lock clients in separate jails of their own, alone from any other client.
- 1over137 6y agoThere's a recent Intro To Bhyve here: https://www.youtube.com/watch?v=kXi1xaUqr20 https://www.youtube.com/watch?v=kXi1xaUqr20
- moonchild 6y ago> Update commands To clarify: # freebsd-update fetch install This is for updating to a newer patch of the current release. # freebsd-update upgrade -r <release> This is for getting to a new release (e.g. going from 12.2 to 13.0).
- cperciva 6y agoTo further clarify: "upgrade" downloads the new release, and you need two or three "install" commands after that (separated by reboots) to actually perform the upgrade.
- loeg 6y agoIt seems like most of the discussion on HN is meta-discussion about FreeBSD in general, rather than this particular cheatsheet. I like FreeBSD, but I wouldn't really recommend this particular cheatsheet. Why? Some examples from the top (and if the top of the cheatsheet is problematic, it's not a useful quick reference IMO): 1. mount_msdosfs: The 'ad' name is largely historical; you'll see 'ada' and 'da' these days (the latter for USB drives)[1]. 2. ISO9660 is also basically historical at this point; UDF is more likely. And it's useful to split out mdconfig (memory disk config) as its own command -- it's useful in a lot of contexts, and separating it might make that more obvious to someone reading. 3. Linux procfs and Linux procfs? This is confusing and doesn't help users looking to run Linux programs (a lot more work is needed; see [2]). Creating /proc because it doesn't exist is odd; the directory should exist in FreeBSD installations and images, regardless of whether procfs is mounted[3]. Get what you will from the document; if it helps you, great. [1]: https://lists.freebsd.org/pipermail/freebsd-questions/2016-September/273636.html https://lists.freebsd.org/pipermail/freebsd-questions/2016-S... [2]: https://wiki.freebsd.org/LinuxJails https://wiki.freebsd.org/LinuxJails , previously: https://news.ycombinator.com/item?id=24971456 https://news.ycombinator.com/item?id=24971456 [3]: https://github.com/freebsd/freebsd/blob/master/etc/mtree/BSD.root.dist#L116 https://github.com/freebsd/freebsd/blob/master/etc/mtree/BSD...
- stiray 6y agoAt least one command that i would put on a list, often not known by users: setfib[1] So simple. So powerful. [1] https://www.freebsd.org/cgi/man.cgi?query=setfib&apropos=0&sektion=0&manpath=FreeBSD+12.2-RELEASE&arch=default&format=html https://www.freebsd.org/cgi/man.cgi?query=setfib&apropos=0&s...
- Number157 6y agoPeople will use the best resources available, regardless of their faults. If you don't want people to use this resource, it's best to provide an alternative.
- loeg 6y agoI never asked people not to use this resource.
- dehrmann 6y agoI've always found the FreeBSD docs and environment to be more coherent than most Linux distros. The manual is really good at covering things you want to do. With Linux, I feel like I'm looking at a random blog post more often.
- Number157 6y agoIndeed. There is no linux, just a bunch of distros. Each is too small to support a meaningful documentation project beyond the basics.
- SubjectToChange 6y agoThe commercial linux distros have great documentation in my experience. What issues do you have with those?
- Number157 6y agoThat has not been my experience beyond fundamental aspects. Even if a distro had fantastic documentation, the issue of fragmentation would still remain. You can't just find people who "know linux", but you need people who know this distro. Then there's the issue of third party apps that may be packaged and tested for some distros and not others. The fragmentation is an issue in itself.