4 ms·
options that cp(1) has OK, this is something that's bugged me for a long time. I've been in the field forever, but working on Windows. So I've seen this kind o
by CWuestefeld 5y ago
options that cp(1) has
OK, this is something that's bugged me for a long time. I've been in the field forever, but working on Windows. So I've seen this kind of thing many times before, particularly when referencing man, and it seems completely cryptic.
The way linux people occasionally put a parenthetic number after a generic command seems to me one of the ways that normal civilians, and even pros like me, are intimidated into staying away from serious linux usage.
So what gives? What the heck is the parenthetic number for?
- duped 5y agoIt refers to the manpage section. Good SO post: https://unix.stackexchange.com/questions/3586/what-do-the-numbers-in-a-man-page-mean https://unix.stackexchange.com/questions/3586/what-do-the-nu...
- amluto 5y agoIt’s the man page section. cp(1) is documented in …/man1/…. You can type man 1 cp. Roughly, 1 is unprivileged shell commands, 2 is syscalls, 3 is library functions, and 8 is administrative commands.
- lvkv 5y agoThe number denotes what section of the manual the command (or function, etc.) comes from. Aside from that, it also helps clear up potential confusion about what you’re talking about—a good example is stat(1) (the command) and stat(2) (the system call). Without the number, you’d have to rely on context clues to infer which stat was the relevant one. https://unix.stackexchange.com/questions/3586/what-do-the-nu https://unix.stackexchange.com/questions/3586/what-do-the-nu...
- andrewmcwatters 5y agoI can’t lie, if you spend most of your time in Windows, there’s probably diminished reasons to understand manpages, but for those that do any degree of meaningful work on a Linux or Unix (e.g. macOS) system, not knowing how to navigate man pages separates entire classes of developer professionalism to me. It’s night and day working with people who know how to be approachable in development, but also realize you need to understand some basic flags for everyday tools and not turn to Google or Stack Overflow for what is directly in your manpages. Admittedly those who cannot stay approachable concoct all sorts of shell hell for everyone, even those who are experienced. Excellent question, by the way. I wish we’d get some more candid questions like these on HN when relevant to the thread, like this one. It’s a learning opportunity for all readers.
- unknown_error 5y agoWhat's wrong with Stack over man pages? Most man pages don't you give advice or context, just the raw reference, but sometimes the best way to do something is not even the tool you originally looked up (say, scp vs rsync). Stack combines the reference (which flags) with the expertise (of educated guesses by sometimes wiser users). I would never trust a man page over a good Stack answer. (edit: as a web dev who uses *nix all day, but has no desire to become a full fledged sysadmin... Just give me the tool I need to get the job done without sacrificing performance or security. I don't need to know every possible gnu tool and flag and distro dependent options...)
- andrewmcwatters 5y agoYou’re certainly better off reading both. But I have a bigger issue with the fact that developers who use Stack Overflow are more often than not just going to copy and paste and not understand what they’re doing. And that’s predominantly how the site is used. Yeah, there are plenty of manpages that are verbose, but frankly a lot of them are easier to parse than reading hacked together Stack Overflow answers that don’t explain how the poster arrived at their answer. They literally don’t show their work.