Linux command
bfs 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Find
bfs [/path]
Find
bfs [/path] -name ["*.txt"]
Breadth-first
bfs [/path] -type f
Execute
bfs [/path] -name ["*.log"] -delete
说明
bfs is a breadth-first variant of the Unix find command. It traverses directories in breadth-first order rather than depth-first, which can be faster for certain operations and more intuitive when printing results. The tool is compatible with GNU find but uses a different traversal strategy.
参数
- -name _pattern_
- Match filename pattern
- -type _type_
- File type (f, d, l, etc.)
- -size _n_
- File size
- -mtime _n_
- Modification time
- -exec _command_ ;
- Execute command
- -delete
- Delete matched files
- -depth
- Process directory contents before directory
- -maxdepth _n_
- Maximum depth to descend
FAQ
What is the bfs command used for?
bfs is a breadth-first variant of the Unix find command. It traverses directories in breadth-first order rather than depth-first, which can be faster for certain operations and more intuitive when printing results. The tool is compatible with GNU find but uses a different traversal strategy.
How do I run a basic bfs example?
Run `bfs [/path]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -name _pattern_ do in bfs?
Match filename pattern