Finding Files in My Folders

Finding Files in My Folders

Managing disk space efficiently is essential, especially when working on systems with strict file quotas. Recently, I encountered a situation where I had exceeded my file limit and needed a quick way to determine which folders contained the most files. To analyze my storage usage, I used the following command:

for d in .* *; do [ -d "$d" ] && echo "$d: $(find "$d" -type f | wc -l)"; done | sort -nr -k2

Breaking Down the Command

This one-liner efficiently counts files across all directories in the current location, including hidden ones. Here’s how it works:

  • for d in .* * – Loops through all files and directories, including hidden ones.
  • [ -d "$d" ] – Ensures that only directories are processed.
  • find "$d" -type f | wc -l – Counts all files (not directories) inside each folder, including subdirectories.
  • sort -nr -k2 – Sorts the results in descending order based on the number of files.

Why This is Useful

With this command, I quickly identified the directories consuming the most inodes and was able to take action, such as cleaning up unnecessary files. It’s an efficient method for understanding file distribution and managing storage limits effectively.

Alternative Approaches

If you only want to count files directly inside each folder (without subdirectories), you can modify the command like this:

for d in .* *; do [ -d "$d" ] && echo "$d: $(find "$d" -maxdepth 1 -type f | wc -l)"; done | sort -nr -k2

This variation is useful when you need a more localized view of file distribution.

Christmas service in Pälkäne

Christmas service in Pälkäne

This Christmas we have been to Pälkäne, a little municipality close to Tampere. There is a old church from the 15th century that lost the roof in a storm in the 19th century (as far as I remember from what I read) and now, since 15 years they started using it again for services. However, they plan to build a new (glass-) roof to it, so this year was the last time the service took place in this type.

Project presentation

Project presentation

🌱 Discover Tribiome: a pioneering European project that delves into the complexities of microbiomes in agriculture.

Soil microbiomes 🌿 play a crucial role in the transition towards more sustainable agriculture. By understanding and harnessing this microscopic world 🦠, we can find solutions to current challenges related to the environment, food security, and climate change. 🌾

📹 Watch the presentation video of Tribiome, initiated by Wagralim, the Agri-Food Innovation Cluster of Wallonia and its partners with the help of Studio Chamberlin and learn more about this groundbreaking project:


Wagralim, the Agri-Food Innovation Cluster of Wallonia | ITENE | Universidad de Burgos | ASAJA (Asociación Agraria-Jóvenes Agricultores) | ValGenetics | SIMAVI Software Imagination & Vision | Rete Semi Rurali ETS | Natural Resources Institute Finland / Luonnonvarakeskus | Particula Group | Grupo Fertiberia

The end of the long winter tunnel

The end of the long winter tunnel

It seems we finally reached the end of winter! Today we have almost 20 degrees, we can sit outside and have an afternoon Espresso. I managed to submit a grant application and now a few free days during Mayday are ahead, while the weather forecast promises plain, blue sky with 15 and more degrees. That is truly something I am looking forward to now! Certainly there are still small tasks here and there, but the main job will be to get the garden ready for summer, maybe even pitching the pool already 🙂