ls on symlinked directories

Denis Vlasenko vda.linux at googlemail.com
Tue Feb 27 19:23:43 UTC 2007


On Tuesday 27 February 2007 16:52, Alexander Kriegisch wrote:
> This might be a classical question which has been answered here before.
> If so, I apologise.
> 
> There are a few known bugs in coreutils/ls.c which have been documented,
> but not tackled for years. I am speaking of these:
> 
> >  * KNOWN BUGS:
> >  * 1. ls -l of a directory doesn't give "total <blocks>" header

Indeed (/usr/bin/ls is from coreutils-6.3):

# ls -l /sys
drwxr-xr-x   29 root     root            0 Feb 27 17:56 block
drwxr-xr-x   11 root     root            0 Feb 27 17:56 bus
drwxr-xr-x   22 root     root            0 Feb 27 17:56 class
drwxr-xr-x    7 root     root            0 Feb 27 18:56 devices
drwxr-xr-x    3 root     root            0 Feb 27 18:56 firmware
drwxr-xr-x    2 root     root            0 Feb 27 18:56 fs
drwxr-xr-x    3 root     root            0 Feb 27 18:56 kernel
drwxr-xr-x   50 root     root            0 Feb 27 17:57 module
drwxr-xr-x    2 root     root            0 Feb 27 18:56 power
# /usr/bin/ls -l /sys
total 0
drwxr-xr-x 29 root root 0 2007-02-27 17:56 block
drwxr-xr-x 11 root root 0 2007-02-27 17:56 bus
drwxr-xr-x 22 root root 0 2007-02-27 17:56 class
drwxr-xr-x  7 root root 0 2007-02-27 18:56 devices
drwxr-xr-x  3 root root 0 2007-02-27 18:56 firmware
drwxr-xr-x  2 root root 0 2007-02-27 18:56 fs
drwxr-xr-x  3 root root 0 2007-02-27 18:56 kernel
drwxr-xr-x 50 root root 0 2007-02-27 17:57 module
drwxr-xr-x  2 root root 0 2007-02-27 18:56 power

But I don't miss this feature. Is it a real problem?

> >  * 2. ls of a symlink to a directory doesn't list directory contents

Coreutils doesn't do it either:

# ls -l /etc
lrwxrwxrwx    1 root     root           11 May 21  2006 /etc -> /.local/etc
# /usr/bin/ls -l /etc
lrwxrwxrwx 1 root root 11 2006-05-21 22:08 /etc -> /.local/etc

(hmmm.... I like coreutils' ISO date/time!)

> >  * 3. hidden files can make column width too large

Can you elaborate on #3?
--
vda



More information about the busybox mailing list