0

I've redirected topas output to a file in AIX 6.1, but the file is not readable using cat:

$ cat a.txt

$

While using pg it shows perfect output:

Topas Monitor for host:    jsitrs0058  Interval:   5    Tue Oct  4 18:08:40 2016
                                    DATA  TEXT  PAGE                  PGFAULTS
USER          PID     PPID PRI  NI   RES   RES SPACE    TIME  CPU%   I/O   OTH COMMAND
root      1966214        1  60  20   145     2   145  128:04   0.0    11   417 syncd
root            1        0  60  20   204    11   204   91:05   0.0   253 74447298 init
oracle    8651002        1  60  20  2532 21781  2532   25:54   0.0     0  2640 oracle
........................................

vi a.txt

USER^[[15GPID^[[23GPPID PRI  NI   RES   RES SPACE    TIME  CPU%   I/O   OTH COMMAND^[[58G
root^[[11G1966214^[[26G1  60  20   145^[[46G2   145  128:04   0.0    11   417 syncd
root^[[17G1^[[26G0  60  20   204    11   204   91:05   0.0   253 74447298 init
oracle    8651002^[[26G1  60  20  2532 21781  2532   25:54   0.0^[[72G0  2640 oracle
 ......................

I need to get similar output like pg <filename> for cat <filename>?

  • 2
    What does ls -l a.txt show? How about file a.txt? – Wildcard Oct 5 '16 at 5:26
  • Well, it's a safe bet that the file is a few hundred bytes long — with cursor-positioning escape sequences in it.  Although the fact that cat a.txt displays nothing at all is puzzling.  I'd be more interested in seeing the output from cat -A a.txt and cat -v a.txt. – Scott Oct 5 '16 at 6:05
1

The escape sequences mess up the output from cat. Try cat -v a.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.