brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: occ info:file:space shows what fills a Nextcloud folder

Nextcloud
~/tips/tip-nextcloud-info-file-space

sudo -E -u www-data php occ info:file:space /layla/files/Videos

Lists the biggest items in a Nextcloud folder with their sizes.

When a Nextcloud account is suspiciously full, the web interface only shows a total. Finding the folder or the video behind it means clicking through everything. occ has a command that works like du for Nextcloud paths.

Give it a folder, with the user ID at the start of the path:

sudo -E -u www-data php occ info:file:space /layla/files/Videos
  Total: 14.7 GB
  +------------------+--------+
  | Path             | Size   |
  +------------------+--------+
  | lecture-2025.mp4 | 8.2 GB |
  | demo-video.mp4   | 4.1 GB |
  +------------------+--------+

That output is the example from the manual. It lists the largest items of the folder, 25 by default. Use -c (--count) to change the number, or -a (--all) to list everything.

Its siblings are useful as well. info:file shows the details of one file, such as size, ETag, permissions and which users have access, and -c on a folder lists its immediate contents. info:storages lists all storages ordered by the number of files they hold, which helps when you wonder where a huge file cache comes from.

The caveat is the version. These info: commands are in the latest admin manual, and I would not assume an older install has them. Check with occ list; if the info commands are missing, du -sh on the data directory is the fallback. Also remember the sizes are what Nextcloud has in its file cache, so files added behind its back only show up after occ files:scan.

Further reading: occ system commands, info (Nextcloud admin manual), occ files commands (Nextcloud admin manual)

Going deeper: Guide: link Prowlarr to Sonarr and Radarr once, and stop typing indexers into every app

More Nextcloud tips sudo -E -u www-data php occ user:report sudo -E -u www-data php occ app:update --showonly sudo -E -u www-data php occ background-job:history -s 3 -l 10 docker exec --user www-data nextcloud php occ maintenance:mode --on docker exec -it --user www-data nextcloud php occ user:resetpassword layla All Nextcloud tips (13) All topics

Link