3 ms·
> Great if you know where to look, but most people who ask themselves the question don't know they have to look up the bash manual in the "redirection" section.
by layer8 8mo ago
> Great if you know where to look, but most people who ask themselves the question don't know they have to look up the bash manual in the "redirection" section.
Where else would you look but in the manual of your shell? And you don’t have to know in which section to look, you can just search for “2>&1” in the bash man page.
- GuB-42 8mo agoWhat is a command and what is shell syntax is not always obvious, especially to a beginner, which I assume most people asking this question are. Take the command "ls -l ~/.. ; fg" for instance. What is interpreted by the shell and what are commands? If you have some experience in bash, you probably know, and therefore you know which part to look in which man page, but you probably also know "2>&1". Spoiler: "-l" is part of the command, so look in the "ls" manpage. "~", is expanded by the shell, ";" is shell syntax and "fg" is a builtin, all three are in the "bash" manpage. ".." is part of the filesystem.