Ben Chuanlong Du's Blog

And let it direct your passion with reason.

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 …

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 the comamnd chsh. For example, the following …

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 …