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
By default, the width and height of the cell are ...
To achieve an effect similar to Windows forms, dr...
The cursor size in the input box is inconsistent T...
About semantics Semantics is the study of the rel...
Table of contents Preface No.1 A focus No.2 Extra...
Table of contents 1. Enter a value and return its...
Update: Now you can go to the MySQL official webs...
If a div sets background-color and background-ima...
Table of contents Preface 1. Less 2. Import your ...
Effect: The title has its own serial number, the ...
Introduction to CentOS CentOS is an enterprise-cl...
Transaction isolation level settings set global t...
Differences between Docker and Docker Machine Doc...
1. Download and install Download the community ed...
<br />In the first section of this series, w...