Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ack does not find symlinks

Tags:

symlink

ack

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? )

like image 597
chestozo Avatar asked Feb 17 '23 07:02

chestozo


1 Answers

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.

like image 151
Andy Lester Avatar answered Mar 03 '23 19:03

Andy Lester