what is the purpose of dollar-sign in a git remove statement

delete-file, git

Solution

It's shell syntax, not part of `git`. The enclosed command is run, and the resulting output is used as the argument(s) for the primary command. That is, if `git ls-files -d` outputs `foo.txt` and `bar.txt`, your command is equivalent to

git rm foo.txt bar.txt

Problem

I have been looking for way to remove all of the deleted files (which I have deleted in my local file system) from my git repository. The command that I found is this: ``` git rm $(git ls-files -d) ``` This is the first time that I have seen $(...) in a git command. What does the $(...) do within this command?

Original source