利用 bash 檢查檔案是否存

在 Linux 中,可以透過  bash  script 檢查檔案是否存在,範例如下:

if [ -f testfile ]
then
echo testfile exists!
fi


 資料來源:Determine if file exists in a Bourne/bash shell script - Tech-Recipes.com

留言

這個網誌中的熱門文章

基礎英文 850 字

在 Chromebook 上使用嘸蝦米輸入法簡介

User-friendly