Show files in current directory using Git Bash?

kxc picture kxc · Feb 26, 2015 · Viewed 74.1k times · Source

How can I check files in current directory, from git bash? Like command dir, in Windows cmd ?

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?

Answer

ArchiFloyd picture ArchiFloyd · Feb 26, 2015

The git bash is basically a Unix shell, therefore you can list current files and directories with the ls command

You can also use ls -a to show hidden files and folders.

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.