Git bash - 在当前目录中显示文件 [英] Git bash - show files in current directory
问题描述
如何从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屋!