Search code examples
gitdirectorygit-bashworking-directory

Show files in current directory using Git Bash?


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?


Solution

  • 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.