1

How do I grep recursively in directories and sub directories in ksh on AIX?

I have tried grep -r but this is not available.

Aravind
  • 1,599

1 Answers1

0

grep -R R is uppercase, not lowercase. By the way, grep is not related to the shell, it is a command of its own.

YoMismo
  • 4,015
  • 1
    I have tried with upper case as well, but no luck – Aravind Mar 10 '15 at 07:42
  • It works for us on our AIX 6.1 maybe your grep is outdated. – YoMismo Mar 10 '15 at 07:44
  • You have a workaround in the next link http://boards.straightdope.com/sdmb/showthread.php?t=273108 basically the command is find /path/to/search | xargs grep re-to-use – YoMismo Mar 10 '15 at 08:01
  • I'm not sure why this was duplicated. The linked question is different, does not address AIX and does not offer a working solution. I have AIX 7.1.0.0 and neither grep -r or -R function recursively.

    What does work, if you are trying to locate a pattern in files of file_type: grep "pattern" `find . -name "file_type"`

    – yamex5 Jul 15 '21 at 18:58