A question for ls
command.
root@cqcloud script]# ls /var/www/html -la
total 36
drwxr-xr-x 9 root root 4096 Aug 31 01:12 .
drwxr-xr-x 7 root root 4096 Aug 31 01:10 ..
drwxr-xr-x 2 root root 4096 Aug 26 04:07 cmd
drwxr-xr-x 5 root root 4096 Jul 3 10:07 cn.fnmili.com
drwxr-xr-x 7 root root 4096 Aug 30 11:42 internal
drwxr-xr-x 3 root root 4096 Jul 25 02:03 node
drwxr-xr-x 4 root root 4096 Jul 11 01:26 sandbox
drwxr-xr-x 13 root root 4096 Aug 26 03:45 tpshop
drwxr-xr-x 2 root root 4096 Aug 31 01:12 trash
[root@cqcloud script]# ls /var/www/html/cmd -la
total 16
drwxr-xr-x 2 root root 4096 Aug 26 04:07 .
drwxr-xr-x 9 root root 4096 Aug 31 01:12 ..
-rw-r--r-- 1 root root 52 Aug 26 04:07 .htaccess
-rw-r--r-- 1 root root 73 Aug 26 04:02 df.php
You can see that the cmd
folder has a link count of 2, but it actually has 4 links, including 2 files, .
and ..
folder. Can anyone explain why?
/var/www/html
has only one subdirectory? – Kusalananda Aug 30 '17 at 18:05