Linux
发布时间:2022-04-01 发布网站:大佬教程 code.js-code.com
大佬教程收集整理的这篇文章主要介绍了linux – 使用grep和ls -a命令,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
概述
使用ls -a和grep,如何使用单个grep命令列出/ usr中以字母p或字母r或字母s开头的所有文件的名称? 这是对的吗? ls –a | grep [prs] /usr 如果您正在尝试查找文件,请不要使用l
s.使用find命令. find /usr -name '[prs]*' 如果您不想搜索/ usr下的整个树,请执行以下操作: find /usr -maxdepth 1 -name '[
@H_
607_14@
使用ls -a和grep,如何使用单个grep命令列出/ usr中以字母p或字母r或字母s开头的所有
文件的
名称?
这是对的吗?
ls –a | grep [prs] /usr
如果您正在尝试
查找文件,请不要使用l
s.使用find命令.
find /usr -name '[prs]*'
如果您不想搜索/ usr下的整个树,请执行以下操作:
find /usr -maxdepth 1 -name '[prs]*'