TIL - Today I Learned
Things I learned from colleagues, the internet or just out of curiosity.
tail -f <logfile> | grep --line-buffered
: filter logfile continuously while debugging a service or some ongoing process&<term>
inless
: show only lines matching filter in less pagerctrl+x ctrl+e
inbash
: opens default editor (specified with$EDITOR
or$VISUAL
) for specifying a prompt, will get executed on save+close (src, look foredit-and-execute-command
).ctrl+r
inbash
: fuzzy search in bash history, press again for cycling throughctrl+x
andctrl+a
on an action while interactive rebase: cycle through the rebase actions when interactively rebasing within an editor (git rebase -i
)yes | dd oflag=/mnt/data iflag=fullblock oflag=direct bs=16M count=$((1024*1024/16)) status=progress
: generate 1TB of non-random test data with storage backend speed, avoid buffering where possiblego doc --all strings
: local documentation of the gostrings
packagedu --summarize -h .
: show summarized usage of a folder human friendlyag -G <filename-pattern> <search-pattern>
: only search in files matching the filename pattern with the silver-searcherag
(?:<pattern>)
: regex matches pattern but without generating a capture-groupdpkg -S <file>
: query package providing given file on debian-based systemsdpkg -L <package>
: list all files of an installed dpkg packageecho lol|/usr/bin/cat /dev/stdin
: use/dev/stdin
as filename when the stdout from previous command schould be used. Useful for commands not supporting stdin as input source.vim <url>
: open vim, download and show content of the given urltcpdump -i <interface> -pvn port 67 and port 68
: see dhcp requests and responses for<interface>
- Adding a space before a bash command prevents it from being written to the history.
date +"%s"
: show current time as unix timestampdate -d @<unix-timestamp>
: convert unix timestamp into a human readable onectrl+z
andfg
: suspend running applications viactrl+z
to get to the original shell and get back to the application viafg
ffmpeg -i input.mp4 output.gif
: Converts mp4 video into gif- Send empty email to mailing list with
-leave
in front of the@
of the address: unsubscribe from mailing list, e.g.qemu-devel-leave@nongnu.org
, see GNU Mailman FAQ systemctl list-units
: List all registered units with their run state. Compact and easily grep-able