Question

In: Computer Science

linux Using the grep or egrep commands, what would be the full command (including regular expression)...

linux

Using the grep or egrep commands, what would be the full command (including regular expression) to view only the lines in the file /boot/grub/grub.cfg that DO NOT begin with a hashtag (the # sign). In other words, what would be the command to print all the lines in this file that do not begin with this character.

Solutions

Expert Solution

Grep command in Unix/Linux is the short form of ‘global search for the regular expression’.

The grep command is a filter that is used to search for lines matching a specified pattern and print the matching lines to standard output.

Grep Regular Expression. A regular expression or regex is a pattern that matches a set of strings

Command:

grep "^[^#;]" /boot/grub/grub.cfg

Original Grub File with Hashes

If you have any doubts, leave a comment below before rating. I'll be happy to assist you further.

Do UPVOTE this as I have put a lot of EFFORT in answering this question. It really helps me.


Related Solutions

linux: Regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter...
linux: Regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter the file so the output displays only the items requested. Put your full command in the space provided 1.Show only the lines that end with an ellipses (3 dots) :
linux: regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter...
linux: regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter the file so the output displays only the items requested. Put your full command in the space provided. 1. Display only the lines that were written to the file between the times of 12:55 and 12:59 (inclusive). This is tricky. Don’t think of these times as numbers, think of these times as a series of characters (a 1 followed-by a 2 followed-by a colon,...
linux: regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter...
linux: regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter the file so the output displays only the items requested. Put your full command in the space provided. 1. Display only the lines that were written to the file between the times of 12:55 and 12:59 (inclusive). This is tricky. Don’t think of these times as numbers, think of these times as a series of characters (a 1 followed-by a 2 followed-by a colon,...
Using egrep and grep in linux Using sentences.txt Find all sentences that have words where there...
Using egrep and grep in linux Using sentences.txt Find all sentences that have words where there are two vowels in a row. Find all sentences that contain punctuation marks other than periods. Find all sentences that contain punctuation marks, including periods, that are not at the end of the sentence. Find all sentences that contain at least three words. Find all sentences that contain exactly four words. Find all sentences that contain words in which the letters (upper or lower...
this is bash scripting. a. Explain the difference between grep and egrep? b. Write a command...
this is bash scripting. a. Explain the difference between grep and egrep? b. Write a command to list files where third letter is x or y? c. Write command to remove array element with id 5
linux use the command dmesg, use grep to filter and then redirect just the lines with...
linux use the command dmesg, use grep to filter and then redirect just the lines with the word Linux in them from the output generated by the dmesg command. redirect this output to a file at the path PutFileHere/Dmesgoutput.txt. What command did you use to do this, if there is no output choose a different word to grep for in the output of this command and substitute that word.
What is the result of the command ? $ who | grep $USER $ grep \$HOME...
What is the result of the command ? $ who | grep $USER $ grep \$HOME economics1 $ echo u*>> economics1 $ echo ‘u*’ >> economics1 $ . economicsA $ set noclobber $ set -o $ chmod +x economics2 $ spell < economics1 economic is file name linux command
Unix / Linux 16. Regular Expression: Given the following regular expression, provide a description of the...
Unix / Linux 16. Regular Expression: Given the following regular expression, provide a description of the intended match. ^[^A-Z] 17. Regular Expression: Given the following regular expression, provide a description of the intended match. [^^!] 18. Regular Expression: Given the following regular expression, provide a description of the intended match. ^.\{72\}$ 19. Regular Expression: Given the following regular expression, provide a description of the intended match. [A-Za-z0-9] 20. Regular Expression: Given the following regular expression, provide a description of the...
What would these commands look like in Kali Linux? In Kali Linux: a) Create a user...
What would these commands look like in Kali Linux? In Kali Linux: a) Create a user (username= YOUR-FIRSTNAME). b) Create a file (filename=test) and use chmod command to add the write permission for Others. c) Use setfacl to remove write permission to YOUR-FIRSTNAME user. Use getfacl to check the file's permissions. d) Remove YOUR-FIRSTNAME user. Deliverable(Screenshots from each section if possible please)
a) Observe the following Linux commands and work out what each command does: 1) $ ls...
a) Observe the following Linux commands and work out what each command does: 1) $ ls –al 2) $ /etc/profile 3) $ chmod 200 final_assignment.txt b) Consider a scenario where Bob has downloaded his messages to the local machine with an access of POP3, he can create mail folders and move the downloaded messages into the folders. Bob can then delete messages, move messages across folders, and search for messages (by sender name or subject). But this paradigm—namely, folders and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT