Bash globbing - autoexpand for a few specific cases?

前端 未结 6 1109
半阙折子戏
半阙折子戏 2020-12-29 13:05

I understand that the wildcard * (by itself) will expand in such a way that it means \"all non-hidden files in the current folder\" with hidden files being thos

6条回答
  •  醉梦人生
    2020-12-29 14:08

    To meet your first case:

    echo {.,}[^.]*
    

    or

    echo {.,}[!.]*
    

    Edit:

    This one seems to get everything, but is shorter than ephemient's

    echo {.*,}[^.]*
    

提交回复
热议问题