Search code examples
ubuntudirectorylsmkdirln

Problem with the number of links in a new directory in ubuntu terminal


I have create a new directory in ubuntu terminal on VirtualBox and with the command ls -ldi i saw that the number of linksis two even if the directory is empty. Can someone explain me why? This is an example: riccardo@riccardo-Virtualbox:~$mkdir newDir riccardo@riccardo-Virtualbox:~$ls -ldi newDir 1576810 drwxr-xr-x 2 riccardo riccardo 4096 apr 17 16:12 newDir


Solution

  • The number of links is 2 because the directory is linked to:

    .

    ..