How to list filenames containing a specific string using ack-grep (ag)

Use ag -l to list only filenames that contain the given string.

For example, in order to list filenames containing the string 403 Forbidden, use

ag_list_filenames.sh
ag -l "403 Forbidden"

 


Check out similar posts by category: Linux