shell – 在unix中找到工作目录中的特定目录
发布时间:2020-12-15 22:08:21 所属栏目:安全 来源:网络整理
导读:我想检查当前工作目录中是否存在名为“name”的目录.可以用ls吗? ls -l | grep ^-d 只显示目录,但如何指定? 提前致谢 解决方法 One should never parse the output of ls.如果你正在使用bash,试试这个 if [ -d "$DIRECTORY" ]; then # will enter here if
我想检查当前工作目录中是否存在名为“name”的目录.可以用ls吗?
ls -l | grep ^-d 只显示目录,但如何指定? 提前致谢 解决方法
One should never parse the output of ls.如果你正在使用bash,试试这个
if [ -d "$DIRECTORY" ]; then # will enter here if $DIRECTORY exists. fi (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |