test

Performs a file test.

The usage is as follows:

$ hadoop fs -test -[defswrz] URI
Arguments

-d

If the path is a directory, returns 0

-e

If the path exists, returns 0

-f

If the path is a file, returns 0

-s

If the path is not empty, returns 0

-s

If the path exists and write permission is granted, returns 0

-r

If the path exists and read permission is granted, returns 0

-z

If the file is zero length, returns 0

Example:

$ hadoop fs -test -e filename
Found a mistake? Seleсt text and press Ctrl+Enter to report it