使用 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屋!