What does grep -w do?In what section do descriptions of C data-structures go?Can't install man pages on...
Basic power tool set for Home repair and simple projects
How do I become a better writer when I hate reading?
Are there any rules for identifying what spell an opponent is casting?
Difference between sizeof(struct name_of_struct) vs sizeof(name_of_struct)?
Does an African-American baby born in Youngstown, Ohio have a higher infant mortality rate than a baby born in Iran?
Should I email my professor to clear up a (possibly very irrelevant) awkward misunderstanding?
What is the color associated with lukewarm?
When is the phrase "j'ai bon" used?
Using roof rails to set up hammock
Cant bend fingertip when finger is straight
Converting 3x7 to a 1x7. Is it possible with only existing parts?
Manager wants to hire me; HR does not. How to proceed?
Threading data on TimeSeries
100-doors puzzle
How could I create a situation in which a PC has to make a saving throw or be forced to pet a dog?
Can I appeal credit ding if ex-wife is responsible for paying mortgage?
newcommand with parameter blank or zero
Is it unethical to quit my job during company crisis?
Do items with curse of vanishing disappear from shulker boxes?
Improving do loop speed with IntegerQ conditions
Reflecting Telescope Blind Spot?
Having some issue with notation in a Hilbert space
Background for black and white chart
Does anyone recognize these rockets, and their location?
What does grep -w do?
In what section do descriptions of C data-structures go?Can't install man pages on minimal Centos Docker containerHow can I list all man pages that have certain text without displaying contents?What is the difference between man and --help?What does ls -alh mean?How and what style should I use when writing man pages?How can 'man' render double quotes not as doubled backtick and prime characters?rsync: Why doesn't --archive imply --recursive when --files-from=FILE is used?Looking up docs for C header files?What does C@t{++} mean in the gdb man page?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
In here grep is used with the option -w
. I did man grep
and grep --help
to try to find what the aforementioned option does. Neither output says anything about a -w
option.
What does that option do? Why does it not appear in man
or --help
? In case something similar happens again, where else can I check for an answer?
I am currently using Ubuntu, if that is relevant (is it?)
man options documentation
add a comment |
In here grep is used with the option -w
. I did man grep
and grep --help
to try to find what the aforementioned option does. Neither output says anything about a -w
option.
What does that option do? Why does it not appear in man
or --help
? In case something similar happens again, where else can I check for an answer?
I am currently using Ubuntu, if that is relevant (is it?)
man options documentation
My man page and--help
(from Debian, probably older than yours) both list-w, --word-regexp force PATTERN to match only whole words
. Whichgrep
version are you using?
– Michael Homer
21 mins ago
add a comment |
In here grep is used with the option -w
. I did man grep
and grep --help
to try to find what the aforementioned option does. Neither output says anything about a -w
option.
What does that option do? Why does it not appear in man
or --help
? In case something similar happens again, where else can I check for an answer?
I am currently using Ubuntu, if that is relevant (is it?)
man options documentation
In here grep is used with the option -w
. I did man grep
and grep --help
to try to find what the aforementioned option does. Neither output says anything about a -w
option.
What does that option do? Why does it not appear in man
or --help
? In case something similar happens again, where else can I check for an answer?
I am currently using Ubuntu, if that is relevant (is it?)
man options documentation
man options documentation
asked 25 mins ago
RUBEN GONÇALO MOROUÇORUBEN GONÇALO MOROUÇO
143
143
My man page and--help
(from Debian, probably older than yours) both list-w, --word-regexp force PATTERN to match only whole words
. Whichgrep
version are you using?
– Michael Homer
21 mins ago
add a comment |
My man page and--help
(from Debian, probably older than yours) both list-w, --word-regexp force PATTERN to match only whole words
. Whichgrep
version are you using?
– Michael Homer
21 mins ago
My man page and
--help
(from Debian, probably older than yours) both list -w, --word-regexp force PATTERN to match only whole words
. Which grep
version are you using?– Michael Homer
21 mins ago
My man page and
--help
(from Debian, probably older than yours) both list -w, --word-regexp force PATTERN to match only whole words
. Which grep
version are you using?– Michael Homer
21 mins ago
add a comment |
2 Answers
2
active
oldest
votes
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the
beginning of the line, or preceded by a non-word constituent
character. Similarly, it must be either at the end of the line or
followed by a non-word constituent character. Word-constituent
characters are letters, digits, and the underscore.
Source: https://linux.die.net/man/1/grep
add a comment |
# grep --help | grep -e -w
-w, --word-regexp force PATTERN to match only whole words
-H, --with-filename print file name with output lines
-L, --files-without-match print only names of FILEs with no selected lines
-l, --files-with-matches print only names of FILEs with selected lines
# grep PRETTY /etc/os-release
PRETTY_NAME="Ubuntu 18.04 LTS"
# man grep | grep -e -w -A1
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f524828%2fwhat-does-grep-w-do%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the
beginning of the line, or preceded by a non-word constituent
character. Similarly, it must be either at the end of the line or
followed by a non-word constituent character. Word-constituent
characters are letters, digits, and the underscore.
Source: https://linux.die.net/man/1/grep
add a comment |
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the
beginning of the line, or preceded by a non-word constituent
character. Similarly, it must be either at the end of the line or
followed by a non-word constituent character. Word-constituent
characters are letters, digits, and the underscore.
Source: https://linux.die.net/man/1/grep
add a comment |
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the
beginning of the line, or preceded by a non-word constituent
character. Similarly, it must be either at the end of the line or
followed by a non-word constituent character. Word-constituent
characters are letters, digits, and the underscore.
Source: https://linux.die.net/man/1/grep
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the
beginning of the line, or preceded by a non-word constituent
character. Similarly, it must be either at the end of the line or
followed by a non-word constituent character. Word-constituent
characters are letters, digits, and the underscore.
Source: https://linux.die.net/man/1/grep
answered 21 mins ago
BenjaminBenjamin
766
766
add a comment |
add a comment |
# grep --help | grep -e -w
-w, --word-regexp force PATTERN to match only whole words
-H, --with-filename print file name with output lines
-L, --files-without-match print only names of FILEs with no selected lines
-l, --files-with-matches print only names of FILEs with selected lines
# grep PRETTY /etc/os-release
PRETTY_NAME="Ubuntu 18.04 LTS"
# man grep | grep -e -w -A1
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.
add a comment |
# grep --help | grep -e -w
-w, --word-regexp force PATTERN to match only whole words
-H, --with-filename print file name with output lines
-L, --files-without-match print only names of FILEs with no selected lines
-l, --files-with-matches print only names of FILEs with selected lines
# grep PRETTY /etc/os-release
PRETTY_NAME="Ubuntu 18.04 LTS"
# man grep | grep -e -w -A1
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.
add a comment |
# grep --help | grep -e -w
-w, --word-regexp force PATTERN to match only whole words
-H, --with-filename print file name with output lines
-L, --files-without-match print only names of FILEs with no selected lines
-l, --files-with-matches print only names of FILEs with selected lines
# grep PRETTY /etc/os-release
PRETTY_NAME="Ubuntu 18.04 LTS"
# man grep | grep -e -w -A1
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.
# grep --help | grep -e -w
-w, --word-regexp force PATTERN to match only whole words
-H, --with-filename print file name with output lines
-L, --files-without-match print only names of FILEs with no selected lines
-l, --files-with-matches print only names of FILEs with selected lines
# grep PRETTY /etc/os-release
PRETTY_NAME="Ubuntu 18.04 LTS"
# man grep | grep -e -w -A1
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.
edited 2 mins ago
answered 8 mins ago
murumuru
39.6k595171
39.6k595171
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f524828%2fwhat-does-grep-w-do%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
My man page and
--help
(from Debian, probably older than yours) both list-w, --word-regexp force PATTERN to match only whole words
. Whichgrep
version are you using?– Michael Homer
21 mins ago