![]() ![]() If you need to search inside a directory you need to search recursively i.e. Using -i will match with words like boo, Boo, BOO, BoO, etc. Grep can also ignore word case using the optipns -i like in the next example: grep -i "boo" example.txt The second command allows you te filter running program by their name, in this case we filtered all python running program using grep and ps command.Īs another example using pipe we will display cpu model name with: cat /proc/cpuinfo | grep -i 'Model' The first command is equivalent to grep 'tutorials' example.txt. You can also use pipes to send the output to grep: cat example.txt | grep 'tutorials' In the next example we search for "tutorials" inside the file example.txt: grep 'tutorials' example.txt ![]() Grep basic usage Command parameters or how to use it * Advance usage: It will help you with edge cases. * Basic usage: the minimal options you need to know to use grep. Once you learn how to use grep you will find that it will help you a lot during your work. Here we are going to explain how to use the grep command with several examples. Grep is a command that is available in most of operationg system (except on Windows). The command is used to search text inside files. ![]() The grep command is a great tool you must learn if you want to be a good software developer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |