![]() ![]() The following example matches all lines in the ps -ef output that end in bash: ~]$ ps -ef | grep "sh$" Search for a pattern at the end of a line The following example matches all lines in the ps -ef output that start with the string ptr: ~]$ ps -ef | grep "^ptr" ![]() Search for a pattern at the beginning of a line exit-with-session /etc/X11/xinit/Xclients" The following example matches all lines in the ps -ef output that have sh anywhere in them: ~]$ ps -ef | grep "sh" The back slash \ is an escape character.The asterisk * matches zero or more occurrences of the previous character.The dollar sign $ at the end of a string matches the empty string at the end of a line.The caret ^ at the start of a string matches and the empty string at the beginning of the line. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |