paulwong

          linux shell 中檢查文件夾是否存在

          To check if a directory exists in a shell script, you can use the following:
          if [ -d "$DIRECTORY" ]; then
            # Control will enter here if $DIRECTORY exists.
          fi

          Or to check if a directory doesn't exist:
          if [ ! -d "$DIRECTORY" ]; then
            # Control will enter here if $DIRECTORY doesn't exist.
          fi

          posted on 2020-09-25 11:11 paulwong 閱讀(386) 評論(0)  編輯  收藏 所屬分類: LINUXLINUX-SHELL

          主站蜘蛛池模板: 舟曲县| 淳化县| 从江县| 介休市| 札达县| 玉田县| 溆浦县| 中超| 通化县| 织金县| 曲沃县| 即墨市| 那坡县| 固原市| 本溪市| 新宾| 黑山县| 乌鲁木齐县| 阳原县| 阿尔山市| 宁津县| 诏安县| 怀来县| 饶阳县| 金堂县| 喜德县| 龙江县| 抚顺市| 涪陵区| 忻城县| 金山区| 张北县| 霞浦县| 九寨沟县| 福州市| 宁陕县| 庄河市| 胶州市| 泸州市| 古浪县| 任丘市|