ned
Edit text files
TLDR
Recursively search starting in the current directory, ignoring case
Search always showing colored output
Search never showing colored output
Search ignoring certain files
Simple replace
Replace using numbered group references
Replace changing case
Preview results of a find and replace without updating the target files
SYNOPSIS
ned [-s] [-p string] [file...]
PARAMETERS
file...
Specifies one or more files to be edited. If no file is specified, ned typically starts with an empty buffer.
-s
Suppresses the printing of character counts by 'e', 'r', and 'w' commands, and diagnostic messages for empty files.
-p string
Uses string as the interactive prompt. This is usually a single character like '*' or '?'. If not specified, ned often does not display a prompt by default.
DESCRIPTION
ned is a largely obscure and non-standard line editor for Unix-like operating systems. Unlike more common editors such as vi, Vim, or Emacs, ned operates in a line-by-line mode, primarily interacting via simple, single-character commands. It typically lacks a visual screen interface, making it suitable for scripting or use in environments where a full-screen terminal is unavailable or undesirable, such as remote SSH sessions with limited display capabilities, or very old systems.
Its command set usually involves specifying line numbers or ranges, followed by a command (like p for print, d for delete, s for substitute, a for append, i for insert, w for write, q for quit). Operations are performed on lines specified by their address, which can be absolute line numbers, relative offsets, or search patterns.
While its exact feature set can vary due to its non-standard nature—it might be a custom-built utility or a very old, rarely distributed program—its core functionality generally revolves around fundamental text manipulation at the line level. Users must explicitly issue commands to see changes, as there's no real-time display update. This makes ned a powerful, albeit cryptic, tool for experienced users needing precise, programmatic text alterations.
CAVEATS
The ned command is highly obscure and not a standard utility found on most modern Linux distributions. Its existence and feature set are largely dependent on specific historical Unix environments or custom implementations. Users should not expect to find it pre-installed or readily available.
Furthermore, as a line editor, it provides no visual feedback on the document content or changes without explicit print commands, making it challenging for beginners and prone to errors if not used carefully. Changes are often written directly to the file upon saving, with no undo history, requiring careful command execution.
COMMON INTERNAL COMMANDS
While ned's exact command set can vary, it typically supports a subset of line editor commands similar to ed. These are entered after the editor is invoked:
- a: Appends text after the current line.
- i: Inserts text before the current line.
- d: Deletes specified lines.
- p: Prints specified lines to standard output.
- s/old/new/: Substitutes old text with new on specified lines.
- w file: Writes the buffer contents to a file.
- q: Quits the editor.
- !command: Executes a shell command.
INTERACTIVE MODE
After invoking ned with a file, users enter an interactive command mode. There is no visual display of the file content; users must explicitly use commands like p (print) to view parts of the file. Commands are typically preceded by an address (line number or range) if not operating on the current line.
HISTORY
The concept of ned (often standing for "New EDitor") likely emerged in the early days of Unix-like systems, possibly as a simplified or alternative take on the standard ed line editor. Its development and usage were never widespread, often limited to specific academic projects, small development teams, or niche system configurations where a minimal editor was required. It represents a bygone era of text editing before the widespread adoption of full-screen, visual editors, emphasizing command-line efficiency over user-friendliness. Its exact lineage is poorly documented due to its non-standard nature.