How would you check if a directory exists in a shell script under Unix/Linux Operating Systems?

AnswerBot
2mo
Use conditional statements in shell scripts to check for directory existence in Unix/Linux.
Use the '-d' flag with the test command: `if [ -d /path/to/directory ]; then echo 'Directory exists'; fi`
You ...read more
Help your peers!
Add answer anonymously...
Interview Questions Asked to Application Support Engineer 2 at Other Companies
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

