1. what stdout, stderr, stdin is? they are alias for fd/0, fd/1, fd/2
root@192-168-31-33:~# ls -alh /dev/std*
lrwxrwxrwx 1 root root 15 Apr 10 06:35 /dev/stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Apr 10 06:35 /dev/stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Apr 10 06:35 /dev/stdout -> /proc/self/fd/1
root@192-168-31-33:~# echo hello > /proc/self/fd/1
hello
2. what /dev/console is? /dev/console is pointed to tty1 or ttyS0.

3.what relationship is between the /dev/std{out, in, err} and tty* devices? the devices /dev/std{out, in, err} are a wapper of tty* devices.
#include <unistd.h>
#include <stdio.h>
void print_tty(char* name, FILE * f) {
printf("%s (fileno %d): ", name, fileno(f));
if (isatty(fileno(f))) printf("TTY %s\n", ttyname(fileno(f)));
else printf("not a TTY\n");
}
int main(void) {
print_tty("stdin ", stdin);
print_tty("stdout", stdout);
print_tty("stderr", stderr);
}
or, a more simple example:
