CLI Guide

Writing Command Output To A File
When redirecting command results to a le, you can specify a lename (and a directory path if necessary) to which you want to write the
command result. When specifying the path to which you want to write the le, use the appropriate syntax for the operating system.
You can save command results in two ways. You can overwrite any le that has the same name as the output le you specify, or you can
keep adding results of commands to a le of the same name.
Saving Command Results To A File That Is Overwritten
Use the -outc option when you want to overwrite data stored in previously written les. For example, at 11:00 A.M. you capture fan probe
RPM readings for fan probe 0 on the system and write the results to a le called fans.txt. You type:
omreport chassis fans index=0 -outc fans.txt
or
omreport mainsystem fans index=0 -outc fans.txt
Partial results written to the le are:
Table 227. Partial Results
Index : 0
Status : OK
Probe Name : System Board Fan 1 RPM
Reading : 2380RPM
Minimum Warning Threshold : 600RPM
Maximum Warning Threshold : 5700RPM
Minimum Failure Threshold : 500RPM
Maximum Failure Threshold : 6000RPM
Four hours later, you repeat the command. You have no interest in the 11:00 A.M. snapshot as written to fans.txt. You type the same
command:
omreport chassis fans index=0 -outc fans.txt
or
omreport mainsystem fans index=0 -outc fans.txt
The 3:00 P.M. data overwrites the 11:00 A.M. data in the fans.txt le.
Fans.txt now reads as follows:
Table 228. Result
Index : 0
Status : OK
Probe Name : System Board Fan 1 RPM
Reading : 3001RPM
Minimum Warning Threshold : 700RPM
198 Working With CLI Command Results