Grep word boundaries
Accorging to GNU documentation:
Accorging to GNU documentation:
I’ve seen someone use command: ps -ef | grep [h]ttpd and Output is: apache 25125 31006 0 21:54 ? 00:00:00 /usr/sbin/httpd apache 26869 31006 0 22:04 ? 00:00:00 /usr/sbin/httpd apache 27349 31006 0 22:07 ? 00:00:00 /usr/sbin/httpd apache 27696 31006 0 22:09 ? 00:00:00 /usr/sbin/httpd apache 28534 31006 0 22:14 ? 00:00:00 /usr/sbin/httpd root 31006 … Read more
I can’t for the life of me figure out how find with the test -name works.
I try to search for lines that start with “1” using
I am trying to list all the files from dir1, dir2, dir3 and dir4 which might be anywhere in as a sub directory of my cwd using the find command. I tried the following with no success:
I’m trying to match multiple alphanumeric values (this number could vary) from a string and save them to a bash capture group array. However, I’m only getting the first match:
I cannot seem to make it work. GNU sed documentation says to escape the pipe, but that doesn’t work, nor does using a straight pipe without the escape. Adding parens makes no difference.
Say I have lines like this:
NOTE: This question is the complement of this Q&A: How to “grep” for line length in a given range?
Say I had a block of text in the ~/.bashrc: