dy ................ Stat files and emit a one-line record for each file. Synopsis: dy [options] [filelist] "dy" is like the bastard child of "ls" and "du" (think du with a little extra). It will traverse the given files (or all files in PWD if no files are specified), recursively descending through directories if any, and emit a one-line summary of information about each file. Output is intended to be easily machine-readable first, and human-readable a distant second. Several utilities have been written to operate upon dy output, including some described in this document. By default, "dy" emits the file's mtime, size, "type" (x for executable, f for ordinary file, d for directory, l for symlink, etc), permissions, the owning userid, number of hard links, and pathname. There are many options for changing these fields and adding more fields. Example of default output: ttk@workstation20:~/tools/ttk> mkdir foo ttk@workstation20:~/tools/ttk> mkdir foo/bar1 ttk@workstation20:~/tools/ttk> mkdir foo/bar2 ttk@workstation20:~/tools/ttk> mkdir foo/bar2/bar3 ttk@workstation20:~/tools/ttk> ln -s foo/bar2/bar3 foo/bar1/fake ttk@workstation20:~/tools/ttk> cp /usr/dict/words foo/bar1/words ttk@workstation20:~/tools/ttk> dy foo 2006-01-26 19:02:28 4 d 755 1000 4 foo/ 2006-01-26 19:02:40 4 d 755 1000 2 foo/bar1/ 1969-12-31 16:00:00 0 l 777 0 1 foo/bar1/fake 2006-01-26 19:09:18 353 f 644 1000 1 foo/bar1/words 2006-01-26 19:02:33 4 d 755 1000 3 foo/bar2/ 2006-01-26 19:02:33 4 d 755 1000 2 foo/bar2/bar3/ Options: -b ................... express file sizes in bytes rather than kilobytes. -a ................... synonym for -b (to reuse the "du -a" muscle-memory). -min ................. generates shorter output, equal to "-tx -nox -noperms -nouid -nolink" -md5 ................. generate an md5 checksum for each normal file (not symlinks, directories, sockets, fifos, or devices) and display as hexadecimal. -md5-size=SIZE ....... only generate md5 checksums for files smaller than or equal to SIZE (default: no limit). -md5-only=REGEX ...... only generate md5 checksums for files whose pathnames match REGEX (this option may be specified multiple times, and files which match any specified REGEX will be checksummed). -md5-no=REGEX ........ do not generate md5 checksums for files whose pathnames match REGEX (this option may be specified multiple times, and files which match any specified REGEX will not be checksummed). -md5-lvl=SIZE ........ filesize above which external md5sum utility will be used to calculate md5 checksum (default: 10MB). -md5-len=LENGTH ...... display only last LENGTH characters of md5 checksum (default 32). -pad-md5-time=N ...... sleep for N seconds after md5'ing a file which took more than 1 second to md5. -pad-md5-time=N[%|p] . sleep for some number of seconds after md5'ing a file which took more than 1 second to md5, expressed as a fraction of time taken to generate checksum (example: -pad-md5-time=200p sleeps for twice as long as it took to checksum). -maxdepth=DEPTH ...... maximum nested directory depth to recurse (default: 200). -td .................. express file mtime as a decimal time_t (seconds since epoch). -dtime, -dectime ..... synonyms for "-td". -tx .................. express file mtime as a hexadecimal time_t (seconds since epoch). -xtime, -hextime ..... synonyms for "-tx". -i ................... also display inode number (in hex). -inode, -inodes ...... synonyms for "-i". -noperms ............. do not display permissions. -nouid ............... do not display owner's user id. -nolink .............. do not display hard link count. -nox ................. display files of type "x" as "f" instead (simplifies some parsing). Example of output with some arguments: ttk@workstation20:~/tools/ttk> dy -a -md5 -td -i -nolink -nouid foo 1138330948 4096 d -------------------------------- 755 0308C0AE foo/ 1138331358 4096 d -------------------------------- 755 03128093 foo/bar1/ 0 0 l -------------------------------- 777 00000000 foo/bar1/fake 1138331358 352846 f 702b984c2dadb8d1c404ee926514971b 644 03128095 foo/bar1/words 1138330953 4096 d -------------------------------- 755 031CC046 foo/bar2/ 1138330953 4096 d -------------------------------- 755 031F8080 foo/bar2/bar3/ "dy" has some bugs, most of them having to do with symlinks and small formatting glitches, but nothing that has gotten in the way of my using it at the Archive so far (so I keep putting off fixing it). NOTE: -md5-only and -md5-no regular expressions may be any perl regular expression, but dots are escaped (so -md5-only=.arc.gz will match foo.arc.gz, but not marc-gzip.txt). NOTE: "doublecheck", "about_item.pl", and "mk_items_list.pl" either use "dy" directly or expect dy-formatted input.