Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Globbing hidden files #12

Open
ghost opened this issue Apr 7, 2020 · 4 comments
Open

Globbing hidden files #12

ghost opened this issue Apr 7, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 7, 2020

Examples that use globbing such as Count files or directories in directory don't take into account files starting with a dot.

@defdefred
Copy link

exclude . & ..
$ count .[^.]* ..?* *
39
#include all files
$ count .* *
41

@chambln
Copy link
Contributor

chambln commented Aug 9, 2020

What is ..?* supposed to expand to? Is that not equivalent to ..*?

$ ls -a
.  ..  .hidden  visible
$ echo * .*
visible . .. .hidden
$ echo * .[^.]*
visible .hidden

@chambln
Copy link
Contributor

chambln commented Aug 9, 2020

Oh, I see: ..?* covers files that start with two dots (except ..). Very nice!

$ ls -a
.  ..  ..doubledot  .hidden  visible
$ echo * .*
visible . .. ..doubledot .hidden
$ echo * .[^.]* ..?*
visible .hidden ..doubledot

@chambln
Copy link
Contributor

chambln commented Aug 9, 2020

@dylanaraps Is this worth adding to the book somewhere? Either as a note in 'Count files or directories in directory' or a section dedicated to globbing tricks?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants