0

I am trying to send all printed output of a strace command to a file. straces have a lot of console output since they print all the system calls of a command.

I have tried the most popular ways that I can find or think of, such as command > file.txt which does print output but then the output is not written to a file, same with command | tee file.txt Output is always printed but never written to a file. Is it because there is too much output or something? The first command definitely suceeds.

But my real question is what is the best way to do this and how can I get it done?

Many many thanks, Milan

Milan Lakhani
  • 371
  • 1
  • 2
  • 15
  • 1
    `strace -o filename yourcommand ...` – Charles Duffy Nov 05 '21 at 18:22
  • 1
    If you want both the command output and trace output, you need to redirect stderr as well: `> file.txt 2>&a` – Barmar Nov 05 '21 at 18:24
  • @CharlesDuffy I upvoted up but actually you put ```...``` in code syntax which I think was a mistake, is confusing to read mistakes like that when you don't know the right command. Thanks both anyway! – Milan Lakhani Nov 06 '21 at 07:54

0 Answers0