Wed 19 Apr 2023

Finding large files

Today I used the following snippet to find files larger than 1G in my home directory:

find ~ -type f -size +1G -exec \
     du -hs {} \; | sort -rh

The find command calls (-exec) the du command for each file (-type f) that is larger than 1G (-size +1G). The option -hs shows the size in human readable format for each file. The result is piped to sort which sorts on the human readable format (-h) in reverse order (-r).

Note that the backslash in the snippet is used to continue the current line on the next one due to the width restriction of this blog. It should be immediately followed by a new line. Feel free to type the snippet on a single line, without the backslash.

Reasons to avoid Javascript CDNs

Many javascript projects have install instructions recommending that people use a CDN like jsdelivr or unpkg to include the code on their website. This has the advantage that it's quicker to get started with, and it's often claimed to load faster. However, it also has downsides when it comes to privacy, security, and systemic risk, and it may actually be slower in some common cases. Here are some reasons not to use a javascript CDN, and some alternatives to consider instead.

Source: Reasons to avoid Javascript CDNs, an article by Wesley Aptekar-Cassels.