---

Check if a File or Directory Exists in Bash

In Bash, you can use the test command to check whether a file exists and determine the type of the file.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis