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$//' "$@" ; }
learnbyexample
I recently wrote a few interactive TUI apps to help practice grep, sed, awk and other CLI tools: https://github.com/learnbyexample/TUI-apps
EPUB reader
Check out https://github.com/auctors/free-lunch (list of free Windows software)
See also https://www.nirsoft.net/ (freeware, not open source)
Cradle by Will Wight is a page-turner. 12 book completed series and audio is great based on gushing reviews I've come across.
GVim.
Check out https://ghostwriter.kde.org/ if you are looking for a GUI app with live preview, full screen mode, etc.
If he likes games, check out "Invent Your Own Computer Games with Python": https://inventwithpython.com/invent4thed/
If you are looking for books, check out:
Intermediate:
- Beyond the Basic Stuff with Python โ Best Practices, Tools, and Techniques, OOP, Practice Projects
- Pydon'ts โ Write elegant Python code, make the best use of the core Python features
- Python Distilled โ this pragmatic guide provides a concise narrative related to fundamental programming topics such as data abstraction, control flow, program structure, functions, objects, and modules
Advanced:
- Fluent Python โ takes you through Pythonโs core language features and libraries, and shows you how to make your code shorter, faster, and more readable at the same time
- Serious Python โ deployment, scalability, testing, and more
- Practices of the Python Pro โ learn to design professional-level, clean, easily maintainable software at scale, includes examples for software development best practices
- Intuitive Python โ productive development for projects that last
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 ;)
I used to use it for posting on Twitter, with some keywords (like book title) in bold.