0

This question already has an answer here:

I'd like to list all files and folders that only have an extension, like .bashrc, .cache/, and so forth. This seems like it should be straightforward. When I try ls .*, I don't get the expected result:

jacob@jacob-Precision-Tower-3620:/home/jacob$ ls .*
.bash_history  .bash_logout  .bashrc  .ICEauthority  .profile

.:
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos

..:
jacob  lost+found

.cache:
event-sound-cache.tdb.d35b7efbc4794c7998a81437c01c41ec.x86_64-pc-linux-gnu  evolution  fontconfig  gnome-getting-started-docs  gnome-software  gstreamer-1.0  ibus  logrotate  media-art  thumbnails  totem  tracker  update-manager-core  upstart  yelp

.config:
dconf  evolution  gnome-session  goa-1.0  gtk-3.0  ibus  libaccounts-glib  nautilus  parcellite  pulse  totem  update-notifier  upstart  user-dirs.dirs  user-dirs.locale  yelp

.gconf:

.gnupg:
private-keys-v1.d  S.gpg-agent

.local:
share

.nano:

.nv:
GLCache```

marked as duplicate by steeldriver, Stephen Kitt, Community Mar 28 at 15:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

You can use ls -A, to show also hidden files (but not . and ..: to include thest you may use ls -a).

For your case: * is expanded by the shell, so ls will see some files and some directories. If a directory is put as argument, it will list the files on that directory. You may use ls -d * to force to list files in argument, and not to list files in the directories in the arguments. Note: ls -d .* is not much different from echo .* (but for some formatting).

Not the answer you're looking for? Browse other questions tagged or ask your own question.