位置: 编程技术 - 正文
-f 和-e的区别
Conditional Logic on Files
-a file exists.
-b file exists and is a block special file.
-c file exists and is a character special file.
-d file exists and is a directory.
-e file exists (just the same as -a).
-f file exists and is a regular file.
-g file exists and has its setgid(2) bit set.
-G file exists and has the same group ID as this process.
-k file exists and has its sticky bit set.
-L file exists and is a symbolic link.
-n string length is not zero.
-o Named option is set on.
-O file exists and is owned by the user ID of this process.
-p file exists and is a first in, first out (FIFO) special file or
named pipe.
-r file exists and is readable by the current process.
-s file exists and has a size greater than zero.
-S file exists and is a socket.
-t file descriptor number fildes is open and associated with a
terminal device.
-u file exists and has its setuid(2) bit set.
-w file exists and is writable by the current process.
-x file exists and is executable by the current process.
-z string length is zero.
是用 -s 还是用 -f 这个区别是很大的!
推荐整理分享判断文件是否存在的shell脚本代码(判断文件是否存在 java),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:判断文件是否存在的方法,判断文件是否存在的方法,判断文件是否存在 shell,判断文件是否存在 java,判断文件是否存在的方法,判断文件是否存在linux,判断文件是否存在 shell,判断文件是否存在的方法,内容如对您有帮助,希望把文章链接给更多的朋友!
linux shell中 if else以及大于、小于、等于逻辑表达式介绍 比如比较字符串、判断文件是否存在及是否可读等,通常用"[]"来表示条件测试。注意:这里的空格很重要。要确保方括号的空格。笔者就曾因为空格缺
获取两个日期间隔时间的shell脚本代码 #!/bin/sh#获取所在季度的第一天,到昨天的日期间隔#link:www.gimoo.net#date:/2/day=`date-d"1daysago""+%Y%m%d"`;year=`exprsubstr${day}`;month=`exprsubstr${day}`;s_date=$ye
神奇的shell命令行输入与输出功能介绍 标准输入/输出和重定向,Linux发行版FedoraCoreLinux,而RedHat公司原来RedHatLinux的开发团队也将继续参与这一发行版本的开发工作。标准输入与输出我们知道
标签: 判断文件是否存在 java
本文链接地址:https://www.jiuchutong.com/biancheng/376811.html 转载请保留说明!友情链接: 武汉网站建设