Skip to content
Newer
Older
100644 119 lines (101 sloc) 5.28 KB
3a37ba3 Jerry's squash fix didn't
petdance authored Jan 9, 2007
1 Usage: ack [OPTION]... PATTERN [FILES]
e6078d0 New tests for GNU long options
petdance authored May 21, 2007
2
3a37ba3 Jerry's squash fix didn't
petdance authored Jan 9, 2007
3 Search for PATTERN in each source file in the tree from cwd on down.
4 If [FILES] is specified, then only those files/directories are checked.
5 ack may also search STDIN, but only if no FILES are specified, or if
6 one of FILES is "-".
7
5c6efb9 Implemented --[no]env to turn off any dependencies on the environment…
torsten.blix authored Feb 14, 2008
8 Default switches may be specified in ACK_OPTIONS environment variable or
9 an .ackrc file. If you want no dependency on the environment, turn it
10 off with --noenv.
3a37ba3 Jerry's squash fix didn't
petdance authored Jan 9, 2007
11
12 Example: ack -i select
13
14 Searching:
9fc9318 Added -G REGEX option to filter the searched files.
torsten.blix authored Feb 20, 2008
15 -i, --ignore-case Ignore case distinctions in PATTERN
9bf28e6 Leland's smart-case option
petdance authored Jun 25, 2008
16 --[no]smart-case Ignore case distinctions in PATTERN,
17 only if PATTERN contains no upper case
24df7a3 added a --smart-case option
petdance authored Jul 9, 2008
18 Ignored if -i is specified
70b8207 Lots of reformatting
petdance authored May 21, 2007
19 -v, --invert-match Invert match: select non-matching lines
20 -w, --word-regexp Force PATTERN to match only whole words
9fc9318 Added -G REGEX option to filter the searched files.
torsten.blix authored Feb 20, 2008
21 -Q, --literal Quote all metacharacters; PATTERN is literal
3a37ba3 Jerry's squash fix didn't
petdance authored Jan 9, 2007
22
23 Search output:
3667121 Added --line
petdance authored Oct 28, 2007
24 --line=NUM Only print line(s) NUM of each file
70b8207 Lots of reformatting
petdance authored May 21, 2007
25 -l, --files-with-matches
ee9ed9f Added -L and many long options
petdance authored May 21, 2007
26 Only print filenames containing matches
70b8207 Lots of reformatting
petdance authored May 21, 2007
27 -L, --files-without-match
ee9ed9f Added -L and many long options
petdance authored May 21, 2007
28 Only print filenames with no match
70b8207 Lots of reformatting
petdance authored May 21, 2007
29 -o Show only the part of a line matching PATTERN
ee9ed9f Added -L and many long options
petdance authored May 21, 2007
30 (turns off text highlighting)
86fd094 working on initial --passthru
petdance authored Aug 10, 2007
31 --passthru Print all lines, whether matching or not
70b8207 Lots of reformatting
petdance authored May 21, 2007
32 --output=expr Output the evaluation of expr for each line
ee9ed9f Added -L and many long options
petdance authored May 21, 2007
33 (turns off text highlighting)
9fc9318 Added -G REGEX option to filter the searched files.
torsten.blix authored Feb 20, 2008
34 --match PATTERN Specify PATTERN explicitly.
d6d3bdc fixed docs for -1
petdance authored Nov 5, 2007
35 -m, --max-count=NUM Stop searching in each file after NUM matches
36 -1 Stop searching after one match of any kind
1234986 Added --with-filename
petdance authored May 21, 2007
37 -H, --with-filename Print the filename for each match
38 -h, --no-filename Suppress the prefixing filename on output
70b8207 Lots of reformatting
petdance authored May 21, 2007
39 -c, --count Show number of lines matching per file
3a37ba3 Jerry's squash fix didn't
petdance authored Jan 9, 2007
40
282165d releasing 1.69_01
petdance authored Oct 26, 2007
41 -A NUM, --after-context=NUM
42 Print NUM lines of trailing context after matching
43 lines.
44 -B NUM, --before-context=NUM
45 Print NUM lines of leading context before matching
46 lines.
47 -C [NUM], --context[=NUM]
48 Print NUM lines (default 2) of output context.
49
3c2e984 Implemented --print0 option, to be used in conjunction with -f, -g, -…
torsten.blix authored Dec 14, 2007
50 --print0 Print null byte as separator between filenames,
51 only works with -f, -g, -l, -L or -c.
52
8d4a4ba updating the help text
petdance authored Mar 14, 2008
53 File presentation:
a4d14bf added --pager/--nopager to the help text
petdance authored Mar 26, 2008
54 --pager=COMMAND Pipes all ack output through COMMAND.
217f7ba Don't set up the pager if output is redirected
petdance authored Mar 26, 2008
55 Ignored if output is redirected.
a4d14bf added --pager/--nopager to the help text
petdance authored Mar 26, 2008
56 --nopager Do not send output through a pager. Cancels any
2289da3 Windows colors
petdance authored Apr 15, 2008
57 setting in ~/.ackrc, ACK_PAGER or ACK_PAGER_COLOR.
8d4a4ba updating the help text
petdance authored Mar 14, 2008
58 --[no]heading Print a filename heading above each file's results.
59 (default: on when used interactively)
60 --[no]break Print a break between results from different files.
61 (default: on when used interactively)
62 --group Same as --heading --break
63 --nogroup Same as --noheading --nobreak
64 --[no]color Highlight the matching text (default: on unless
65 output is redirected, or on Windows)
b06194a added --[no]colour
petdance authored May 29, 2008
66 --[no]colour Same as --[no]color
92125da added --flush
petdance authored May 25, 2008
67 --flush Flush output immediately, even when ack is used
68 non-interactively (when output goes to a pipe or
69 file).
8d4a4ba updating the help text
petdance authored Mar 14, 2008
70
3a37ba3 Jerry's squash fix didn't
petdance authored Jan 9, 2007
71 File finding:
70b8207 Lots of reformatting
petdance authored May 21, 2007
72 -f Only print the files found, without searching.
ee9ed9f Added -L and many long options
petdance authored May 21, 2007
73 The PATTERN must not be specified.
9fc9318 Added -G REGEX option to filter the searched files.
torsten.blix authored Feb 20, 2008
74 -g REGEX Same as -f, but only print files matching REGEX.
70b8207 Lots of reformatting
petdance authored May 21, 2007
75 --sort-files Sort the found files lexically.
3a37ba3 Jerry's squash fix didn't
petdance authored Jan 9, 2007
76
77 File inclusion/exclusion:
47ca3df Applied (slightly modified) patch by Matthew Wickline to add --[no]ig…
torsten.blix authored Feb 18, 2008
78 -a, --all-types All file types searched;
79 Ignores CVS, .svn and other ignored directories
8199859 added the -u option
petdance authored Nov 29, 2007
80 -u, --unrestricted All files and directories searched
9fc9318 Added -G REGEX option to filter the searched files.
torsten.blix authored Feb 20, 2008
81 --[no]ignore-dir=name Add/Remove directory from the list of ignored dirs
70b8207 Lots of reformatting
petdance authored May 21, 2007
82 -n No descending into subdirectories
9fc9318 Added -G REGEX option to filter the searched files.
torsten.blix authored Feb 20, 2008
83 -G REGEX Only search files that match REGEX
84
70b8207 Lots of reformatting
petdance authored May 21, 2007
85 --perl Include only Perl files.
86 --type=perl Include only Perl files.
87 --noperl Exclude Perl files.
88 --type=noperl Exclude Perl files.
ee9ed9f Added -L and many long options
petdance authored May 21, 2007
89 See "ack --help type" for supported filetypes.
4254288 Define your own types with --create-type and --append-type!!
torsten.blix authored Jan 24, 2008
90
743819f Changed option names for creating your own types:
torsten.blix authored Jan 24, 2008
91 --type-set TYPE=.EXTENSION[,.EXT2[,...]]
4254288 Define your own types with --create-type and --append-type!!
torsten.blix authored Jan 24, 2008
92 Files with the given EXTENSION(s) are recognized as
93 being of type TYPE. This replaces an existing
16c8490 fixed up trailing spaces
petdance authored Feb 29, 2008
94 definition for type TYPE.
d51c10e fixed some help
petdance authored Jun 17, 2008
95 --type-add TYPE=.EXTENSION[,.EXT2[,...]]
96 Files with the given EXTENSION(s) are recognized as
97 being of (the existing) type TYPE
4254288 Define your own types with --create-type and --append-type!!
torsten.blix authored Jan 24, 2008
98
70b8207 Lots of reformatting
petdance authored May 21, 2007
99 --[no]follow Follow symlinks. Default is off.
3a37ba3 Jerry's squash fix didn't
petdance authored Jan 9, 2007
100
8199859 added the -u option
petdance authored Nov 29, 2007
101 Directories ignored by default:
5eb1743 Now ignoring Module::Build's _build directory.
torsten.blix authored Dec 14, 2007
102 autom4te.cache, blib, _build, .bzr, .cdv, cover_db, CVS, _darcs, ~.dep,
103 ~.dot, .git, .hg, ~.nib, .pc, ~.plst, RCS, SCCS, _sgbak and .svn
8199859 added the -u option
petdance authored Nov 29, 2007
104
105 Files not checked for type:
106 /~$/ - Unix backup files
107 /#.+#$/ - Emacs swap files
108 /[._].*\.swp$/ - Vi(m) swap files
109 /core\.\d+$/ - core dumps
110
3a37ba3 Jerry's squash fix didn't
petdance authored Jan 9, 2007
111 Miscellaneous:
b7aa49f show the --noenv function
petdance authored Mar 14, 2008
112 --noenv Ignore environment variables and ~/.ackrc
70b8207 Lots of reformatting
petdance authored May 21, 2007
113 --help This help
114 --man Man page
115 --version Display version & copyright
116 --thpppt Bill the Cat
b16aa35 Fixed link to Emacs extension (issue 87).
torsten.blix authored May 2, 2008
117
510778d lint cleanups
petdance authored May 25, 2008
118 This is version 1.84 of ack.
Something went wrong with that request. Please try again.