What does -f mean in bash What does -f mean in bash bash bash

What does -f mean in bash


Google is useless in this case because searching for flags is useless

Fortunately, the Bash Reference Manual is available online, at http://www.gnu.org/software/bash/manual/bashref.html. It's the first hit when you Google for "Bash manual". ยง6.4 "Bash Conditional Expressions" says:

-f file

True if file exists and is a regular file.


-f - file is a regular file (not a directory or device file)

Check this out for all file test operators:http://tldp.org/LDP/abs/html/fto.html


The [ is the same as the command test which allows you to test certain things. Try help test to find out what the flags are. Things to be careful with are spaces - the [ needs a space after it.