BSD General Commands
Is there a PDF file somewhere for the BSD General Commands that can be downloaded?
Mac mini 2018 or later
Is there a PDF file somewhere for the BSD General Commands that can be downloaded?
Mac mini 2018 or later
The operating system already has the standard UNIX (BSD) command-line tools installed with their respective man(1) pages. Apple does not produce a PDF documenting which commands are installed, nor do they install any GPL3 licensed GNU tools that you will find on most Linux distros.
That last sentence is important because the majority of the posts online (e.g. stackoverflow, etc.) about how to use these same named tools are posted by those using the GNU version on Linux, not the BSD version on macOS. Beware of the respective tool difference.
Commnd Line Primer from Apple
and you are looking for
ls
as in list for people that do not like to type
also established when computers had less than 64 kilobytes of memory and disk space that was in the kilobytes. saving space was important.
Off topic, but it really frustrates me about Apple not telling you of everything that is on the computer when you buy it. Curl being one of them.
In the good old days (post Steam, but definitely diesel electric) when you got a commercial operating system (Digital Equipment Corporation VAX/VMS) you got about 8 feet of manuals to go with it.
On periodic basis you would get updates, and have to remove page X from binder B and insert page Z, wash, rinse, repeat.
Then when you got a new major operating system release, you would get another 8 feet (or it might grow to 9 feet) manuals.
And the cost of an operating system upgrade, along with those manuals was not cheap. Home users would never ever pay that kind of money for an operating system and the documentation.
And the complexity of those systems was nothing like what you have in any personal computer operating system these days.
NO ONE ships complete paper manuals anymore.
Most either have built-in HELP of some kind (see the menu bar), or depend on 3rd party bookwriters to provide the various guides and documentation (Missing Manual Series, XYZ for Dummies Series, etc...)
With the Web, many documents can be found via Google, either directly from the vendor, or again 3rd party webpages.
For the terminal/shell interfaces, the de-facto documentation is the 'man' page:
man ls
man sort
man echo
man cd
man cat
man curl
etc...
And the Terminal interface is Not Apple's focus. The fact that I personally love it, means I am in the way less than 1% group of people that make a living working in a terminal session, and maybe also the "Old Fart" demographic 😀
The fact that I know where to get curl documentation, just means I have a history that made me aware of that command and that I would likely find documentation via the 'man' command.
But I do understand that a lot of times people do not know the right things to ask via a Google search, and even if they find something, it may not be well written (OK, few of the 'man' pages are well written either; you end up having to do a lot of reading-between-the-lines; which means you have prior experience).
So I'm not picking on you. And besides you cannot run Steam Engines forever. Computers are a good winter low physical stress (maybe a little expensive if you get into it) hobby. You could learn to create Steam Locomotive webpages. Write scripts and such to process Steam Locomotive statistics. Build spreadsheets on Steam Locomotives. You could get the Railroad Tycoon game. All kinds of things you can do with a computer 😀
BobHarris wrote:
Off topic, but it really frustrates me about Apple not telling you of everything that is on the computer when you buy it. Curl being one of them.
In the good old days (post Steam, but definitely diesel electric) when you got a commercial operating system (Digital Equipment Corporation VAX/VMS) you got about 8 feet of manuals to go with it.
On periodic basis you would get updates, and have to remove page X from binder B and insert page Z, wash, rinse, repeat.
Then when you got a new major operating system release, you would get another 8 feet (or it might grow to 9 feet) manuals.
And the cost of an operating system upgrade, along with those manuals was not cheap. Home users would never ever pay that kind of money for an operating system and the documentation.
These days, the documentation could be put on the hard drive as a PDF, or files, as needed. At the same time, minimal printed documentation should be provided to tell the user what you can find on the hard drive. And for users like me, printed in something larger that 2 pt. fonts. LOL
BobHarris wrote:
NO ONE ships complete paper manuals anymore.
Most either have built-in HELP of some kind (see the menu bar), or depend on 3rd party bookwriters to provide the various guides and documentation (Missing Manual Series, XYZ for Dummies Series, etc...)
With the Web, many documents can be found via Google, either directly from the vendor, or again 3rd party webpages.
Sadly, the Help files online are often useless. The often leave out the very basic information a beginner with that program needs. The documentation is often disjointed, and can't be printed in a manner the user can then write their own notes in the margins.
I always, always, always look at things like this from the perspective of the beginner, for 2 reasons.:
BobHarris wrote:
For the terminal/shell interfaces, the de-facto documentation is the 'man' page:
man ls
man sort
man echo
man cd
man cat
man curl
etc...
And herein lies the problems for beginners, how the <expletive deleted> (Yes I'm old enough to remember Pres. Nixon! LOL) is a beginner supposed to know this?
BobHarris wrote:
But I do understand that a lot of times people do not know the right things to ask via a Google search, and even if they find something, it may not be well written (OK, few of the 'man' pages are well written either; you end up having to do a lot of reading-between-the-lines; which means you have prior experience).
This seems to be especially true of Windows 10 articles. If there's no date on the article or the article is more than 2 years old, I expect to find errors.
BobHarris wrote:
So I'm not picking on you. And besides you cannot run Steam Engines forever. Computers are a good winter low physical stress (maybe a little expensive if you get into it) hobby. You could learn to create Steam Locomotive webpages. Write scripts and such to process Steam Locomotive statistics. Build spreadsheets on Steam Locomotives. You could get the Railroad Tycoon game. All kinds of things you can do with a computer 😀
I haven't considered this to be picking on me, or in any way offended. You're certainly right about steam engines, the body just gets too old to do it.
When it comes to software, I'm a "productivity" fan. What can I make the computer do for me. I used to buy every word processor, spreadsheet, database that came out just to see what could be done with them. These days, I'm picking about that, the money just isn't there. :-(
Apple documents the UI that the vast majority of folks are expected to use.
Even app developers are not expected to be heavily using zsh or bash.
With most of the Apple platforms, there is no (accessible) command line.
This shift away from the command line has been a long-term trend, and a long-term shift, and I don’t see it changing.
This trend whether we’re discussing Apple and its products, Microsoft and Windows, or the hosted-services providers.
There are books on the topic around, for those interested.
One I read long ago was Unix for the Impatient.
That was generic, but a good intro.
That book is getting old, and will be missing more recent topics and trends.
There are other books.
Learning UNIX for OS X might be interesting, and that’s not particularly old.
But that book will undoubtably lack a discussion of the shift to zsh.
I’ve written technical books. It’s an effort. And the books get stale fast.
There are other resources, too:
https://www.youtube.com/results?search_query=bash%20command%20line%20os%20x
BobHarris wrote:
...
Here is a trick to open a man page in Preview
...
Here’s the app I use for viewing man pages and other documentation, Dash.
I gave you the link to the Bourne Again Shell (bash) which is the one used in Mojave, though you can use any shell you like.
Therein lies the problem in your question. There are at least a half-dozen shells in Unix. They all do things a little differently. Many of the commands are the same, but may not work exactly the same.
And, Linux isn’t Unix, though it is similar and much of the things you find will be stuff that exists in Linux, but not Unix.
Then, there are macOS programs that run under the Unix subsystem.
You don’t seem to understand the open-endedness of your question.
In addition to the above information from folks, I’d suggest learning zsh, and not bash. The two are quite similar in various ways, but the macOS-provided bash is very old and unlikely to ever be updated, and the default shell in Catalina is zsh.
Mojave has zsh installed, but it’s not the default for newly-created users. bash is.
If you want to test with zsh without switching over, exec zsh
More on zsh:
https://scriptingosx.com/2019/06/moving-to-zsh/
http://zsh.sourceforge.net/Guide/zshguide01.html
Full disclosure: The shell is arcane. As you’ve been gathering from previous replies. It’s also powerful. Be very cautious around sudo commands. And if you want to mess around with commands you’re not sure of, create and log into a new and non-admin user, and mess around there. If you make a mistake, u]you can log out and revert to your main login.
Probably the closest Windows analog to bash-—prior to the advent of Microsoft Services for Linux and its SFU predecessor—is not the DOS box, but rather PowerShell. And in various ways, PowerShell is more advanced than bash and zsh. (The stream-of-bytes design of most shells is simple and works well for some tasks, but falls down hard for other tasks. (More)).
For scripting macOS, using Automator can be a different approach, and may work better for some requirements. Or leaning somewhat more toward more traditional programming, there’s Swift playgrounds, and which are quite powerful.
Finding the gazillion options is the current specific focus. How may zeros in gazillion, BTW? LOL
man ls
The manual page for every command can be accessed with the man command.
Hi, Barney-15E.
I think Shell commands is what I'm looking for. Speaking DOS as an example, dir /s to list all the files in the current directory and any sub-directories.
"Search for the specific shell you are using. " There in lies the core problem, you have to know what you are searching for. :-) No one seems to remember or have learned that fact, these days. They always assume you have that knowledge in hand.
I'm not looking to become a Unix expert, programmer, or something else. ****, I'm retired! ROFL I only want to know a couple specific things ATM. For me, having a manual to thumb through has always been the best way for me to discover and learn. And in perusing the manual, I invariably learn something else I was not searching for, and increasing my understanding of the subject being researched.
I actually started this search on the web before posting, but all the answers meant nothing to me. So came here.
I found the FreeBSD handbook, but I'm interested in only the commands that match Mojave. Since I know virtually nil about Unix, there's no way I can tell if a particular piece of info in the handbook would be valid. And if that info would even be correct for Mojave.
So I'm looking for an all-in-one comprehensive doc, or a means of printing them out so I have them all in one place at one time. It's what works the best for me.
Hi, VikingOSX,
As I just wrote Barney-15E, I'm not looking to become a Unit expert. That's about the last thing I want to be. ROFL
Having a list of commands in a single doc, as they are shown in Terminal, should be enough for now. I didn't even know they existed until I accidentally stumbled on to one page.
If I knew what pages were available, and how to export each page as a PDF file, I could concatenate them into one PDF and, I think, have exactly what I'm looking for.
At this point, I doubt I would ever make use of any tools programmers use.
To use an automotive analogy, I'm interested in knowing how the transmission works, but I'm not interested in repairing it. <G>
Thanks, BobHarris. I think that will end up being a bit TMI for what I want, but I if/when I find the info I want, I can use the Print Edit add-on in Firefox to print just the info I want at that time.
Got the page bookmarked.
My first computer, which I still own, maxed out at 48 kilobytes of RAM.
Calm down, now, Barney. <G> I believe you've made assumptions that are not true. Namely, that I know something useful about the shell. All I knew, when I posted the question, was it is command line instructions, and the title at the yop of the manual page that I accidentally discovered says "BSD General Command.
Clicking on link brings up the GNU Operating System, and nowhere on the page is Apple or Mojave mentioned. How would I know the page is applicable and not just something similar?
For a question like mine, from a person who know virtually nothing, you should expect an open ended question. There's no way I could know there were more than one shell for Unix, especially since I wasn't sure what a shell is. And I'm still not 100% sure of the definition of "shell" in this case.
I've read there are Mac programs that run under Unix, as well as vice-versa, but know nothing of them.
A shell (back in the good old days) was a thin veneer between the user's fingers and the commands they would invoke. The shell put out the command prompt. When the user typed a command and then hit <return> the shell would do minimum parsing on the command (such as finding each word in the command based on the white space between them). It would look at the first word and see if it could find a program that had the exact same spelling. If it found a program that matched the spelling it would run the program and pass the remaining words from the command line to the program as arguments.
The shell would then wait for the program to finish.
When the program finished, the shell would output the command prompt and wait for the next command.
Again, simple program in the early days.
The basic concept remains, but the shell has more capabilities, but its primary job is to find programs based on the spelling of the first word in a command you enter.
One of the things Unix did from almost the beginning was allow users to choose a different shell, which could have different rules, but more important, it allowed creative individuals to improve on the existing shell or invent their own. Those that became popular flourished.
Also, I'm not sure the web page I pointed you at is all that complex. And since you said you were retired, you should take up a hobby. Learning the command line is an excellent hobby 🤪
But back to the original question, or maybe I should ask: "What is your goal?" Maybe there is some other way to approach it, and we could be helpful in that way, instead of teaching your all about the beginning of Unix back in the '60's and '70's.
Calm down, now, Barney. <G> I believe you've made assumptions that are not true. Namely, that I know something useful about the shell.
I made no assumption that you knew anything about the shell. Quite the opposite. I properly assessed that you had no idea what you were asking. I tried to explain to you how your knowledge was lacking far more than you comprehended. I tried to offer ways you can expand your knowledge so that you could either learn what you wanted to know, or formulate a better question we could answer.
BSD General Commands