如何让“ls”在排序项目时停止忽略“.”?

如何让“ls”在排序项目时停止忽略“.”?

当触发时,ls -alhF我看到.ssh被放置在ssl列表附近而不是顶部。我怎样才能ls将文件和文件夹排序为“本机”(又名.ssh/then abd-dir/then ssl/dir)

[centos@ip-172-31-46-255 ~]$ ls -alhF
total 88M
drwx------. 17 centos centos 4.0K Feb 17 15:18 ./
drwxr-xr-x.  3 root   root     20 Nov 18 16:31 ../
-rw-rw-r--.  1 centos centos 8.9M Mar 19  2016 apache-tomcat-8.0.33.tar.gz
-rw-------.  1 centos centos  21K Feb 17 11:38 .bash_history
-rw-r--r--.  1 centos centos   18 Oct 31  2018 .bash_logout
-rw-r--r--.  1 centos centos  295 Nov 18 22:22 .bash_profile
-rw-r--r--.  1 centos centos  231 Oct 31  2018 .bashrc
drwx------.  4 centos centos   37 Nov 19 00:54 .config/
drwxrwxr-x.  2 centos centos   28 Dec 11 15:41 cronjob/
drwxrwxr-x.  8 centos centos  139 Dec 13 09:28 deploy/
drwxrwxr-x.  5 centos centos  106 Feb 17 15:18 dotfiles/
-rw-r--r--.  1 root   root    27M May 16  2018 elasticsearch-2.3.1.deb
-rw-r--r--.  1 root   root    26M May 16  2018 elasticsearch-2.4.6.deb
-rw-r--r--.  1 root   root    26M May 16  2018 elasticsearch-2.4.6.rpm
drwxrwxr-x.  3 centos centos   19 Nov 27 23:44 .java/
-rw-rw-r--.  1 centos centos  26K Apr 25  2019 mysql80-community-release-el7-3.noarch.rpm
drwxrwxr-x.  4 centos centos   31 Dec  3 07:54 nginx/
drwxrwxr-x.  3 centos centos   20 Nov 19 01:18 .node-gyp/
-rw-------.  1 centos centos   17 Nov 19 01:16 .node_repl_history
drwxrwxr-x.  7 centos centos  119 Nov 27 23:01 .npm/
drwxrwxr-x.  5 centos centos   74 Feb 17 10:36 .nvm/
drwxrwxr-x. 17 centos centos 4.0K Feb 15 10:06 om_app/
drwxrw----.  3 centos centos   19 Nov 18 22:20 .pki/
drwxrwxr-x.  5 centos centos  199 Feb 15 10:07 .pm2/
-rw-------.  1 centos centos  449 Dec 12 12:00 .rediscli_history
-rw-------.  1 centos centos 1.0K Nov 29 10:44 .rnd
drwx------.  2 centos centos   29 Nov 18 16:31 .ssh/
drwxr-x---.  3 centos centos  203 Dec  3 07:34 ssl/
drwxr-xr-x.  2 centos centos   24 Feb 17 10:05 .vim/
-rw-------.  1 centos centos 5.8K Feb 17 15:18 .viminfo

答案1

使用不对不同字符类应用权重的排序规则,例如C仅按字符位置排序的排序规则:

LC_ALL=C ls -alhF

相关内容