Multiple choice technology operating systems

if[ -f filename ]

  1. checks for the existence of a file

  2. checks for existence of a directory

  3. checks for read permission on a file

  4. checks for write permission on a file

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The -f test operator checks whether a file exists AND is a regular file (not a directory or device). In shell scripting, [ -f filename ] returns true only if the specified path is an existing regular file.