Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a Linux tool to search for files on offline media like CDs and DVDs. I know there are a lot of "cataloging" tools, but those are all graphical and I want a command line program. Ideal would be if works just like the well-known locate/updatedb bundle, with the only exception that the db update would have to be interactive, so that you can enter some id or description to a media, which will be printed by the locate-like tool, e.g.

$ medialocate foo.png

Does such a tool exist yet? I haven't found anything, but this probably due to the fact that terms like "locale"/"cd"/"files"/"catalog" are just too common to yield good results. It wouldn't be too hard to write something like that myself, but I don't want to reinvent the wheel here.

share|improve this question

migrated from Aug 21 '09 at 20:35

This question came from our site for professional and enthusiast programmers.

Probably better for – EBGreen Aug 21 '09 at 19:55

You can use updatedb to have it parse the removable media paths, just configure accordingly the PRUNEPATHS and PRUNEFS environment variables in /etc/updatedb.conf or equivalent. Although this will only remember the path so if you mount in the same directory a different media and have updatedb run, it'll overwrite (or append?) the files.

You can workaround this by mounting each of your CDs to be catalogued in its own directory, not very hard, but a bit of a nuisance.

share|improve this answer

My particular solution to that is to use isoinfo from wodim to generate files in a ~/dvddb/ directory, with the label of the DVD as the filename (if you don't use RockRidge extensions, change -lR to -lJ):

isoinfo -lR -i /dev/scd0 > ~/dvddb/xxx.txt

Then, to find some file:

grep -i 'name' ~/dvddb/*

You may want to create shell aliases.

share|improve this answer
you should be able to use ls -R > ~/dvddb/disc_name.txt if you want to avoid extra tools – Pär Björklund Aug 21 '09 at 22:21
Pär: Sure. I prefer isoinfo because it lists the disc contents without mounting it. I run it right after I burn the disc, it is very handy in this sense. – Juliano Aug 22 '09 at 4:53

I use a shell script along the lines of:

find $1 -type f -exec {} + > out.xml

Where xmler creates:


The file entries get wrapped in

<catalogue type="dvd" diskid="someid"></catalogue>

and so on, into an XML document. I can then write tools to create HTML catalogues and indexes, search tools and more.

A bit hackish, but works for me.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .