How to check the directory is present in shell script or not?

0 votes
Can anyone suggest which command can be use to check the directory is present in shell script or not?
Jun 24 in Big Data Hadoop by Mugdha
14 views

1 answer to this question.

0 votes

Hi,

To check the directory is present in the shell script, you can use the following solution below:

if [ -d "$DIRECTORY" ]; then
# Control will enter here if $DIRECTORY exists.
fi

I hope it will work.

answered Jun 24 by Gitika
• 19,720 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to write examples to test whether the installation is validated or not?

You have some example jars in your ...READ MORE

answered Sep 5, 2018 in Big Data Hadoop by Frankie
• 9,810 points
24 views
0 votes
10 answers
0 votes
1 answer

How can I use my host machine’s web browser to check my HDFS services running in the VM?

The sole purpose of the virtual machine ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by Shubham
• 13,190 points
105 views
0 votes
1 answer

What is grunt shell in pig?

Hey, Grunt shell is a shell command.The Grunts ...READ MORE

answered May 6 in Big Data Hadoop by Gitika
• 19,720 points
27 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,110 points
2,056 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
10,519 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,240 points
768 views
0 votes
1 answer

How to see MySql service is running or not using linux command?

This is the command you can use ...READ MORE

answered Apr 15 in Big Data Hadoop by Gitika
• 19,720 points
21 views