简体   繁体   中英

Why the command “grep” doesn’t work with no parameters?

I've been trying to use the command grep, but without the -R parameter the whole cli goes just idle. Can someone explain me why?

I assume you're not providing any files at all to search. If that's the case, then grep is reading from stdin (standard input). It's waiting for you to close the input ( Ctrl + D ), and then it'll search that.

If you want to search files, you need to tell it what files to search. Perhaps you mean to include * in your command?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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