使用Git Bash显示当前目录中的文件? [英] Show files in current directory using Git Bash?
问题描述
如何从git bash检查当前目录中的文件?
像命令 dir
,在Windows中 cmd
吗?
How can I check files in current directory, from git bash?
Like command dir
, in Windows cmd
?
我找到了一个命令 git ls-files
,但是它仅适用于git存储库文件。但是,如果我通过驱动器C:\导航,并且想要查看当前目录中的文件,该如何在git bash中实现呢?
I found a command git ls-files
, but it's work only with git repository files. But if I navegate through drive C:\, and want to see files in current directory, how can I do that in git bash?
推荐答案
git bash本质上是Unix shell,因此您可以使用 ls
命令列出当前文件和目录
The git bash is basically a Unix shell, therefore you can list current files and directories with the ls
command
您还可以使用 ls -a
显示隐藏的文件和文件夹。
You can also use ls -a
to show hidden files and folders.
由于它是Unix Shell,您可以在.bashrc文件中创建一个名为 dir
的别名。在Windows上使用时非常方便,这样您就不必记住用于列出目录的Linux和Windows命令。
Since it is a Unix shell, you can make an alias called dir
in a .bashrc file. It's handy when you are on windows, such that you don't have to remember both the Linux and the Windows command for listing directories.
这篇关于使用Git Bash显示当前目录中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!