open out.svg; echo new-database.dot | entr sh -c 'dot new-database.dot -Tsvg -o out.svg; $HOME/dotfiles/reload-browser Firefox'
reload file in browser when it changesdmesg
show startup log messages!!
run the last command againfind ./ -type f -exec sed -i '.bak' -e 's/foo/bar/g' {} \;
find and replace string in all files in a directory. Follow up withfind . -type f -name '*.bak' -delete
if necessarysudo getent passwd | cut -d : -f 6 | sudo sed 's:$:/.bash_history:' | sudo xargs -d '\n' grep -H -e "$command"
orgrep -e "$pattern" /home/*/.bash_history
to see how others use a commandetop -node testnode@localhost -setcookie 123
- run etop to see top like info for a running Erlang nodepaste -sd+ - | bc
sum values in lines https://stackoverflow.com/a/18141152/85360reset
clears the terminal and resets the terminal state.fc
open last command in$EDITOR
for editing. (fix command)
vit
select contents of html tag.v
isual select texti
n at
ag.dit
would delete the contents of the tag.^A
and^X
allow you to increment the number your cursor is over, or first number after the cursor that is on the same line.<F4>
toggles everything that occupies space to the left of the text (line numbers, gitgutter, etc...)^F-[
in tmux works the same as^F <PageUp>
, which puts tmux into scroll mode. This command comes in handy on keyboards that don't have<PageUp>
and<PageDown>
.:21,25s/old/new/g
to substitutenew
forold
on lines 21 through 25.- When scrolling in tmux,
<fn> <UpArrow>
and<fn> <DownArrow>
can be used instead of<PageUp>
and<PageDown>
. This also comes in handy on keyboards that lack Page Up and Page Down. set list!
to toggle showing of whitespace characters.g;
go back a change positiong,
go forward a change position:'<,'>:w !<command>
pipe selection to STDIN of<command>
. For example, to count the words selected run:'<,'>:w !wc -w
or:'<,'>:w !haste|pbcopy
to send to pastebin and copy the URL.g^g
print number of selected lines when in visual mode^x^l
complete whole linecfdo s/foo/bar/g | update
- find and replace in all files in quickfix:g/^\d/norm A;
- use g + norm to add a semicolon to every line that starts with a number.e! ++enc=<encoding>
- reopen the file as a different encoding.:r https://stratus3d.com/index.html
load remote file into buffer:e https://stratus3d.com/index.html
load remote file into new buffer^g
and^t
- jump through matches while typing in a search
print-%: ; @echo $*=$($*)
orprint-%: ; @echo '$(subst ','\'',$*=$($*))'
allows you to runmake print-<variable_name>
and print the value of any variable. Can be used without modifying the file in GNU make 3.82 or greater like this:make --eval="print-%: ; @echo $*=$($*)" print-SOURCE_FILES
.
erlang:system_info(port_limit).
show port/file limit:inet.i()
show ports being used by processes in the VM:hackney_trace.enable(:max, :io)
enable tracing of Hackney requestsCtrl+g i <ret> c <ret>
to stop code that is stuck running and blocking the shellCtrl+]
to auto-close open brackets
bin_opt_info
print warnings and information about how binaries are used+pc unicode
increase the range of characters that the system will consider printable. Helpful when testing with unicode in the shell