ned(1)

NAME
ned - Powerful regex replace for bulk editing.

SYNOPSIS
ned [OPTION...] [-p] PATTERN [FILE...]
ned [OPTION...] [FILE...] -p PATTERN

DESCRIPTION
For regular expression power users, ned is like grep, but with powerful replace capabilities, and unlike sed, as it isn't restricted to line oriented editing. FILEs are ASCII or UTF-8 text files. For regex syntax see: https://docs.rs/regex/1.3.4/regex/#syntax

OPTIONS
-p, --pattern PATTERN
    Specify a pattern. If the option isn't used the pattern must precede the files. The option allows the pattern to be put after the files for more convenient editing.
-r, --replace REPLACEMENT
    Replace matches. Replacements may include numbered and named groups. Replaces always operate on whole files.
-w, --whole-files
    Operate on whole files. Otherwise matches are line oriented.
-n, --number N
    Match/replace N occurrences.
-k, --skip N
    Skip N occurrences before matching/replacing.
-b, --backwards
    Make -n/--number and -k/--skip options count backwards.
-i, --ignore-case
    Ignore case.
-s, --single
    '.' matches newlines, ^ and $ match the beginning and end of each file. Use with --whole-files.
-m, --multiline
    Multiline, ^ and $ match the beginning and end of each line. Use with --whole-files.
-x, --extended
    Ignore whitespace and # comments.
--case-replacements
    Enable \U - uppercase, \L - lowercase, \I - initial uppercase (title case), \F - first uppercase (sentence case) replacements. \E marks the end of a case replacement.
-o, --matches-only
    Show only matches.
-g, --group GROUP
    Show the match group, specified by number or name.
-v, --no-match
    Show only non-matching.
-f, --filenames-only
    Show only filenames containing matches. Use with -v/--no-match to show filenames without matches.
-F, --no-filenames
    Don't show filenames.
-l, --line-numbers-only
    Show only line numbers containing matches. Use with -v/--no-match to show line numbers without matches. Use without -w/--whole-files.
-L, --no-line-numbers
    Don't show line numbers. Use without -w/--whole-files.
-C, --context LINES
    Show LINES lines around each matching line. Is the same as specifying both -B/--before and -A/--after with the same LINES. Use without -w/--whole-files.
-B, --before LINES
    Show LINES lines before each matching line. Use without -w/--whole-files.
-A, --after LINES
    Show LINES lines after each matching line. Use without -w/--whole-files.
-R, --recursive
    Recurse.
-l, --follow
    Follow symlinks. (Ignored on Windows.)
--include GLOB
    Match only files that match GLOB.
--exclude GLOB
    Skip files matching GLOB.
--exclude-dir GLOB
    Skip directories matching GLOB.
-u, --ignore-non-utf8
    Quietly ignore files that cannot be parsed as UTF-8 (or ASCII). Because this requires reading the file, the --exclude option should be preferred.
-a, --all
    Do not ignore files and directories starting with '.'.
-c
    Show filenames, line numbers, and matches in color. Is the same as --colors=always.
--colors [WHEN]
    'auto' shows filenames, line numbers, and matches in color when stdout is a terminal, not when it is a pipe, 'always' shows color even when stdout is a pipe, and 'never' never shows colors.
--color [WHEN]
    Synonym for --colors.
--stdout
    Output to stdout.
-q, --quiet
    Suppress all normal output. When matching terminate as soon as a match is found.
-V, --version
    Output version information and exit.
-h, --help
    Print this help and exit.
Quiet
    When -q/--quiet is specified, ned tests for matches and returns an exit code of 0 if a match is found in ANY file. Quiet matches will only read as many files as needed to find a match. Even without this shortcutting behaviour, quiet matches are more performant than non-quiet matches.

EXIT STATUS
An exit status of 0 means matches were found/replaced. An exit status of 1 means no matches were found.

ENVIRONMENT
NED_DEFAULTS
    Specifies ned options added to the program's arguments. Is a space delimited list of options and is not first interpreted by a shell, so quotes are not required around arguments. For example:

    NED_DEFAULTS="-u -R --exclude *.bk --exclude-dir .git"

EXAMPLES
The TL;DR section of the ned README.md gives example usages. https://github.com/nevdelap/ned#tldr

SEE ALSO
https://github.com/nevdelap/ned/wiki

AUTHOR
Nev Delap (nevdelap@gmail.com)

COPYRIGHT
ned 1.3.1 Copyright (C) 2016-2021 Nev Delap

LICENSE
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.