Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Tips on the find command in Linux

It is suggested that you use Python (the pathlib module), ripgrep, fselect or osquery (currently have some bugs) instead of find to locate files.

  • The Python module pathlib is the most suitable one for relatively complex jobs.
  • ripgrep is a more user-friendly alternative to find.
  • Both fselect and osquery support …

Map Keys in Linux

Note: For Vim users, it is appealing to make the Caps Lock function like Escape. It is suggested that you make Caps Lock an additonal Escape rather than swap them. This avoid inconsistent key mapping issues when you work remotely via VNC, NoMachine, etc.

Desktop Environment

Some desktop environment (e …

Compress and Decompressing Archives in Linux

Tips and Traps

  1. Always test integrity of the compressed file before you throw away the original archives. I've seen a case before that a large zip file generated in Windows cannot be unzipped correctly in Linux. Not sure what happend though.

  2. Zstd is currently the best compression/decompression tool. It …

Schedule Task Using Cron in Linux

Note: Cron is great for simple scheduling requests. For complicated scheduling with many dependencies you probably want to go with AirFlow .

Installation

Cron is usually installed by default. It not (e.g., if you are using a Docker image), you can install it using the following command (on Ubuntu).

wajig …

Change Shell in Mac

You can check the current shell in use by running the following command.

echo $SHELL

However, notice that echo $SHELL does not report the right shell sometimes. A more robust way is to use echo $0.

The default shell can be changed using thee comamnd chsh. For example, thee following …