Skip to content
leoliu0Public

About

Very simple utility to replace(r)/delete(d) strings in text files. Similar to sed, sd, sad, but with support of adding/deleting lines.

Resources

Stars

4 stars

Watchers

2 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rd

Very simple utility to replace(r)/delete(d) strings in text files

installation

cargo install rd

usage

rd "replace" "with" -f file.txt

by default, it uses regex, for string literals

rd -s "replace" "with" -f file.txt

replace inplace by

rd "replace" "with" -f file.txt -i

adding lines

rd "to_add" -f file.txt -a 1 # line number to add

delete matching lines

rd "to_delete" -f file.txt -d

modify multiple files

rd "replace" "with" -f *.txt

with fd

rd "replace" "with" -f $(fd '.*\.txt')

performance

Much faster than GNU sed (2x), but slower than sd (2x) for large files. Similar to sd for small files

Good Design Choices

  1. Do not touch the file unless there is a change. This is useful when modifying a long list of files and do not want to leave a trail in every files pass on the command line

About

Very simple utility to replace(r)/delete(d) strings in text files. Similar to sed, sd, sad, but with support of adding/deleting lines.

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages