简体   繁体   English

如何使用 grep 查看 linux 中的所有文件?

[英]how to view all files in linux using grep?

I'm trying to view the files in the linux (xubuntu) terminal (like this command: ls ).我正在尝试查看 linux (xubuntu) 终端中的文件(如此命令: ls )。
Is there a way to do it with the command grep ?有没有办法用命令grep做到这一点? Thanks for helpers.感谢帮助者。

You can use recursive ( -r ) and only filename ( -l )您可以使用递归( -r )并且只能使用文件名( -l

grep -r . -l

You can set a directory action ( -d skip ) to only grep files in a directory您可以将目录操作 ( -d skip ) 设置为仅目录中的 grep 文件

grep -r . -d skip -l *

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM