#!/bin/bash
#本脚本用来检测文件类型
read -ep "请输入要检测的文件路径:" file
if [ ! –e $file ];then
echo "文件不存在,请检查输入是否正确!"
elif [ -L $file ];then
echo "链接文件"
elif [ -d $file ];then
echo "目录"
elif [ -f $file ];then
echo "普通文件"
else
echo "其他文件类型"
fi
shell脚本-检测文件类型
最新推荐文章于 2021-08-26 14:31:16 发布