3 ms·
As someone who is good at unix but watches other people struggle with it: the advantage is that people don’t understand signals, subshells, what ls stands for,
by nailer 4y ago
As someone who is good at unix but watches other people struggle with it: the advantage is that people don’t understand signals, subshells, what ls stands for, what of stands for, don’t know the manual, don’t know what man stands for, don’t know the manual has sections, and aren’t interested in finding out.
- BirAdam 4y agoI was going to say use kill and lsof, and also something similar to what you said here. I would add that even many seasoned developers don’t know UNIX-like systems well enough to do anything with native tooling and therefore replicate native functionality poorly and slowly. For many people, it’s faster to write an entirely new tool than it is to go learn the platform for which they’re writing and therefore they do it.
- Joker_vD 4y agoThat definitely says something about the discoverability of the platform's functionality. The similar thing also regularly happens in medium-to-large codebases so that's how you end with four slighlty different implementations of e.g. "extract value by path from a JSON object, with some traversal options": it's easier to just write the damn loop by yourself than to find a) if it's already been written, and if yes, b) how the hell do you use it.
- FpUser 4y ago>"That definitely says something about the discoverability of the platform's functionality." I think it says more about people being lazy and not willing to use that mighty tool called search (add ChatGPT now). Even here on HN I often see people asking what is X when that X is one web search away.
- Karunamon 4y agoThat one is at least defensible, a Q and A in a public forum can be a seed that generates further discussion and provides knowledge to others.
- Joker_vD 4y agoYeah, agreed, we should change human psychology to fit our current technological stack better, that sounds way easier than doing the opposite. On a serious note, I do hope that built-in help systems with ChatGPT glued on (and additionally trained on its contents) will become a de-facto standard in the near future: it should be possible to just ask your computing environment "how do I do X with you?" and get an answer or at least some guidance pointers.
- FpUser 4y agoThe scope of modern OS, its utilities and commands is so large that good and comprehensive doc would be huge. And that is just the description of command with options. How do I do X is even more complex and may require things that go way beyond the simple doc and will require books. This is just not scalable and impractical. Having piles of common knowledge like Stack Overflow / forums / etc augmented with search and now ChatGPT is way more practical. I've personally written what is very comprehensive doc for one of my software products. It described every nook and cranny. Still I ended up supporting a forum with most common questions percolated to a dedicated How Do I Do XYZ section and it just keeps growing. In the beginning I was answering question there. Now I just see people supporting themselves.
- mschuster91 4y ago> That definitely says something about the discoverability of the platform's functionality. Meh. Back in ye olde days, when developers were either self-taught from the roots or came from universities, they just knew that stuff from experience. Nowadays, a lot of "developers" come from three months "coder bootcamps". They may even be reasonably proficient in whatever flavor of JS toolkit the camps teach at the moment, but they will have zero knowledge about what makes their computer tick.
- gpderetta 4y agoThe issue isn't unexperienced devs not knowing about stuff. The issue is whether devs with no experience are willing to learn new stuff or not. We all had zero experience at some point.
- FpUser 4y agoI am not good at knowing Linux at all beyond some general concepts. If I did my brain would have no room left. However when dealing with it I always assume that it has everything and do google search. I do not remember a single case when I would want to write some utility. The ones available along with bash always cover all of my needs leaving me more time to design and implement the actual software I am being paid for. My whole CI/CD or whatever complete management is called is few bash scripts.
- magicalhippo 4y agoSo as someone who's not very good at UNIX, knows that it has signals, subshell, what ls is, don't know of, know there's a manual and has invoked man many times and is interested in finding out... How would I use man to find that lsof exists so that I could come up with the incantation mentioned in OP? I tried "man -k 'open'" but none of the answers returns lsof on my system. I checked that "man lsof" works as expected.
- pxc 4y agoman -k open should surface lsof on your system. On mine it only has the description 'open files', though, which might not be obviously relevant to many people. I'm not sure what macOS or FreeBSD `man` have, but GNU `man` has `-K` as well as `-k`. The uppercase version searches the manpages globally, instead of just their short descriptions. So something like man -K -a 8 "list open" port will turn up `lsof` on GNU, even if `apropos` doesn't. If you have a tldr client installed, that can also be useful for searching through common examples including for programs you may not have installed. For example with tealdeer, the following (Fish) surfaces both lsof and netstat as options: for page in (tldr -l) tldr $page | rg -A2 -i '\b(find|list)\b.*\bport' end and for page in (tldr -l) tldr $page | rg -A2 -i '\bkill\b.*\bport' end shows that fuser and fkill can both do the same thing as killport. Grep sucks as a search interface for tldr, though, so you probably want a better tldr client than I have, which will do global search, or an FZF script that will let you filter through tldr results. Discovering new (to you) tools which are not yet installed is a good reason to use the web to look up Unix stuff, especially after you've checked the manpages and your package manager.
- magicalhippo 4y agoThanks for the detailed response. Seems -K is not available on the UNIX I have (TrueNAS, FreeBSD-based). That should indeed have helped. > Discovering new (to you) tools which are not yet installed is a good reason to use the web to look up Unix stuff Of course a web search can help, however I often find that the times when I need to do such searches is quite correlated with times when I don't have internet access. Less frequent now with my "smart" phone, but still happens.
- pxc 4y ago> don’t know what man stands for, don’t know the manual has sections, and aren’t interested in finding out People that unwilling to learn— uninterested in even discovering that there is a manual and how to open it— don't belong in software. The rest of the things you mention... whatever. Many people haven't heard a good pitch. They haven't had the relevant experience to see how investing in learning those things can pay off for them. But disinterest in finding out that there's a manual? That's wilful incompetence of a kind I've never seen and hope I never will.