Skip to content

Instantly share code, notes, and snippets.

@tomdwaggy
Last active March 19, 2016 19:00
Show Gist options
  • Save tomdwaggy/f1ab4b2dd7ed2dd04e4f to your computer and use it in GitHub Desktop.
Save tomdwaggy/f1ab4b2dd7ed2dd04e4f to your computer and use it in GitHub Desktop.
locatedb size cc
As mentioned by SHW, agedu indeed created an index. I thought I'd share
another way to create an index, after reading about locatedb. You can
create your own version of a locatedb from du output:
du | awk '{print $2,$1}' | /usr/lib/locate/frcode > du.locatedb
awk rearranges the du output to have filenames first, so that frcode works right.
Then use locate with this database to quickly report disk usage:
locate --database=du.locatedb pingus
You can expand this to suit your needs. I think it's a nice use of locatedb.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment