Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

354
Views
Difference between stdout and /dev/stdout
bala@hp:~$ echo "Hello World" > stdout
bala@hp:~$ cat stdout
Hello World

bala@hp:~$ echo "Hello World" > /dev/stdout
Hello World

Kindly clarify what is the difference between stdout and /dev/stdout

Note :

bala@hp:~$ file stdout
stdout: ASCII text

bala@hp:~$ file /dev/stdout
/dev/stdout: symbolic link to `/proc/self/fd/1'

Kindly help to know the difference .

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

In your case

  • 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 sent to the standard output (the screen) directly.

over 4 years ago · Santiago Trujillo Report

0

stdout on its own is just a file in the current directory, no different to finances.txt. It has nothing to do with the standard output of the process other than the fact you're redirecting standard output to it.

On the other hand, /dev/stdout is a link to a special file on the procfs file system, which represents file descriptor 1 of the process using it1.

Hence it has a very real connection to the process standard output.


1 The procfs file system holds all sorts of wondrous information about the system and all its processes (assuming a process has permissions to get to them, which it should have for /proc/self).

over 4 years ago · Santiago Trujillo Report

0

One is a normal file, no different from any other normal file like e.g. ~/foobar.txt.

The other is a symbolic link (like one you can create with ln -s) to a special virtual file that represents file descriptor 1 in the current process.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!