Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GOSED

Fastest, easiest alternative to sed/grep ecc

Install

git clone https://github.com/mcisback/gosed.git
cd gosed
go build -o /usr/local/bin/gx . # System install
go build -o ~/.local/bin/gx . # Local user install or use your custom path

Example match:

history | gx '^[\d\s]+rclone'

Example replace:

history | gx '^[\d\s]+' 'replacement'

Remove nth line:

history | gx '5/d' # remove line number 5 (start counting from 1)

Remove nth:mth range lines:

history | gx '5:10/d' # Remove lines from number 5 to 10 (start counting from 1)

Delete matching lines:

echo file.txt | gx 'Sublime/d' # Remove all lines containing sublime

Show nth line:

history | gx '5/m' # Show line number 5 (start counting from 1)

Show nth:mth range lines:

history | gx '5:10/m' # Show lines from number 5 to 10 (start counting from 1)

Use instead of tr:

echo $PATH | gx ':' '\n'

Highlight every line containing bash:

echo README.md | gx 'bash/b'

Load from file instead of STDIN:

gx -f README.md 'bash/b'

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages