vgrep
Search files for lines not matching pattern
TLDR
Recursively search the current directory for a pattern and cache it
Display the contents of the cache
Open the "4th" match from the cache in the default editor
Display a context of "3" lines for each match in the cache
Display the number of matches for each directory in the tree
Display the number of matches for each file in the tree
Start an interactive shell with cached matches
SYNOPSIS
vgrep [options] pattern [file ...]
PARAMETERS
pattern
The regular expression to search for.
file ...
One or more files to search in. If omitted, reads from standard input.
-i
Ignore case distinctions in both the PATTERN and the input files.
-r
Recursively search directories.
-n
Prefix each line of output with the line number within its input file.
-v
Invert the sense of matching, to select non-matching lines.
-w
Select only those lines containing matches that form whole words.
-c
Suppress normal output; instead print a count of matching lines for each input file.
-l
Suppress normal output; instead print the name of each input file from which output would normally have been printed.
-o
Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line.
-A NUM
Print NUM lines of trailing context after matching lines.
-B NUM
Print NUM lines of leading context before matching lines.
-C NUM
Print NUM lines of output context.
DESCRIPTION
The `vgrep` command is not a standard Linux command. It is most likely a custom script or alias created by a user or administrator. Without more context, its exact behavior is unknown. Generally, if it's named 'vgrep', it's likely intended as a variation or wrapper around the standard `grep` command. It probably pre-configures `grep` with common options and/or uses a pipeline with other utilities to perform more complex text searching. The 'v' might stand for 'verbose', 'very', or something specific to the user who defined it.
To understand its actual functionality, you need to examine the alias or script definition on the system where it's used. This can usually be found in shell configuration files like `.bashrc`, `.zshrc`, or system-wide configuration files. Inspecting the definition will reveal the exact `grep` command and any other commands being executed.
Without the actual script or alias definition, we can only speculate that it modifies the way grep is used for certain purposes. For instance, a common usage would be to include colour highlighting, ignore case, or recursively search directories, or include useful surrounding context within the output.
CAVEATS
Since `vgrep` is non-standard, its actual behavior depends on its specific implementation. Check the alias or script definition to confirm its functionality.
FINDING THE VGREP DEFINITION
To find the actual definition of the `vgrep` command, you can use the `alias` command in your shell (e.g., `alias vgrep`) to check if it's an alias. Alternatively, check your shell configuration files (e.g., `.bashrc`, `.zshrc`, `.profile`) for an alias definition or a script that defines `vgrep`.
EXAMPLE CUSTOM IMPLEMENTATIONS
Here are some possible examples of what vgrep might be defined as:
Alias: `alias vgrep='grep --color=auto -i'` (This would make grep case-insensitive and highlight matches).
Script: A script that searches for a pattern in log files within a specific directory.