BSD General Commands

Is there a PDF file somewhere for the BSD General Commands that can be downloaded?

Mac mini 2018 or later

Posted on Jun 18, 2020 6:20 AM

Reply
40 replies

Jun 20, 2020 5:16 PM in response to snowshed

Then , in essence, it's a mini-OS. Working like DOS, no GUI.

Maybe not like a mini-OS, but it is similar to the DOS command prompt. Microsoft took parts of Unix, and parts of Digital Equipment Corporation RT operating system, and parts from CP/M operating system.


The opposite of what Microsoft does, correct?

The opposite of just about every interactive operating system at the time.


As for a hobby, it's old and long gone railroads in this area...

My Grandfather was an engineer. Scared the ... out of me when he took me into the cab and blew the horn. I was like 4 or 5 years old at the time. And my uncle lived across the street from the local round house and switching yard with the turntable. And there was both steam and diesel running the tracks at the time (mostly diesel).


The 'ls' command is what you are looking for and it does have a gazillion options.

man ls

ls -1 # digit 1

ls -l # lowercase L


The default 'ls' command sort would be just as you expected (straight alphabetical) with Test1 follwed by Test10, Test11, Test12, then Test2, Test20, Test21, Test22, etc...


I do not have sufficient experience with DOS to know how Microsoft would have done it, but I suspect it would be the same as the 'ls' command.


In truth, since I mostly have my Finder folders set to sort based on either Modified date or Added date, I have not noticed the difference in the sort ordering.


And I actually spend most of my time working in a terminal emulator ssh'ed (remotely logged) into a Linux system doing file system development for some unnamed Fortune 100 company.

Jun 21, 2020 8:31 AM in response to BobHarris

BobHarris wrote:

As for a hobby, it's old and long gone railroads in this area...
My Grandfather was an engineer. Scared the ... out of me when he took me into the cab and blew the horn. I was like 4 or 5 years old at the time. And my uncle lived across the street from the local round house and switching yard with the turntable. And there was both steam and diesel running the tracks at the time (mostly diesel).

Which railroad, if I may ask?


Currently, I'm interested in the various railroads that are/were part of the history of Cripple Creek, Colorado. This includes railroads that never came to fruition, but were dreamed up publicly, planned, incorporated, went bust before completion, etc.


I have a list of 23 such railroads, of which only 5 were built. On the technical level, there is a 6th, but it would be argumentative to call it a railroad in the normal sense.


BobHarris wrote:

The 'ls' command is what you are looking for and it does have a gazillion options.
man ls
ls -1 # digit 1
ls -l # lowercase L

Finding the gazillion options is the current specific focus. How may zeros in gazillion, BTW? LOL


BobHarris wrote:

The default 'ls' command sort would be just as you expected (straight alphabetical) with Test1 follwed by Test10, Test11, Test12, then Test2, Test20, Test21, Test22, etc..

The fact that my initial display of the results were rows and columns just added to my confusion.


BobHarris wrote:

I do not have sufficient experience with DOS to know how Microsoft would have done it, but I suspect it would be the same as the 'ls' command.


Correct.


BobHarris wrote:

In truth, since I mostly have my Finder folders set to sort based on either Modified date or Added date, I have not noticed the difference in the sort ordering.

I think you pretty much have to set up specially named files to notice the situation. Strangely enough, I learned about this when I took a course for programming in Basic.

Jun 21, 2020 2:02 PM in response to snowshed

(Yes I'm old enough to remember Pres. Nixon! LOL)

And I got to see President Kennedy stand up in a convertible on the NY Turnpike to wave at some Nuns standing on an overpass. There are a lot of us senior citizens hanging around these forums.


And herein lies the problems for beginners, how the <expletive deleted> is a beginner supposed to know this?

I would ask the same question. How would you know to find a .pdf file?


However, in defense of 'man' pages, they are for commands which are not the center of Apple's focus. Apple is focused on the GUI.


The Terminal interface is there because every Unix system has a terminal emulator interface to the Unix command line, and it is assumed that if you want to play in that space you have an idea about what to do or are interested enough to research it. For the most part Apple could care less about the command line. It is not what sells their products. iPhones, iPads, Apple Watches, Apple TV's do not even have a command line, even though they all have a some of the same operating system bits as macOS. Apple is not focused on the command line.


And I have observed over the years, that users with a GUI interface are mostly happy to not read a manual, and just do enough pointing and clicking to accomplish what want, even if it is not the most efficient approach.


So writing extensive manuals (even if shipped as PDF files) would not be very cost effective, and Apple has shown the world, from the first GUI based Mac, that you can make a boat load of money and not spend time writing extensive documentation for each release.


And that has created a 3rd party industry of book writers providing the manuals.


And I read that 8 feet of VAX/VMS manuals (more than once) and I can tell you that they left a lot to be desired, because what you think is important, is not always the tech writers opinion, and sometimes getting details out of the developer writing the software is next to impossible, and many times the information is presented in a dry manor, and no one bothers to connect the dots between feature X and feature Y to do something amazing. That is left as an exercise to the user.


At least the 3rd party book writing industry is motivated to make their books interesting so they can keep selling them.

Jun 21, 2020 2:11 PM in response to snowshed

Which railroad, if I may ask?

Remember I was 4 or 5 years old.


All I can tell you is that the switch yard was in Bangor, Pennsylvania, across the street from the post office. Bangor, PA is on the eastern side of Pennsylvania about half way up the state. The switch yard is gone, and today there are building where the tracks used to be.


How may zeros in gazillion, BTW? LOL

https://en.wikipedia.org/wiki/Indefinite_and_fictitious_numbers

Jun 22, 2020 10:06 AM in response to MrHoffman

My apologies, I meant to reply to this when you posted it, but I just forgot to get it done.


While I have Catalina installed on an external boot drive, it's not likely I'll be using it or any successor for "regular business" for a long time. I simply have too many 32 bit programs that are "dead". :-( So I don't see zsh anywhere in my near future.


Looking at PowerShell in Windows is on my to do list,. but not that high up at the moment. Too many computer things that interest me more. LOL


The same comment applies to Automator, as well as Macro Recorders in Windows. And now I've discovered Haiku, a modern version of BeOS.


All of this may seem silly, but I've found things one OS does that I wish another would do, and sometimes I come up with ways to accomplish that. Take Libraries in Windows. A POS in the way MS does it, but I devised a workaround to make them actually useful. Which led me to realize that an OS that uses some form of aliases/shortcuts/??????? can be made to emulate the Libraries. Note: these are not the same as a Library on a Mac. Relatively sure that Smart Folders/Search essentially may be the same thing.


OT: I like your avatar, after seeing it full size. I have 3 tuxedos! <G> And they are all a PITA! LOL

Jun 22, 2020 1:27 PM in response to snowshed

Smart folders are saved searches. Finder also provides saved searches.


Might want to look at using Mojave as a guest of a virtual machine on Catalina, as that’ll get you on newer software and a path toward Big Sur, while providing access to your older apps. Staying on old gets more expensive, until most folks get dragged forward, and getting dragged forward across the intermediate releases gets painful, the more of those there are.


Windows descended from DEC VAX/VMS by way of DEC MICA, FWIW.


Windows libraries and DLL, um, hades have been longstanding issues, though they’ve headed toward .NET as their portable framework. VAX/VMS had earlier versions of those same issues, and other redirection methods.


seL4, Geode, DragonflyBSD, and many other operating systems are all available.


All sorts of history around, and all sorts of new work too. And it’s always changing. Arm processor work with macOS apps now, too.

Jun 22, 2020 2:19 PM in response to MrHoffman

If saved searches from either origin point do/will not work, I know my alias workaround should work.


For the moment, will stay with Mojave. Stayed with El Capitan until the hardware gave it up. Really couldn't afford a Mac, but bought a "cheap" one anyway. No gots the moola for new software anyway. :-(


Another OS I'd like to play with is Amiga. Had a copy of GEM3 from DRI at one time, but stupidly sold it.


I saw snippets of Tim Cook announcing Apple will be building their own processors based on Arm architecture.

Jun 22, 2020 7:33 PM in response to BobHarris

For what I want to do at the moment, the command line examples for opening a page in Preview is the cat's meow. (Descriptive choice is for MrHoffman's benefit! LOL)


Besides the 2 examples, fiddled around and got the man page printed too. It seems there might be some type of minimum spaces needed after the command name before the vertical bar. I did one less space than shown, and got the message Preview.app did not exist. Likely cause by the Notes copy of your message that used a proportional font. I noticed the missing space here, then changed the font to a monospaced font in Notes, and went "Aha!". And it worked.


And, I see what you mean by the gazzilion options for the ls command. But that's OK in my book. I'd rather have the info and never need it, than to only have part of it and find, at some point in the future, I needed some of the missing info.


Now that I have this information, and smidgeon of experience with it, I think I understand the relevance of Barney-15E's link to the BSD website. That link made no sense to me until now. I had no knowledge foundation to build on.



Jun 23, 2020 6:34 AM in response to Barney-15E

That is logical, but for some reason, did not work when I tried it with 2 spaces between man and the vertical bar. Which, I suspect is a pipe, but not a Meerschaum pipe. LOL Geez, I can't remember how far back it was when I heard that word regarding computers.


Anyway... I just did some testing, one time using 2 spaces, the command failed. Every other time, it worked.


I know not why, but I have to acknowledge it might be this install of Mojave. It's had lots of data and settings migrated from earlier OS installs, starting with Snow Leopard, skipping a couple of OS versions. For some reason, Yandex is an optional search engine in Safari, the images used on the stacks folders are different, etc. Nothing that appears to cause issues, just little differences.


But now I've got a starting place to work with, which will suffice for now.

Jun 23, 2020 7:29 AM in response to snowshed

Vertical bar is the token for the shell pipe, yes, and bash parsing will usually need the tokens with one or more spaces on both sides of the token. One detail that confused me early in was the token placement in the “newer” if syntax.


Where bash uses a stream of characters in the pipe—which is what TCP also provides, a stream—PowerShell schleps around objects.


Yandex is one of the choices for searching. The Yandex image search works quite well.


And yes, Apple tweaks each new release, a phenomenon undoubtedly familiar to any long-time user.

Jun 23, 2020 8:33 AM in response to MrHoffman

But in my "ground up" fresh install of Mojave, Yandex is not listed in Safari preferences as a default search engine. Only four are listed, Google, Yahoo, Bing, and DuckDuckGo. I don't know why or how Yandex is in my Safari, but I did learn it was offered in iOS7 as a default choice. It's of no consequence to me as I don't use Safari.


I need a better understanding of "stream" in this case, but that will have to wait. :-)


I suspect you see how often MS forces updates in Windows 10. Irritates the devil out of me. I've got 3 W10 machines, and almost created a 4th in Virtual Box. Since none of them run on any kind of regular schedule, I spend an inordinate amount of time keeping them updated.

Jun 23, 2020 9:57 AM in response to snowshed

Haven’t checked on Yandex-related settings in a while. It was there (Safari Default Search Engine changed to Yandex - Apple Community) but does seem to have fallen out of the search engine selection list in Safari on the Mojave box just checked.


For a data stream on Unix and as with a literal stream, there are no delimiters, no data segmentation. It’s all one long string. The recipient gets to figure out where the interesting data within the stream begins and ends, what the string encoding might be, etc. The writer might write discrete hunks of data, but those hunks aren’t preserved for the recipient.


Particularly with TCP, the number of write reuests might not match the number of read requests. The reader loops and re-assembles the arriving contents into the app’s work buffer. The writer might write a single one-hundred-byte I/O write operation out, and the reader some combination of reads totaling 100. Or totaling more than one hundred, if the writer has slung subsequent I/O writes into the stream.


UDP both being datagrams and being intentionally unreliable works rather differently than TCP, here.


The app programming requirements around streams is part of why some folks will choose and use MQTT or ilk for networking, rather than using TCP directly, etc.


Windows references are largely lost on me. While the clients and servers in use around here are an eclectic mix, I’ve not particularly worked with nor managed Microsoft versions past Windows XP.

Jun 23, 2020 11:26 AM in response to snowshed

The thing about a Unix stream is that Unix does not impose rules about what the data looks like. So you can store anything in a file, you can send anything through a pipe, etc... The Unix operating system does not require you application to fit is round peg into the Unix square hole.


So while a stream may sound like total chaos, it makes perfect sense to the creator and the receiver of the bits, and anyone else that wants to play in the same sandbox as the creator and receiver for those bits. The handful of operating system developers are not imposing their rules on your data based on their limited to non-existent understanding of your data. They leave that up to the people creating the data.


As someone that started with 80 column punched cards, and worked with operating system that imposed on-disk formatting rules that in many cases was just an extension of an 80 column punched card, I came to appreciate the Unix data stream and the freedom it gave me when moving data from one medium to another (disk vs magtape) and between systems, ESPECIALLY when they were different manufactures and different operating systems (I spent a lot of time doing format conversions that had nothing to do with the data).

Jun 23, 2020 11:42 AM in response to BobHarris

I’ve long wondered if a whole lot of Unix code has latent timing dependencies, assuming that local I/O always presented the app with the amount of file data requested and when requested, but that the file system data—being a stream—could conceivably operate much closer to how TCP behaves. But I’d expect wholesale app and OS implosion, if the file system acquired enough latency.


But yes, stream I/O and file streams are useful.


I do prefer object to either stream or record data, though.


Lots of reading here, around bash and zsh and the other shells, on data manipulation, character encodings, algorithms, tools and frameworks and APIs (MQTT, SQLite, etc), all that and more is awaiting...

Jun 23, 2020 11:44 AM in response to MrHoffman

Yandex is in my El Capitan list, but not Mojave. Since I went from El Capitan to Mojave, I don't know where it dropped out either.


The data stream, TCP, and UDP info is now way above my pay grade, so I vote we let that go. LOL


Being retired, I do a little computer tutoring on the side. But in my area, almost no Macs. I only have one Mac client at the moment. Everyone else is Windows 10.


I want to cover the true basics of the computer, not the software. File Management, what's in a computer, how the various parts and pieces work together, etc. And I never assume there's a given level of knowledge at the user end. So I was shocked with a new client last week that already knew that file management was one of her weak points.


I'm going to have a chance to actually read the gazzilion ls options this afternoon. From that I will take away the info I need to answer the sorting question I have that started this whole discussion. LOKL


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

BSD General Commands

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.