How to use if in Linux to determine whether a directory exists Here’s how: 1. How to use if in the script to determine whether a directory exists #!/bin/bash if [ -d "c" ];then echo "directory c exists" else echo "directory does not exist" fi 2. Simple writing #!/bin/bash [ -d "c" ] && echo "Directory c exists" # or [ -d "d" ] || echo "Directory d does not exist" More judgment formats are as follows:
This concludes this article on how to use if in Linux to determine whether a directory exists. For more information on how to use if in Linux to determine whether a directory exists, please search for previous articles on 123WORDPRESS.COM or continue browsing the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Several common methods of sending requests using axios in React
>>: Detailed explanation of how to connect Java to Mysql version 8.0.18
(?i) means do not match case. Replace all uppercas...
This article shares the specific implementation c...
As shown below: def test_write(self): fields=[] f...
Table of contents 1. Introduction to PXC 1.1 Intr...
This article example shares the specific code of ...
Copy code The code is as follows: <!DOCTYPE ht...
1. Installation steps for MySQL 8.0.12 version. 1...
This article uses examples to illustrate common b...
Environment: CentOS 7.1.1503 Minimum Installation...
transform and translate Transform refers to trans...
MySQL error: Error code: 1293 Incorrect table def...
At work, we often need remote servers and often e...
The problem is as follows: I entered the command ...
Table of contents Previous words Synchronous and ...
1. ROW_NUMBER() Definition: The ROW_NUMBER() func...