Skip to content

Instantly share code, notes, and snippets.

@3rdp
Last active November 23, 2018 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3rdp/1955f504a44f2e7b9e510ffe6a7596ef to your computer and use it in GitHub Desktop.
Save 3rdp/1955f504a44f2e7b9e510ffe6a7596ef to your computer and use it in GitHub Desktop.
Answering @ikngtty's question about `***` wildcard in fish shell
box@0536908972a6 ~> mkdir -p important/very-important/this.fish
box@0536908972a6 ~> mkdir -p usual/not-interested.fish
box@0536908972a6 ~> rm important/very-important/this.fish/ -R
box@0536908972a6 ~> touch important/very-important/this.fish
box@0536908972a6 ~> touch test.fish
box@0536908972a6 ~> rm -R usual/not-interested.fish
box@0536908972a6 ~> touch usual/not-interested.fish
box@0536908972a6 ~> vim
# you may skip to the `ls ***/***.fish` example on 28 line
$
ls ***.fish
important/very-important/this.fish
test.fish
usual/not-interested.fish
$
ls ***important
important:
very-important
important/very-important:
this.fish
$
ls ***important/***.fish
important/very-important/this.fish
$
touch important/test.fish
$
ls ***important/***.fish
important/test.fish
important/very-important/this.fish
$
ls ***/***.fish
important/test.fish
important/very-important/this.fish
usual/not-interested.fish
# where is test.fish from working directory?
# logically, it's not there, because we asked for
# anything/anything.fish
# but...
# test.fish may be also accessed as
# ./test.fish
# . is a link to this directory
# .. as you may know is a link to parent directory
# so ***/***.fish may work...
# as **\/*.fish works in zsh shell
# but documentation warns you that it doesn't
# (work this way in fish shell)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment