[X4U] Indexing CDs & DVDs

Doug McNutt douglist at macnauchtan.com
Tue Jun 19 11:12:31 PDT 2007


At 13:17 -0400 6/19/07, Mark Des Cotes wrote:
>I'm not that familiar with Terminal (it intimidates me a bit) but  with good instructions I would give it a try.


In a terminal emulator I did this:

# begin a copy and paste from a terminal application
cd /Volumes/COMSOL\ Conf\ CD
ls -RlF

total 200
-r-xr-xr-x   1 root  wheel     48 10 Jan 09:05 autorun.inf*
dr-xr-xr-x   2 root  wheel   2048 10 Jan 09:05 booklet/
dr-xr-xr-x   2 root  wheel   2048 10 Jan 09:05 browser/
dr-xr-xr-x   4 root  wheel   2048 10 Jan 09:05 demonstration/
dr-xr-xr-x   3 root  wheel   2048 10 Jan 09:05 doc/
-r--r--r--   1 root  wheel   2382 10 Jan 09:07 index.html
dr-xr-xr-x  44 root  wheel   6144 10 Jan 09:05 keynotes/
dr-xr-xr-x  24 root  wheel   4096 10 Jan 09:07 papers/
-r-xr-xr-x   1 root  wheel  81920 10 Jan 09:05 startup.exe*

./booklet:
total 56590
-r-xr-xr-x  1 root  wheel  28974414 10 Jan 09:05 comsol_booklet.pdf*

./browser:
total 0
-r--r--r--  1 root  wheel  55 10 Jan 09:05 cbrowser.ini
# not the end but I didn't copy everything. There were a few thousand files.

I started by typing "cd(SPACE)" at the left end of a command line. Its the UNIX command to change directory.

I then used the mouse to drag the icon from a CD-ROM that happened to be in the reader onto the terminal window right after what I typed.  The terminal application took that as a request to place the path to the disk as text into my command. It also was smart enough to add two backslash characters which "escape" the spaces in the name of the disk. It also added an extra space at the end which is a bug and I had to remove it.  Sigh.

I then pressed RETURN to execute the command. Apple's Terminal.app will then show a new prompt waiting for another command - probably a % sign with some other stuff after it that shows the new directory. (You can change what it shows with a startup file for your selected UNIX shell but that comes later.)

I then typed ls -RlF (RETURN) and UNIX did the rest.  The result is text and can be copied into a spreadsheet or a text editor or spreadsheet to do what you want with it. "ls" must be lower case. It stands for "list".

The "switches" on the ls command are only three of the dozens of choices available.

The - is the introduction for most switches in UNIX.
The R (a capital) asks ls to delve recursively into the directory hierarchy.
The l ( a lower case ell) asks ls to produce a long listing with owner, group etc permissions, size, and date.
The F asks for a file type indicator after each name  * for executable, / for directory and the like.

You can save later effort by picking your options carefully. Use

man ls

to see what they are. The man tool produces paged output and you use the space bar to go from page to page and a "Q" when you're through. It's a bit of a pain and there are web sites that have all the UNIX man pages ready to view in a browser. Google is your friend on that. Personally I like BBEdit worksheets but that costs $$.
-- 

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.


More information about the X4U mailing list