Question

1) Which sed command line string will delete any line that begins with the string 'directory'...

1) Which sed command line string will delete any line that begins with the string 'directory' within the file called sedfile.

A) sed '/dir/d' sedfile

B) sed '/^dir/d' sedfile
C) sed 's/^dir/d' sedfile
D) sed '/directory/d' sedfile

2) Complete the sed commmand string below. Create a sed command line string that will replace ALL the occurrences of X and x with s within the file called sedfile.

sed 's/##/s/g' sedfile

Replace the ## with the BEST correct answer.

A) [X,x]

B) Xx

C) X,x

D) [Xx]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

1) OPTION B IS CORRECT

2) OPTION D IS CORRECT

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
1) Which sed command line string will delete any line that begins with the string 'directory'...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • QUESTION 1 From YOUR home directory, execute a find command string that will locate the file...

    QUESTION 1 From YOUR home directory, execute a find command string that will locate the file called resolv.conf. Include the -exec flag in the find command to cat the file to the screen. Begin your find search from the letc directory Select the correct find command string below that will accomplish this. find /etc-name 'resolv.conf -cat D find /etc-name 'resolv.conf -exec cat 0 find. -name 'resolv.conf -exec cat 0\ find /-name 'resolv.conf' -exec cat 0 QUESTION 2 What find command...

  • You are working with the file directory of a Windows XP computer from the command line,...

    You are working with the file directory of a Windows XP computer from the command line, and you use the md command to create a new directory in your My Documents directory. What command switch can you issue to confirm that the new directory was created? A. Just use the dir command to view all of the directories and files in the My Documents and look for the name of directory you just created B. dir /new C. dir /bn...

  • QUESTION 1 From YOUR home directory, execute a find command string that will locate the file...

    QUESTION 1 From YOUR home directory, execute a find command string that will locate the file called resolv.conf. Include the -exec flag in the find command to cat the file to the screen. Begin your find search from the letc directory. Select the correct find command string below that will accomplish this. find /etc -name 'resolv.conf-cat f} \; find /etc -name 'resolv.conf' -exec cat {} \; find . -name 'resolv.conf' -exec cat {} \; O find / -name 'resolv.conf' -exec...

  • a) Write a one-line sed command that will replace all multiple spaces in a file called...

    a) Write a one-line sed command that will replace all multiple spaces in a file called names.txt (this is an arbitrary file that you may create yourself) by only one space. b) Consider the following file called system.txt: 1  2  3  4 5  6  7  8 9  He 11 Hg Ts H  15 Be 17 Mc Li 20 Write a one-line sed command that replaces the second number in every line with the string “system”, without the quotes. For example,...

  • Post-Lab 2: GNU and UNIX commands Keywords: • Sort • head tail • Pipe (D •...

    Post-Lab 2: GNU and UNIX commands Keywords: • Sort • head tail • Pipe (D • Redirection ) • alias • Wildcards • Metacharcters . sed utility Find • tar 1. Create a directory called Dirl and if the creation was successful, change the current working directory to be Dirl. 2. Extract lines 3-5 from a file, first using head to get the first 5 lines then tail to get the last 2 lines . With pipes . With redirection...

  • Question 1) Copy file called sortfile from my home directory. The file contains three columns of...

    Question 1) Copy file called sortfile from my home directory. The file contains three columns of information : username, uid number and group name respectively, separated by a field separator. Will the following command sort the file on the group name field? sort -t! -k3 sortfile A) Yes B) No Question 2) Copy the file called sortfile from my home directory. The file contains three columns of information : username, uid number and group name respectively, separated by a field...

  • Open Command Prompt typing CMD command in your Search window. Change the directory from current to...

    Open Command Prompt typing CMD command in your Search window. Change the directory from current to root (C:). Make a new directory called CIS165_Your Last Name (example: CIS165_Nossa). Within this directory, make subdirectories called Can1 and Can2. Verify the created directory and subdirectories using particular command. Under Can1 subdirectory creates three files called Jam.txt, Milk.txt and Juice.txt. Verify that you created these files using particular command. Move Jam.txt file from the Can1 subdirectory to the Can2 folder. Compare using special...

  • Create a find command string that will locate the file called resolv.conf and once found, grep...

    Create a find command string that will locate the file called resolv.conf and once found, grep for the number of lines that the string nameserver appears in within the file. Begin your find search within the /etc directory. Complete the find command string by replacing the ## with the required characters. Enter only the characters below. find /etc -name 'resolv.conf' -exec grep ##'nameserver' {} \; (The output of the find command will be a number. Ignore the warnings)

  • do numbers 4-8 4. Given any directory, use the Is command to display: • all files...

    do numbers 4-8 4. Given any directory, use the Is command to display: • all files and sub-directories starting with the letter "D" (note do not list anything in any sub-directory) • its immediate sub-directories (sub-directories only, and no other ordinary files) its immediate hidden sub-directories only - take a screenshot (#3-3) that clearly shows the command and the result. 5. Assume that the following files are in the working directory: $ ls intro notesb ref2 section 1 section3 section4b...

  • Explain what the following UNIX command does: Is 'echo I.txt' Please type shell commands (for Windows....

    Explain what the following UNIX command does: Is 'echo I.txt' Please type shell commands (for Windows. UNIX, or any other system that you like) for: creating a directory called hello world list the contents of this directory create a file called iwashere.txt display the contents of the file iwashere.txt from the command-line Please write a simple program in C for accepting a string from the command-line, reversing and printing the reversed string to standard output.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT