-Re: What is the command to see if a file is a directory or not in HDFS from bash?
The result is reported in the shell exit code, not as a textual output
from the command, just like the UNIX /usr/bin/test command.
The intended use case is something like the following Bourne/bash shell example:
if test -d /opt; then
... install in /opt
... install in /usr
or using the /usr/bin/[ synonym available on most systems,
if [ -d /opt ]; then ...
if hadoop dfs -test -e something.txt; then
echo "something.txt exists on hdfs"
echo "something.txt does not exist on hdfs"
On Mon, Oct 22, 2012 at 2:09 AM, Pedro Sá da Costa <[EMAIL PROTECTED]> wrote:
> I execute 'hadoop-1.0.3/bin/hadoop dfs -test -d
> /user/xeon/gutenberg/A.txt' command in the bash, and I was expecting
> getting the value 0 or 1, but I got nothing.
> What is the command to launch from the bash that allows to check if a
> file in HDFS is a file or directory?
> Best regards,