d is an alternative to ls's long format output. The difference is that d's output is optimized to maximize the amount of space for the file's name on the right side of the line. d's output adds somewhere from 12 to 22 characters for the filename by "squeezing" the output on the left.
d's output is different from ls in several ways. First, the inode is not printed. Second, the first character of the access permissions sequence is not printed. Instead, that information is color coded into the filename itself or a symbol is used with the name. For example, a '/' is always appended to a directory so you can recognize directories even without colorized output. A '-' is prepended to pipes and a '=' is prepended to sockets, in addition to being able colorize these file types. Third, the user/group ownership names are squeezed together and only a minimum amount of space is reserved for them based on the size of the longest name used. d is especially useful if you use short user names on your system. Finally, the file size is converted to a short human-readable format with a kilobyte, megabyte, or gigabyte indicator (K, M, G), similar to the human-readable option for ls, and is then squeezed as well.
d has the essential command line options like options to sort the output for example. The only ones not like any option for ls
is the --dirs-first option which always prints subdirectories ahead of files (ala Midnight Commander's display), and
--tree and --tree-ascii which print output in a tree format similar to the tree command.
d has a configuration file where all options, including how to colorize things, is made available in a fairly easy to read
format. Users can have their own configuration file which overrides the system file.
Well, first, I wanted to practice my C++ skills. :-) Second, I was getting increasingly annoyed by ls's long
format's verbose output and wasted space on the left (my user name is 'ed' on my system, just 2 characters, so there were gaping
holes in the output of ls on the left). Third, I wanted a --dirs-first option for ls, but my submitted patch to
add that feature was ignored. So in the end, I felt compelled to write my own version of ls.
d is written with an emphasis on readability, so it is not optimized for speed, and since its written in C++, its executable
won't be as small or fast as ls. Using the time program to compare, d is roughly 3 times slower and its executable is nearly three times as large as ls. Now having said that, consider that "3 times slower" still amounts to a very small fraction of a second
(0.245s to list my /usr/bin with ~800 files) and "3 times larger" means only an extra ~80k of disk space. Essentially, on a
typical modern machine, you won't see a noticable difference between d and ls. So as long as you are running something better
than a first generation Pentium, and you aren't using directories with thousands of files, d will be "fast enough".
If you find a bug in d, you can contact me via email at ecogburn@xtn.net. Please try to be as informative as possible in your email, including the version of d, input to d that causes the problem and the output that d produces with that input. I am much more likely to be able to fix the bug if I can reproduce it myself. An email which basically says "It don't work!" isn't enough, and will likely get ignored.
Comments, suggestions, and constructive criticism are welcome.
I am more than willing to help anyone trying to get d working on other systems. To my knowledge d doesn't do anything that ls doesn't do, and I tried to write it using only standard C++, so getting d working on other unix-like systems besides Linux is certainly possible.
The most recent version of d is always available from this webpage, just click HERE.
d is released under the GNU GPL License, version 2. Read the file COPYING in the package for details.