|
|
|
|
|
by sethrin
3205 days ago
|
|
The ones I get a lot of use out of are: curly brace substitution: $ mkdir -p new_project/{img,js,css}
mkdir -p new_project/img new_project/js new_project/css
$ mv some_file.txt{,.old}
mv some_file.txt some_file.txt.old
Caret substitution: # systemctl status mysql.service
-- snip output --
# ^status^restart
systemctl restart mysql.service
Global substitution (and history shortcut): $ echo "We're all mad here. I'm mad. You're mad."
we're all mad here. I'm mad. You're mad.
$ !!:gs/mad/HN/
we're all HN here. I'm HN. You're HN.
I have a (WIP) ebook with more such tricks on GitHub if anyone is interested:
https://tenebrousedge.github.io/shell_guide/ |
|
g++ -o foo{,.cpp}