0

I want to redirect the result of 'lsof' to a file, but it does not work like this.

$ sudo ./lsof > result.txt
-bash: result.txt:

Is there anyone why it does not work?

sungho
  • 3
  • 1

1 Answers1

0

Because may be you do not have permission to wrote to file. Try following:

sudo lsof | sudo tee results.text

Or

sudo -s

lsof | tee results.txt

Sumit Mahamuni
  • 302
  • 1
  • 6