π»
π»
π»
π»
Today I Learned
Searchβ¦
π»
π»
π»
π»
Today I Learned
README
analytics
bash
db
dgraph
docker
git
go
k8s
linux
net
osx
python
react
unix
Find lines that matches on 2 different sorted file
bulk renaming multiple file
convert pdf to text using ocr
diff output of 2 command
encryption with gpg
extend letsencrypt certificate with dns challenge
ffmpeg monitor and restart stream when it hung or stall
file size older than x days
filtering json with jq
find out what is using swap
fish environment variables from 1password
formatting or parse json in command line
get all line except n last one
grep print only matched
jq extracting properties to arrays from json row line
keep n recent item in folder
open last command in the editor with fc
parsing epoch timestamp to date
pbcopy alternative for copying to clipboard
process pipe operator
record a web stream to youtube
regex for validating password
rename tmux window
repeat content of text x time
replacing last command and execute it
reusing last command argument
send slack message from command line
sending curl post with file
sort file inline
specify compression level in tar gzip
zsh ctrl p same behavior as up arrow
vim
Powered By
GitBook
replacing last command and execute it
For example
$ echo "hello world world world"
hello world world world
If you want to replace
world
with
universe
you can do
# If you use ZSH you can press `tab` at the end of the line and it will replace
# the whole line with the actuall command
$ ^world^universe
$ echo "hello universe world world"
As you can see, it only replace the first matching word.
If you want it to replace the whole match:
# zsh
$ ^world^universe^:G
β
# bash
$^world^universe^&
Don't use it in production
I tend to use
fc
command which allow me to edit the command in my editor first
Previous
repeat content of text x time
Next
reusing last command argument
Last modified
8mo ago
Copy link