Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of ipc?

898


What is the use of popen and pclose?

1679


What is the use of FIFOs?

1713


What is Datagram style?

1497


What are Pipes?

1534


What are 3 ipc techniques?

849


How to Destroy Sockets?

1567


What is socket in ipc?

915


What are the ipc techniques?

891


What is Calling connect?

1637


What is Connection style?

1660


Which ipc mechanism is fastest and how?

1071


How to Create a FIFO?

1605


How to Controll and Deallocate Shared Memory?

1581


What is Fast Local Communication?

1419