Documentation

amber – code search and replace tool

amber is a command-line code search and replacement utility inspired by grep-like tools including ack and The Silver Searcher. It provides two commands: ambs for searching and ambr for replacing text.

The search command scans directories recursively and displays matching results with coloured output. Its defaults are intended for source-code repositories, avoiding version-control directories and binary files during ordinary searches.

The replacement command uses an interactive workflow in which users can approve, reject or apply all proposed substitutions. amber also supports multithreaded searching, including dividing large files into sections that can be processed in parallel.

Configuration files allow users to change the default behaviour of searching and replacing. The two commands have separate settings, so their recursion, output and filtering options can be configured independently.

This is free and open source software.

Key Features

  • Search source files using the ambs command.
  • Perform replacements using the ambr command.
  • Search recursively from the current directory by default.
  • Accept an explicit directory as the search root.
  • Ignore common version-control directories including .git, .hg, .svn and .bzr.
  • Skip binary files during ordinary searches.
  • Display matching results using coloured output.
  • Search large files in parallel using multiple threads.
  • Treat search patterns as literal text by default.
  • Enable regular-expression matching using –regex.
  • Use regular-expression capture groups in replacement text.
  • Prompt before making replacements.
  • Approve, reject, apply all or quit during interactive replacement.
  • Perform non-interactive replacements when explicitly requested.
  • Configure search and replacement behaviour using separate TOML files.
  • Control recursion, symlink handling, ignored files, output formatting and statistics.
  • Cross-platform support – runs on Linux, macOS, and Windows.

Website: github.com/dalance/amber
Support:
Developer: dalance
License: MIT License

ambr help

ambs help

amber is written in Rust. Learn Rust with our recommended free books and free tutorials

Alternatives to sed


Explore Linux

Best Free and Open Source Software - A huge collection of recommended free and open source software covering every major category.
In-depth Linux Software Reviews - Detailed assessments of Linux software covering features, usability and overall quality.

The Big List of Active Linux Distros - An extensive collection of actively developed Linux distributions.
Open Source Alternatives - Alternatives to software and services from Google, Microsoft, Apple, Adobe, IBM, Autodesk, Oracle and others.
Essential Linux System Tools - Indispensable utilities for monitoring, maintaining and managing Linux systems.
Linux Productivity Tools - Useful utilities for improving productivity and streamlining everyday tasks.
Alternatives to Popular CLI Tools - Modern alternatives to familiar command-line utilities supplied with Linux systems.
Awesome Free Linux Game Tools - Tools, utilities and companion software that improve gaming on Linux.
Machine Learning on Linux - Machine learning and deep learning software, self-hosted applications and practical tools.
Saving Money with Linux - Practical ways to reduce electricity consumption and lower computing costs with Linux.
Linux Candy - Fun, entertaining and sometimes delightfully quirky software from the lighter side of Linux.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted