Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Tips on the find command in Linux

Better Alternatives to find

There are some better alternatives to find. The Python module pathlib is the most suitable one for relatively complex jobs. fd, ripgrep, fselect and osquery are other alternatives.

find fd fselect osquery ripgrep (rg)
Primary Use Case File metadata search & execution (scripting) Interactive file name search …

Hands on dict in Python

Tips and Traps

  1. Starting from Python 3.7, dict preserves insertion order (i.e., dict is ordered). There is no need to use OrderedDict any more in Python 3.7+. However, set in Python is implemented as an unordered hashset and thus is neither ordered nor sorted. A trick to dedup an iterable values

Install Python in macOS

There are a few ways to install Python in Mac.

  1. Install system-wide via the official Python installation package.

  2. Install locally using Homebrew (recommended).

You should avoid installing multiple versions of Python in your system. It usually brings more troubles than conveniences. Python virtual environemnts ( via uv ) and Docker containers are …

My Docker Images

Most of my Docker images have different variants (corresponding to tags latest, next, etc) for different use cases. And each tag might have histocial versions with the pattern mmddhh (mm, dd and hh stand for the month, day and hour) for fallback if a tag …