Interests: Regular Expressions, Linux CLI one-liners, Scripting Languages and Vim
Why do you think it is a phishing link? Gumroad is a well known platform to sell digital goods.
I mention it is free up to some date because it will go back to being a paid product after that.
Is it regex or sed/awk syntax (or both) that gives you trouble?
I had similar reaction and didn’t even try to learn them for years - then I caught the stackoverflow craze of answering CLI questions (and learning from others).
oxipng, pngquant and svgcleaner for optimizing images
auto-editor for removing silent portions from video recordings
Not my blog, just sharing it here. Saw it on HN (https://news.ycombinator.com/item?id=40419325)
What’s the difference between two_percent and skim?
I had to learn Linux CLI tools, Vim and Perl at my very first job. Have a soft spot for Perl, despite not using it much these days other than occasional one-liners (mainly for advanced regex features).
Thanks a lot for the kind words! Means a lot to me :)
Thanks! 😊
That’s great to hear and thanks for the kind feedback :)
I used to use it for posting on Twitter, with some keywords (like book title) in bold.
alias a='alias'
a c='clear'
a p='pwd'
a e='exit'
a q='exit'
a h='history | tail -n20'
# turn off history, use 'set -o history' to turn it on again
a so='set +o history'
a b1='cd ../'
a b2='cd ../../'
a b3='cd ../../../'
a b4='cd ../../../../'
a b5='cd ../../../../../'
a ls='ls --color=auto'
a l='ls -ltrhG'
a la='l -A'
a vi='gvim'
a grep='grep --color=auto'
# open and source aliases
a oa='vi ~/.bash_aliases'
a sa='source ~/.bash_aliases'
# sort file/directory sizes in current directory in human readable format
a s='du -sh -- * | sort -h'
# save last command from history to a file
# tip, add a comment to end of command before saving, ex: ls --color=auto # colored ls output
a sl='fc -ln -1 | sed "s/^\s*//" >> ~/.saved_commands.txt'
# short-cut to grep that file
a slg='< ~/.saved_commands.txt grep'
# change ascii alphabets to unicode bold characters
a ascii2bold="perl -Mopen=locale -Mutf8 -pe 'tr/a-zA-Z/𝗮-𝘇𝗔-𝗭/'"
### functions
# 'command help' for command name and single option - ex: ch ls -A
# see https://github.com/learnbyexample/command_help for a better script version
ch() { whatis $1; man $1 | sed -n "/^\s*$2/,/^$/p" ; }
# add path to filename(s)
# usage: ap file1 file2 etc
ap() { for f in "$@"; do echo "$PWD/$f"; done; }
# simple case-insensitive file search based on name
# usage: fs name
# remove '-type f' if you want to match directories as well
fs() { find -type f -iname '*'"$1"'*' ; }
# open files with default application, don't print output/error messages
# useful for opening docs, pdfs, images, etc from command line
o() { xdg-open "$@" &> /dev/null ; }
# if unix2dos and dos2unix commands aren't available by default
unix2dos() { sed -i 's/$/\r/' "$@" ; }
dos2unix() { sed -i 's/\r$//' "$@" ; }
I have a book for Perl One-Liners as well, which I’m currently revising :)
I’ve written books on regex too, if you are interested in learning ;)
Thanks a lot for the feedback on Coreutils book! It’s so nice to hear that it helped in your thesis.
Regarding the ebook versions, I use pandoc
to convert GitHub style Markdown to PDF/EPUB (wrote a blog post about my process here: https://learnbyexample.github.io/customizing-pandoc/). I had to search through stackexchange threads to customize the few things I could. I don’t know how to fix the kind of page breaks you mentioned. But, I’ll try to find a solution. Thanks again for the feedback :)
Hope you find the book useful :)
I’d also suggest these shorter guides to get started:
See also:
Inspired by explainshell, I wrote a script (https://github.com/learnbyexample/command_help) to be used from the terminal itself. It is a bit buggy, but works well most of the time. For example:
$ ch grep -Ao
grep - print lines that match patterns
-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines. Places a
line containing a group separator (--) between contiguous groups of
matches. With the -o or --only-matching option, this has no effect
and a warning is given.
-o, --only-matching
Print only the matched (non-empty) parts of a matching line, with
each such part on a separate output line.
I use GVim for coding and text editing in general.
Programming wise, CLI tools (grep, sed, awk, sort, head, etc) are enough for most of my tasks. I’ve written a few Python TUI projects (uses Textual framework) but these are around 300-400 lines, so Vim is more than enough for my purposes. Don’t even need any plugins.
I have a list of learning resources for CLI tools and scripting here: https://learnbyexample.github.io/curated_resources/linux_cli_scripting.html
I’ve also written a few TUI interactive apps to practice text processing commands like grep, sed, awk, coreutils, etc: https://github.com/learnbyexample/TUI-apps