QA


Q&A

Q1:

When I redirect the output of some commands to a file using the greater-than symbol as described, some messages are still sent to the console. Why?

A1:

You're seeing standard error messages, rather than standard output messages. Standard error messages are meant to inform you that something out of the ordinary has happened. To redirect standard error messages, append a 2> to the end of the command, followed by the name of the file that should hold the error messages.

Q2:

Is there any way to simply throw away the standard output or standard error messagesfor instance, if I want a command to behave "silently"?

A2:

Yes, redirect one or both to the special device file /dev/null, which is commonly known as the bit bucket. All data sent to the file /dev/null is discarded by the system.



    SAMS Teach Yourself Red Hat(r) Fedora(tm) 4 Linux(r) All in One
    Cisco ASA and PIX Firewall Handbook
    ISBN: N/A
    EAN: 2147483647
    Year: 2006
    Pages: 311
    Authors: David Hucaby

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net