0

I am trying to search text in a directory and it turned out that the following syntaxes do not return any result

ack -i "0xabcdef" ./

ack -i "0xabcdef"

ack -i "0xabcdef" .

while the following command works

ack -i "0xabcdef" *

Can someone explain why that is the case? What is the significance of *? I also noticed that the directory has symbolic links.

  • 1
    What do you mean "does not work", does it do nothing or it gives an error? – Hunter.S.Thompson Aug 1 '17 at 15:43
  • @Hunter.S.Thompson updated the question – user2065276 Aug 1 '17 at 15:51
  • Can you try ack -i "0xabcdef" . – Hunter.S.Thompson Aug 1 '17 at 15:53
  • @Hunter.S.Thompson. Updated the post – user2065276 Aug 1 '17 at 15:55
1

You should not have to specify a directory to ack. By default it delves into the current directory.

I also noticed that the directory has symbolic links

Then an excellent thing to do would be to look at the manual (either man ack or ack --man) and search for "link". The first thing you'll find is this option:

   --[no]follow
       Follow or don't follow symlinks, other than whatever starting files
       or directories were specified on the command line.

       This is off by default.

This means if you want ack to follow symlinks, you need to specify the --follow option.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.