Difference between 'stdout
2016-09-07 本文已影响19人
勿以浮沙筑高台
-
stdout is a normal file, created in the same directory where you're running the command.
So, when you're redirecting the output of echo to stdout, it is written to the file. You need to do cat (as example, here you did) in order to see the content on screen here. -
/dev/stdout is a device file, which is a link to /proc/self/fd/1, which means it is referring to the file descriptor 1 held by the current process.
So, when you're redirecting the output of echo to /dev/stdout, it is put to the standard output (on screen) firectly.