如何显示目录中的管道文件或存储文件?
echo "give name of directory: "
read directory
if [ -d "$directory" ]
then
echo "thanks again"
else exit
fi
find $directory -maxdepth 1 -type f
find $directory -mtime -$integer2 -ls
find $directory -ctime -$integer2 -ls
从find
手册页:
-type c File is of type c: b block (buffered) special c character (unbuffered) special d directory p named pipe (FIFO) f regular file l symbolic link; this is never true if the -L option or the -follow option is in effect, unless the symbolic link is broken. If you want to search for symbolic links when -L is in effect, use -xtype. s socket D door (Solaris)
您正在寻找的标志是-type s
用于套接字和-type p
管道(或FIFO)
编辑:如果要列出套接字或管道的文件,则需要在命令中指定“或”。例如find . \( -type s -o -type p \)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句