How to Redirect the Standard Input, Output, and ErrorStreams?



How to Redirect the Standard Input, Output, and ErrorStreams?..

Answer / manavalan

0 (zero) refers to the standard input & often abbreviated as stdin.
1 refers to standard output (stdout)
2 refers to standard error (stderr)

Redirecting Standard Error :

The 2 in 2> refers to stderr.

$ lsash /usr/bin 2> commands-error.txt


Redirecting both Standard Ouput & Standard Error.

Use 2>&1 Syntax to redirect standard error to the same location as standard output .


$ ls /usr2222/bin > command.txt 2>&1

Redirecting Both stderr & stdout at Once

$ ls /usr2222/bin &> command.txt

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Linux IPC Interview Questions

How to Destroy Sockets?

0 Answers  


Which Linux distros do you have experience with?

1 Answers  


What is ipc message?

0 Answers  


How shared memory are accessed if we have two processors trying to acquire the same region.

3 Answers   NetApp,


What does ipc class mean?

0 Answers  






What are Private Mappings?

0 Answers  


Which is fastest ipc mechanism?

0 Answers  


What is socket in ipc?

0 Answers  


who are the author of LINUX operation system?

5 Answers   Linux,


i want to do linux. i am completed b.sc. in physics i want to do carrier in linux newgeneration which cource will confartable give me solution

1 Answers   HP,


what is symbolic link in unix ???

5 Answers   Symphony, TCS,


How to Create Pipes?

0 Answers  


Categories