Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #236366

Re: "ls -d" OK, but not "ls"

From Vincent Lefevre <vincent@vinc17.net>
Newsgroups linux.debian.user
Subject Re: "ls -d" OK, but not "ls"
Date 2021-06-23 16:30 +0200
Message-ID <Ctc38-7qI-9@gated-at.bofh.it> (permalink)
References <CtbJM-7kC-7@gated-at.bofh.it> <CtbTr-7nE-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2021-06-23 10:11:57 -0400, The Wanderer wrote:
> On 2021-06-23 at 09:59, Vincent Lefevre wrote:
> 
> > On a Debian GNU/Linux 10 (buster) machine:
> > 
> > $ ls -ld /etc/systemd
> > drwxr-xr-x 3 root root 0 2021-04-19 09:40:41 /etc/systemd
> > $ ls /etc/systemd
> > ls: cannot open directory '/etc/systemd': No such file or directory
> > 
> > Any explanation???
> 
> On a non-systemd machine, I get:
> 
> $ ls -ld /etc/systemd/
> drwxr-xr-x 4 root root 4096 Jul 23  2019 /etc/systemd/
> $ ls /etc/systemd/
> system  user
> 
> It seems possible that the 4 vs. 3 may be notable.
> 
> An empty directory will normally report 2: the '.' link from inside it,
> and the named link from the parent directory. 4 here reflects the two
> '..' links from the two visible subdirectories; 3 would indicate that
> one of those four links is missing on your system, and depending on
> which one that is, it seems possible that that could lead to misbehaviors.

These are systemd machines, and on the other machines on the network,
I get 6.

> It could be useful to check on this with other tools. For a start, what
> does
> 
> $ stat /etc/systemd/
> 
> report?

  File: /etc/systemd/
  Size: 0               Blocks: 8          IO Block: 4096   directory
Device: 17h/23d Inode: 118         Links: 3
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-04-19 09:40:10.717284464 +0200
Modify: 2021-04-19 09:40:41.893170056 +0200
Change: 2021-04-19 09:40:41.941169879 +0200
 Birth: -

The number of links is indeed strange.

I also suppose that the size should not be 0.

> Also, my first thought was to verify that ls is running the way you
> think it is. What do the following commands give you?
> 
> $ type ls
> $ echo $LS_DEFAULT_OPTIONS

$ type ls
ls is /bin/ls
$ echo $LS_DEFAULT_OPTIONS

$ 

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

"ls -d" OK, but not "ls" Vincent Lefevre <vincent@vinc17.net> - 2021-06-23 16:10 +0200
  Re: "ls -d" OK, but not "ls" Roberto C. Sánchez <roberto@debian.org> - 2021-06-23 16:20 +0200
    Re: "ls -d" OK, but not "ls" Vincent Lefevre <vincent@vinc17.net> - 2021-06-23 16:20 +0200
  Re: "ls -d" OK, but not "ls" The Wanderer <wanderer@fastmail.fm> - 2021-06-23 16:20 +0200
    Re: "ls -d" OK, but not "ls" Vincent Lefevre <vincent@vinc17.net> - 2021-06-23 16:30 +0200
      Re: "ls -d" OK, but not "ls" The Wanderer <wanderer@fastmail.fm> - 2021-06-23 16:50 +0200
      Re: "ls -d" OK, but not "ls" Vincent Lefevre <vincent@vinc17.net> - 2021-06-23 16:50 +0200
        Re: "ls -d" OK, but not "ls" Nicolas George <george@nsup.org> - 2021-06-23 16:50 +0200
  Re: "ls -d" OK, but not "ls" Greg Wooledge <greg@wooledge.org> - 2021-06-23 16:30 +0200
    Re: "ls -d" OK, but not "ls" Vincent Lefevre <vincent@vinc17.net> - 2021-06-23 16:50 +0200
      Re: "ls -d" OK, but not "ls" Andrei POPESCU <andreimpopescu@gmail.com> - 2021-06-23 20:30 +0200
        Re: "ls -d" OK, but not "ls" Vincent Lefevre <vincent@vinc17.net> - 2021-06-23 22:50 +0200
          Re: "ls -d" OK, but not "ls" Vincent Lefevre <vincent@vinc17.net> - 2021-06-25 12:40 +0200
  Re: "ls -d" OK, but not "ls" Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2021-06-23 19:30 +0200

csiph-web