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
31 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
• 25,360 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
38 views
0 votes
11 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,310 points
154 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
• 25,360 points
71 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,730 points
3,379 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
16,869 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,260 points
1,231 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
• 25,360 points
34 views