Cygwin grep, no such file or directory

0


This is the first time I'm using Cygwin and I have not so much experience with scripts.

I'm trying to grep words out of a XML document and need to get them counted. When I press enter I get a message that grep: foo.xml: No such file or directory.

emmy@KRIM-PC ~ 
$ grep "original\-recipient\-address>049." foo.xml |wc -l 
grep: foo.xml: No such file or directory 
0

I've been googling and reading for hours and I can't understand what's wrong?! The file exists and it's located in C:\Users\emmy\Downloads.

Bojan

Posted 2014-09-05T11:29:11.433

Reputation: 11

the directory you were in clearly does not have the file in question. Navigate to that directory from within Cygwin and it will work. – Ramhound – 2014-09-05T11:40:57.543

Without cygwin here grep from UnxUpdates.zip

– crazypotato – 2014-09-05T11:52:17.283

Answers

0

You write the file is in C:\Users\emmy\Downloads. The Cygwin command prompt shows

emmy@KRIM-PC ~ 

the ~ is actually your working directory. It means your home directory (probably /home/emmy/). Try cd cd /cygdrive/c/Users/emmy/Downloads and then run your grep command again.

lzam

Posted 2014-09-05T11:29:11.433

Reputation: 1 364