如何删除不同目录中的某些文件而不用每次都输入目录?

如何删除不同目录中的某些文件而不用每次都输入目录?
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    deleted:    Assignment_3/Apriori/bodon_trie.pdf
    deleted:    Assignment_3/Apriori/farhanSir.pdf
    deleted:    Assignment_3/Apriori/output.txt~
    deleted:    Assignment_4/Comparision/report.aux
    deleted:    Assignment_4/Comparision/report.log
    deleted:    Assignment_4/FPGrowth/FPGrowth.class
    deleted:    Assignment_4/FPGrowth/FPGrowthApplication.class
    deleted:    Assignment_4/FPGrowth/Node.class
    deleted:    Assignment_4/FPGrowth/Result.class

这是的输出git status。我想使用从 git 缓存中删除它,但git rm --cache Assignment_3/Apriori/boden_trie.pdf ?/farhanSir.pdf我不想Assignment_3/Apriori为每个文件都输入。

答案1

使用Bash 括号扩展

git rm --cache Assignment_3/Apriori/{boden_trie.pdf,farhanSir.pdf}

答案2

您可以安装 bleachbit,它有一个删除文件或文件夹的选项。

sudo apt-get install bleachbit

相关内容