Linux: Difference between /dev/console , /dev/tty and /dev/tty0
unix.stackexchange.com
unix.stackexchange.com
It's unfortunate that people no longer dive into original system/program documentation, but google/ask for quick answer. When I started my unix/linux journey some ~14 years ago I always found something more when reading docs and thought of guru's as "these guys that read more docs than I did".
Similarly you may noticed how you can no longer write code comfortably when being offline, because you cannot google "how to make dict() return default value for non existing key" etc.
I am now in the process of killing this bad habit of googling through my "coding" and sysadmin tasks, rather than reading docs and examples available on my system.
PS. sorry for my english
When I answer questions on Stack Overflow/Stack Exchange, if the answer is in the documentation, I always try to link to it, while also providing a brief and clear explanation in the answer in case the documentation might be hard to interpret. I hope that helps with some of those people who don't know where to start in the documentation, or may have had trouble understanding it.
For example, in this case, the documentation is hidden away in the kernel source tree. If you don't have a kernel source checkout, you may not have this documentation available on your system at all; and even if you did, you may not think to look there. This should be documented in a man page somewhere, but there's a long list of things that should be documented in man pages which are not: https://www.kernel.org/doc/man-pages/missing_pages.html
It is a good idea to learn how to find information in common documentation sources that are available on your system. One problem is that Google frequently winds up being a better answer than local documentation because it offers a single interface to find all kinds of documentation, rather than having to learn dozens of different interfaces and places to look, only some of which are easily searchable. Off the top of my head, here are a few places that I've needed to look for documentation recently: man pages, /usr/share/doc, kernel source, perldoc, pydoc, rdoc, info, Gnome Devel Docs, and so on.
Gurus haven't always read more docs than you have. Sometimes they had to read the source. Sometimes they've just learned through trial and error, and reasoning about how stuff probably works. Sometimes they learned by word of mouth from someone else with experience. Reading the docs can definitely help; it can let you know about functionality that you've never thought to look for. But it's not the only tool for learning about a system, and how effective it is depends heavily on how thorough and good the documentation for the system is.
>Similarly you may noticed how you can no longer write code comfortably when being offline, because you cannot google "how to make dict() return default value for non existing key" etc.
A large reason for this is the change that has occurred over time from old-school Unix type tools to newer tools. In many cases, the newer languages simply have no documentation available locally.
I.e., in my Slackware system, I have ():
1,596 man pages for glibc functions
896 man pages for Perl
155 man pages for Tcl functions
88 man pages for Tk functions
1 man page for Python
One can "code disconnected" reasonably well in C/C++, Perl, or Tcl/Tk because the tools also installed documentation for all the functions contained therein. But, with Python, without a separate set of docs, or internet access, one is lost if one needs to "look something up". Plus, jumping out of one's editor (or switching to another xterm) to run "man 3 printf" to look-up a particular obscure percent escape is loads faster than googling for the same. There is an advantage to having full local documentation installed. But it seems that the advantage has been lost on some tools.() count obtained by grep and wc -l on Slackware's packages files
Java, on the other hand, typically only has the HTML javadocs. And once you get outside libc, documentation for C/C++ libraries is all over the place in formatting and accessibility with standard tools.
The lack of comprehensive offline documentation that seems to be becoming more and more common even for large projects is rather troubling, though.
And there are times when Stack Overflow is a lifesaver for weird bugs, poorly documented APIs, etc. It's much better than the alternative of, say, reading the release notes for the last 20 versions to see why code breaks on the latest.
Also, I think googling for CSS issues will be a never-ending thing, because the technology is so weird sometimes, and inconsistent (is it white-space:nowrap ... or whitespace:no-wrap ... idk, grammatically they each need a dash). For some reason CSS's approach of just having hundreds of attributes the can be individually set is not memorizable to me, whereas Java SE mostly is.
And there's always that rare linux command that's kind of a once-a-year thing, like setting the trackpad timeout while typing (syndaemon -i .1 -d ... I don't care if I never remember that program... probably how some people feel about programming questions).
But what really bothers me is the number of people that ask someone else before consulting the documentation. IRC, Stack Overflow, and mailing lists seem to be full of questions that are exact copies of #1 in the FAQ or easily answered with a quick trip to `man`. Or even quickly searching the place that they asked for the other twenty people that have asked this question today.
Just look at the front page of Stack Overflow. Any any given day it seems to have half "here's a stack trace that I haven't bothered to read. fixitfixitfixit" and half questions that might as well be the exact title of the man page that they should read.
I've been thinking about this myself. I think there's good reason: Google (or a bunch of experts on hand) will often provide a better, more concise answer to your specific question than having to search and grok the manpages.
As extreme examples, I regularly ragequit the Bash manpage after trying to find the meaning of some keywords, and the Sudoers manpage is notorious with presenting the syntax as EBNF without examples!
(a pity GNU Info never fixed their interface, the idea's good)
The Bash man page does not contain a complete description of Bash, only a brief summary. "man <builtin>" provides a generic builtins page usually, since the builtins can vary between shells so one man page can't cover all of the different shell behaviors. However, bash has a "help" command which will give you the bash-specific description of a given builtin.
Other than that, I usually find the HTML Bash documentation easier to read and navigate than the info, so I just use that instead.
And yes, the sudoers man page is pure evil.
Second to that is the 'example' where every single option possible is given, while at the same time not having a typical usage example. When there's 50 potential flags with arguments, I lose track of how to structure the command - it's somewhere in all those square brackets... somewhere...
Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety. Benjamin Franklin, Historical Review of Pennsylvania, 1759
Trading long term independence for temporary efficiency never looked so good!
But I have no idea whether this still exists and works on Linux. It is still started by XDM on OpenBSD though.
/etc/systemd/journald.conf:
ForwardToConsole=yes
TTYPath=/dev/tty12
MaxLevelConsole=info journalctl -f
where the f stands for follow.I’d guess it’s mostly a configuration issue and people care less about these things nowadays?