IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

shell 判断文件夹或文件是否存在

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

·判断文件夹是否存在

1

2

3

4

5

if [ -d “/data/” ];then

echo 文件夹存在

else

echo 文件夹不存在

fi

·判断文件是否存在

1

2

3

4

5

if [ -f “/data/filename” ];then

echo 文件存在

else

echo 文件不存在

fi

·判断file1是否比file2新

1

2

3

4

5

if [ “/data/file1” -nt “/data/file2” ]

echo “file1更新

else

echo “file2更新

fi

·基本参数

-e

判断对象是否存在

-d

判断对象是否存在,并且为目录

-f

判断对象是否存在,并且为常规文件

-L

判断对象是否存在,并且为符号链接

-h

判断对象是否存在,并且为软链接

-s

判断对象是否存在,并且长度不为0

-r

判断对象是否存在,并且可读

-w

判断对象是否存在,并且可写

-x

判断对象是否存在,并且可执行

-O

判断对象是否存在,并且属于当前用户

-G

判断对象是否存在,并且属于当前用户组

-nt

判断file1是否比file2新

-ot

判断file1是否比file2旧 [ “/data/file1” -ot “/data/file2” ]

文章永久链接:https://tech.souyunku.com/?p=37285


Warning: A non-numeric value encountered in /data/wangzhan/tech.souyunku.com.wp/wp-content/themes/dux/functions-theme.php on line 1154
赞(61) 打赏



未经允许不得转载:搜云库技术团队 » shell 判断文件夹或文件是否存在

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码
IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

评论 抢沙发

大前端WP主题 更专业 更方便

联系我们联系我们

觉得文章有用就打赏一下文章作者

微信扫一扫打赏

微信扫一扫打赏


Fatal error: Uncaught Exception: Cache directory not writable. Comet Cache needs this directory please: `/data/wangzhan/tech.souyunku.com.wp/wp-content/cache/comet-cache/cache/https/tech-souyunku-com/index.q`. Set permissions to `755` or higher; `777` might be needed in some cases. in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php:367 Stack trace: #0 [internal function]: WebSharks\CometCache\Classes\AdvancedCache->outputBufferCallbackHandler() #1 /data/wangzhan/tech.souyunku.com.wp/wp-includes/functions.php(5109): ob_end_flush() #2 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(303): wp_ob_end_flush_all() #3 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #4 /data/wangzhan/tech.souyunku.com.wp/wp-includes/plugin.php(470): WP_Hook->do_action() #5 /data/wangzhan/tech.souyunku.com.wp/wp-includes/load.php(1097): do_action() #6 [internal function]: shutdown_action_hook() #7 {main} thrown in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php on line 367