08-09-2018, 06:36 PM
(This post was last modified: 08-29-2018, 09:28 PM by Sprintrdriver.)
Hi folks. Have som beginner-issues using grep here.
I'm up to search for the term "--prune-empty-dirs" in the man page of rsync. So I tried to ran this command:Problem is I get error grep: unrecognized option '--prune'.[size=1em]How can I make grep to recognise the text pattern "--prune" as the pattern to search for?[/size][size=1em]I can remove the two dashes, but that is not what I want to do.[/size][size=1.45em][edit while write post][/size]Ok, I found the solution after I remembered to search the web for "grep escape character" (that is probably what I should had ask for) - so I got it to work with the same command, but backslashes in front of all dashes:
I'm up to search for the term "--prune-empty-dirs" in the man page of rsync. So I tried to ran this command:
Code:
man rsync | grep '--prune' -A1 -B4'
Code:
man rsync | grep '\-\-prune' -A1 -B4
I won't let an old, but fully functional computer die just because some company tell me that they won't make no more security updates to their OS. Thanks Linux