![]() ![]() If the string includes spaces, you need to enclose it in single or double quotation marks: grep "Gnome Display Manager" /etc/passwd Invert Match (Exclude) # The output should look something like this: root:x:0:0:root:/root:/bin/bash The most basic usage of the grep command is to search for a string (text) in a file.įor example, to display all the lines containing the string bash from the /etc/passwdįile, you would run the following command: grep bash /etc/passwd ![]() ![]() To be able to search the file, the user running the command must have read access to the file. The items in square brackets are optional. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
May 2023
Categories |