File 什么是unix上的常规文件
我看到了的手册页 其中提到了以下内容File 什么是unix上的常规文件,file,unix,manpage,File,Unix,Manpage,我看到了的手册页 其中提到了以下内容 -e pathname True if pathname resolves to a file that exists. False if pathname cannot be resolved. -f pathname True if pathname resolves to a file that exists and is a regular file. False if pathname cannot be resolved, o
-e pathname
True if pathname resolves to a file that exists. False if pathname cannot be resolved.
-f pathname
True if pathname resolves to a file that exists and is a regular file. False if pathname cannot be resolved, or if pathname resolves to a file that exists but is not a regular file.
-f
标志表示
如果路径名解析为存在且为常规文件的文件,则为True
谁能告诉我什么是常规文件,什么不是常规文件。非常规文件是设备、管道、插座。。。例如,试试
[-f/dev/tty0]
。符号链接也是非规则的,但它们由test-f
解析。它们是文本或二进制数据,称为“常规文件”,以区别于目录、符号链接、套接字等其他类型
看看它不是目录、设备文件、块设备、FIFO或套接字。如果你做一个ls-l。以“-”开头的是文件。实际上,大多数人所指的只是一个文件