سؤال

Here is a test:

$ ln -nfs ~/.ssh ssh  # Create a symlink in current dir.
$ ack -g ssh          # => nothing found
$ ack -a -g ssh       # => same here
$ find . -name ssh    # => found: ./ssh

What I am doing wrong? )

هل كانت مفيدة؟

المحلول

Two things are going against your expectations.

First, ack will ignore symlinks if you don't use the --follow switch.

Second, and more importantly, ack -g does not find directories. It only finds files. ack is a file-based utility. It is not a generic utility like find is.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top