Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 什么是unix上的常规文件_File_Unix_Manpage - Fatal编程技术网

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。以“-”开头的是文件。实际上,大多数人所指的只是一个文件