I have been adding one tip per day to my daily tips GitHub repo for the past month. It's a simple setup:
- I manually add tips to a YAML file
- I use a Python script to convert YAML to Markdown
- A helper script appends the Markdown file, README.md, with today's tip
I've also set up GitHub Actions to send me an email when I haven't added a tip yet; so far I've managed to add a new tip each day. Most of the tips are related to working in a shell or shell scripting because I spend most of my day working in the terminal and there are just about an endless supply of new things to learn with the shell.
cat tips.yaml | grep tags | cut -f2 -d'[' | sed -e 's/]$//' -e 's/, */\n/' | sort | uniq -c | sort -k1rn
19 shell
8 productivity
7 r
5 functional programming
3 reminder
3 scripting
2 singularity
1 benchmarking
1 compression
1 defensive programming
1 documentation
1 habits
1 linting
1 project management
1 raspberry pi
1 self-help
1 system
1 visualisation
Most of the tips are actually new to me and I have incorporated some of the tips into my daily work. A few of the tips I have added because I thought they were cool (like using script
to save a shell session!) but don't have a use for, yet!
I really like the habit of having to write a daily tip because it forces me to find ways to improve the way I work every single day. If you're interested, I learned that you can get RSS updates from a GitHub repo, so add https://github.com/davetang/daily_tips/commits/main.atom to your RSS reader. And what do you mean you don't use a RSS reader!?
One month's worth of daily tips is included below and if you find yourself interested, either check out the repo periodically or subscribe to the RSS feed. Enjoy!
Date | Tip | Explanation | Tags |
---|---|---|---|
2025-04-14 | mv oldname.txt newname.txt && cat $_ |
$_ can be used to get the last argument of the previous command. | shell, productivity |
2025-04-15 | Just type the name of the directory to autocd into it | In Bash and Zsh autocd is on by default; use shopt autocd and setopt \| grep autocd to check. |
shell, productivity |
2025-04-16 | Use purrr::walk() for side effects. |
When you do not care about the return value, use purrr::walk() instead of purrr::map() . |
r, functional programming |
2025-04-17 | Use fc to Fix Command. |
Opens your last command with $EDITOR and after you edit and save, the command runs immediately. |
shell, productivity |
2025-04-18 | diff -y file1.txt file2.txt |
diff -y provides a side-by-side comparison to easily spot differences. |
shell, productivity |
2025-04-19 | script mysession.log |
script save entire shell session (incl. input/output) for logging; use exit to stop session. |
shell, productivity |
2025-04-20 | Use --containall with Singularity for better isolation |
Prevents container from reading or writing from the host; useful for testing in a minimal, clean environment. | singularity |
2025-04-21 | pstree -p PID |
Show processes in a tree with PID | shell, system |
2025-04-22 | Good enough now beats perfect later. | A working solution now is more useful than a perfect one that never arrives. | project management |
2025-04-23 | Consider using tryCatch() over stopifnot() . |
tryCatch() can handle and recover from errors, while stopifnot() halts execution. |
r, defensive programming |
2025-04-24 | apropos unzip |
If you know what a command does, but not the name use apropos to search the man pages! |
shell, documentation |
2025-04-25 | Use --cleanenv with Singularity |
Using --cleanenv prevents the container from inheriting most of the environment variables from the host. |
singularity |
2025-04-26 | tar -cJf archive-name.tar.xz folder/ | xz typically compresses better than gz but is slower; use for long term backups. | shell, compression |
2025-04-27 | watch vcgencmd measure_temp |
Measure the temperature every second. | raspberry pi |
2025-04-28 | Use the dot placeholder with {purrr}. | purrr::map_int(1:5, ~ . + 1) vs. purrr::map_int(1:5, function(x) x + 1) . |
r, functional programming |
2025-04-29 | Use date and bc to measure elapsed time. |
Use $(date +%s.%N) to get times then use echo "${END} - ${START}" \| bc to get elapsed time. |
shell, benchmarking |
2025-04-30 | Apply the aggregation of marginal gains. | Follow the philosophy of searching for a tiny margin of improvement in everything you do. | self-help, habits |
2025-05-01 | find ~ -type f -size +100M |
Find files in your home directory that are larger than 100M using find . |
shell, reminder |
2025-05-02 | purrr::discard(~ stringr::str_detect(., "old")) |
Use purrr::discard to discard elements based on their values. |
r, functional programming |
2025-05-03 | purrr::list_rbind(my_list, names_to = "id") |
Use purrr::list_rbind() to combine list elements into a single data structure. |
r, functional programming |
2025-05-04 | f <- purrr::compose(sqrt, abs) |
Use purrr::compose() to combine multiple functions into one, chaining them from right to left. |
r, functional programming |
2025-05-05 | Use shellcheck to lint and find potential issues in your script. |
ShellCheck is a static analysis and linting tool for sh/bash scripts. | shell, linting |
2025-05-06 | Use the {gt} package to make nice looking tables in R. | The gt philosophy: we can construct a wide variety of useful tables with a cohesive set of table parts. | r, visualisation |
2025-05-07 | seq 10 \| datamash sum 1 mean 1 |
GNU datamash can perform basic numeric, textual and statistical operations on input textual data files. | shell, productivity |
2025-05-08 | Use rsync over scp |
rsync only transfers differences, has better support for resuming transfers, and has more features. |
shell, productivity |
2025-05-09 | tmpfile=$(mktemp) |
Use mktemp for secure, race-free temp file creation. |
shell, scripting |
2025-05-10 | find . -maxdepth 1 -type f ! -name "*.sh" ! -name "*.md" -exec ls {} + |
Use ! with find to exclude files. |
shell, productivity |
2025-05-11 | trap 'echo Caught a signal (EXIT, INT, or TERM).; exit' EXIT INT TERM |
trap is useful for cleaning up temporary files, restoring settings, or just handling interruptions gracefully. |
shell, scripting |
2025-05-12 | echo Done with task at line $LINENO |
$LINENO gives the line number of the current command within a script or function. |
shell, scripting |
2025-05-13 | du -h --max-depth=1 \| sort -h |
Get size of files and top directories, then sort by human-readable sizes. | shell, reminder |
2025-05-14 | git config --global help.autocorrect 1 |
Auto-correct typos in Git commands. | shell, reminder |

This work is licensed under a Creative Commons
Attribution 4.0 International License.