Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 13
    Another more common alternative: .??* This will include digits and other signs which may end up in file names :) Commented Mar 26, 2015 at 14:03
  • 2
    .??* misses any single character name dot files; e.g. .a. Admittedly such would be unlikely to exist, but it's worth pointing out. Commented Mar 26, 2015 at 14:36
  • 20
    Why not just use .[^.]*? Commented Mar 26, 2015 at 18:08
  • 6
    This doesn't get files with names like ...... Commented Mar 27, 2015 at 2:45
  • 1
    @trlkly: 1. POSIX regexes are different from (say) Perl-style ones. 2. But [^.] does have the appropriate meaning in a POSIX regex. 3. But POSIX filename-expansion doesn't use the same rules as POSIX regex. (If it did, then .* would mean "zero or more characters" rather than "a dot, plus zero or more characters".) 4. And in POSIX filename-expansion, you have to write [! rather than [^ -- the meaning of the latter is unspecified. 5. But the question specifically calls out Bash, not a generic POSIX shell, and Bash filename-expansion does support [^ as equivalent to [!. Commented Mar 28, 2015 at 2:02