Question

in vim editor: 1. Write a command that will change all "/" characters to "+" in...

in vim editor:

1. Write a command that will change all "/" characters to "+" in the file.

2.Write a command that will add one blank line after every existing line in the file.

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

Answer 1: cat <file_name.txt> | sed 's/\//+/g'

teegu@L34459WIN-1 MINGW64 ~/Desktop $ cat a.txt | sed s/V/+/g Uday+kumarReddy+ asdasdhasd asdasds

Answer 2:cat <file_name> | sed 'G'

Sample:teegu@L34459WIN-1 MINGW64 ~/Desktop $ cat a.txt | sed G Uday/kumarReddy/ asdasdhasd asdasds teegu@L34459WIN-1 MINGW64 ~/Des

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
in vim editor: 1. Write a command that will change all "/" characters to "+" in...
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
  • JAVA DATA STRUCTURES Write a line-based text editor. The command syntax is similar to the Unix...

    JAVA DATA STRUCTURES Write a line-based text editor. The command syntax is similar to the Unix line editor ed. The internal copy of the file is maintained as a linked list of lines. To be able to go up and down in the file, you have to maintain a doubly linked list. Most commands are represented by a one-character string. Some are two characters and require an argument (or two). Support the commands shown below: Command Function Go to the...

  • Write a linux command that will add a "#" character to the start of every line...

    Write a linux command that will add a "#" character to the start of every line that does not already start with a "#" character. Write a linux command that will append all lines of the /etc/passwd file that contain the word "STUDENT" to the end of the file. Write a linux command that will move the last word of each line to the start of the line. Write a linux command that will add the line number to the...

  • Vim and Unix Questions In a vim window, how do you set a tab to be...

    Vim and Unix Questions In a vim window, how do you set a tab to be two spaces wide? In a vim window, how do you, with a simple and single command, move the cursor to 5 lines below (don’t worry about the actual number of lines) and do nothing else? In a vim window, how do you, with a simple and single command, assuming your cursor is at the beginning of the word, delete the current word and do...

  • 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,...

  • 12.13 (Count characters, words, and lines in a file) Write a program that will count the...

    12.13 (Count characters, words, and lines in a file) Write a program that will count the number of characters, words, and lines in a file. Words are separated by whitespace characters. The file name should be passed as a command-line argument, as shown in Figure 12.13 D Command Prompt exercise java Exercise12.13 Loan.java ile Loan.jaua has 1919 characters 10 words 71 lines lexercise Figure 12.13 The program displays the number of characters, words, and lines in the given file. This...

  • 1.Write a find command that will display the inode number of all files in the working...

    1.Write a find command that will display the inode number of all files in the working directory (only) that contain the string "#include". 2.Write an ls command with a glob specification that will list the names of all files in the working directory that are exactly 10 characters long, begin with w, x, y, or z, and do not contain a "." character (i.e. no file extension). 3.Write an ls command with a glob specification that will list the names...

  • Write a program that determines if a string (passed as a command-line argument) has all unique...

    Write a program that determines if a string (passed as a command-line argument) has all unique characters. The program must print the number of times each existing character appears, and then print whether or not they are all unique. Special requirements: You are NOT allowed to modify the input string or create any additional data structures (no arrays, lists, dictionaries, or other strings). You may have only one string (the one received as the command-line argument). You may have one...

  • 1) Write a C program that displays all the command line arguments that appear on the...

    1) Write a C program that displays all the command line arguments that appear on the command line when the program is invoked. Use the file name cl.c for your c program. Test your program with cl hello goodbye and cl 1 2 3 4 5 6 7 8 and cl 2) Write a C program which displays the sum of the command line arguments. Hint: use sscanf to convert the decimal arguments (which are strings) to binary numbers that...

  • 7. Write a command that redirects all chrome processes to a file name process.txt. Write a...

    7. Write a command that redirects all chrome processes to a file name process.txt. Write a command to output the content of process.txt file. 8.Write a command that redirect (add) all processes containing the word “host” to process.txt file above. 9.Write a command that will ask users about their location (“Where do you live?”). The command should read the input from a user and store it in a variable “$location”. Use another command to output the user’s response. 10.Write a...

  • Answer all the Question 1. When working with pathnames in Linux, explain the difference between using...

    Answer all the Question 1. When working with pathnames in Linux, explain the difference between using two dots and one dot in the pathname. 2.Describe one benefit of the Filesystem Hierarchy Standard (FHS). 3. Describe two ways to start the vim editor. 4.Define the Linux modular architecture and discuss its advantages. 5. Provide a brief history of the vi command-line text editor.

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