Thursday, January 15, 2015

Almost 20 Years with Unix, Mann kann jetst Etwas lernen

Things I didn't know after all these years!

tac : view a file backwards
cd -   : takes you back to where you were before you cd'd
apt-cache search tells you what packages are available in the repository that might be a match
dpkg -s tells you if the package xyz is installed on your system
/proc is a pseudo filesystem - only lives in RAM
xz for compression - the new kid on the block
CTRL-r on bash command line lets you search history for a particular cmd
CTRL-u : delete from beginning of line to cursor

In vi, do "%!command" to overwrite. fmt is a useful one.
Dealing with text : paste is a utility that pastes files together column wise! join is a smarter version of paste!
grep -C N -- wow, context is reported (N lines on either side). Where have you been my whole life?
tr -cd <> : delete the complement of the match you specify (Eg [:digit:], [:lower:], etc)
z command family - deal directly with compressed files as if they were plain text! You also have xz and bz (so, bzcat, bzless, bzgrep, etc)

Options for top in interactive mode : m, t, A, r, f ..
List files that don't match : grep -L pattern fileList

Also check out the link to Alex Skorkin's masterpiece : http://tersamgt.blogspot.com/2017/04/alan-skorkins-treasure-trove-bash.html

No comments: