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,...
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
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...
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...
unix/Linux Create a tar command using the man command and the link referred to in To...
unix/Linux Create a tar command using the man command and the link referred to in To Practice and Explore: Text File Utilities #9. Preliminaries Use the man pages to learn more about tar Review the links referred to in To Practice and Explore: Text File Utilities #9 to see examples of using tar command Perform Use tar "to stuff" three files and then "unstuff" them into a new directory. Include the -v option. Task ll to show the original 3...
Give the PowerShell command that would display the “Path” environment variable. What two PowerShell commands will...
Give the PowerShell command that would display the “Path” environment variable. What two PowerShell commands will display all of the users currently logged into a server? What command would give helpful information about the Get-Command cmdlet.
Questions: Explain the following Linux commands Show your work examples/outcome. 1. command used to locate /Home/...
Questions: Explain the following Linux commands Show your work examples/outcome. 1. command used to locate /Home/ Directory…show the outcome 2. command used for October 2020 3. mv command and cat command 4. commands used- move to parent directory? 5. Explain why command is used ls -R?   What is the meaning of -R ? 6. Explain and describe two examples of how the touch command. 7. Explain what is the outcome of the commands ls -C ? 8. Explain command echo....
1. What is a regular expression? Write a regular expression that will detect “College” and “collegE”....
1. What is a regular expression? Write a regular expression that will detect “College” and “collegE”. 2. What is degree centrality? Create a graph of 4 vertices and compute the degree centrality of the vertices. 3. Compute internal and external community densities for a graph containing 6 nodes. You can create any graph of 6 nodes with at least 4 edges.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT