Timeline for How can I exclude . and .. when listing only hidden items?
Current License: CC BY-SA 4.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 30, 2020 at 23:06 | vote | accept | jonnybolton16 | ||
| May 29, 2020 at 13:56 | comment | added | ilkkachu |
@jonnybolton16, that extended glob version should work already, .!(|.) matches ..foo etc.
|
|
| May 29, 2020 at 13:28 | comment | added | jonnybolton16 |
you've appended ..?* onto the command for use without globs in order to capture ..foo. What would need to be apended on to the globs command to capture the same?
|
|
| May 29, 2020 at 13:22 | comment | added | ilkkachu | @jonnybolton16, sorry, I'm not sure how to parse that. The extension to what? | |
| May 29, 2020 at 11:20 | comment | added | jonnybolton16 |
@ilkkachu what would be the extension to the globs version to include ..?*
|
|
| May 28, 2020 at 12:34 | history | edited | ilkkachu | CC BY-SA 4.0 |
added 43 characters in body
|
| May 28, 2020 at 12:33 | comment | added | ilkkachu |
Note that .[!.]* misses things like ..foo or ...bar. They should be rare, but for completeness, you'd need to add ..?* (or .??*) as mentioned in A.B.:s answer.
|
|
| May 28, 2020 at 11:59 | history | edited | jonnybolton16 | CC BY-SA 4.0 |
added 45 characters in body
|
| May 28, 2020 at 11:58 | comment | added | jonnybolton16 | Ahh yes, it appears so. Will update | |
| May 28, 2020 at 11:26 | comment | added | Kusalananda♦ |
This seems to assume that you have set the extglob shell option in bash, right? ls -d .[!.]* wouldbe easier.
|
|
| May 28, 2020 at 11:25 | history | answered | jonnybolton16 | CC BY-SA 4.0 |