0

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```

1 Answers1

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).