Skip to content

coreutils ls -alg result differs from /usr/bin/ls -alg #11831

@yangyingchao

Description

@yangyingchao

/usr/bin/ls -alg gives:

$ /usr/bin/ls -alg        
总计 13716
drwxr-xr-x 1 yyc       94  4月15日 17:38  .
drwxr-xr-x 1 yyc     1958  4月15日 17:38  ..
-rw-r--r-- 1 yyc        0  4月15日 17:38 '#asdf'
-rwxr-xr-x 1 yyc 14012880  4月 7日 04:44  coreutils
-rw-r--r-- 1 yyc     1056  4月 7日 04:44  LICENSE
-rw-r--r-- 1 yyc     9245  4月 7日 04:44  README.md
-rw-r--r-- 1 yyc     1159  4月 7日 04:44  README.package.md

while coreutils ls -alg givess:

$ ./coreutils ls -alg                                      
total 13716
-rw-r--r-- 1 yyc        0 Apr 15 17:38 '#asdf'
drwxr-xr-x 1 yyc       94 Apr 15 17:38  .
drwxr-xr-x 1 yyc     1958 Apr 15 17:38  ..
-rw-r--r-- 1 yyc     1056 Apr  7 04:44  LICENSE
-rw-r--r-- 1 yyc     9245 Apr  7 04:44  README.md
-rw-r--r-- 1 yyc     1159 Apr  7 04:44  README.package.md
-rwxr-xr-x 1 yyc 14012880 Apr  7 04:44  coreutils
                                                                                                             ```

Seems `/usr/bin/ls` ensures two items always be "." && ".."

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions