1

I need to search "335664324" in the file A33256.xml.gz. I tried the following code.

sftp> zgrep -c "335664324" A33256.xml.gz
A33256.xml.gz
Invalid command.

I'm in the same directory as the file. How can I overcome this issue to display the output?

Nepumuk
  • 659
  • 7
  • 29
Shehan
  • 11
  • 1
  • 6
    You're using SFTP, not SSH. Use SSH if you want to run commands. Or get the file to your local system and run `zgrep` there. – muru Oct 28 '21 at 03:02

1 Answers1

1

There is nothing wrong with your zgrep syntax (allthough the -c only counts instances, and does not display them). But as muru commented, you're running it while connected with SFTP, where it's not possible to run shell commands in.

You should connect over SSH to run this command.

AdminBee
  • 21,637
  • 21
  • 47
  • 71
Paul Beers
  • 11
  • 1