$ ls -a
. .cache final .lesshst .pki
.sh_history .wget-hsts
.. .config .gnome .local .presage
.sudo_as_admin_successful .Xauthority
.audacity-data .dbus .gnupg .mozilla .profile
Templates .xscreensaver
.bash_history Desktop .gphoto Music Public 'Unix
programs' .xsession-errors
.bash_logout Documents .idlerc .password-store .python_history Videos
.bashrc Downloads 'Ise notes' Pictures scripts
.viminfo
$ ls -A
.audacity-data .config final 'Ise notes' .password-store Public
Templates .Xauthority
.bash_history .dbus .gnome .lesshst Pictures .python_history
'Unix programs' .xscreensaver
.bash_logout Desktop .gnupg .local .pki scripts
Videos .xsession-errors
.bashrc Documents .gphoto .mozilla .presage .sh_history
.viminfo
.cache Downloads .idlerc Music .profile
.sudo_as_admin_successful .wget-hsts
答案1
两者都打印所有文件和目录,包括隐藏的文件和目录(以点开头的文件和目录),唯一的区别是-A
不打印.
当前..
目录和父目录。看ls 手册页更多细节:
-a,--全部
不要忽略以 . 开头的条目。
-A, --几乎所有
不列出暗示。和 ..