Question

Using your vi(m) editor, answer the following questions and email it to your instructor. Note that...

Using your vi(m) editor, answer the following questions and email it to your instructor. Note that I am not looking for perfect answers. This activity if to practice vi(m).

Good practice site http://vimgenius.com/

On the top of all your documents, always include these items:

your name:
date:
Answers for week 3

  1. What are the names of the parts of a UNIX command? List them, and give a brief description of each.
  2. Can multiple UNIX commands be typed on the same single command line? Explain how.
  1. Why should you learn VI(M) (google search)? answers will vary
  1. What system was the immediate predecessor of UNIX? Where was this predecessor and UNIX itself initially developed, and by whom?
  1. what are the basic motions of the cursor, down, up, left, right?
  • Save the answers in your unix system in a file called week3answers
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer1:

Commands can include three parts: a command, some optional, and some arguments.

  1. Command is a word that Unix operating system recognizes as a request to perform a specific action.
  2. An option, as the name implies, is not necessary but provides additional functionality. Options provide extra functions to a command; they are always starts by a dashes '-'.

The arguments with [brackets] around them are named "optional arguments".

The arguments without those brackets are "mandatory arguments".

Example:

consider command

ls -a

here 'ls' is the command

  '-a' is the optional parameter

3.An argument is a variable/parameter supplied by the user.

Example:

consider command

cat alpha.txt

here 'cat' is the command

  'alpha.txt' is the argument passed by the user

Answer 2:

Multiple UNIX commands be typed on the same single command line

By creating including the commands in the same line/file.

  1. If we want to execute next command only if the previous one succeeded, then combine them using the && operator i.e cat alpha.txt && ls -a
  2. If any of the commands fail, then all other commands after the failed comand won't be executed.
  3. If we want to execute the commands regarless of failure we can seperate the commands using a semicolon ';' i.e cat alpha.txt ; ls -a
  4. We can use concept is known as shell scripting, or bash scripts (a common shell). We can create a file with extension .sh and with all the commands having #!/bin/bash at the top. Then we can run the file like: sh commands.sh where commands.sh is the name of the file we just created

Answer 3:

The main benefits of Vim are:

- Your hands never leave the keyboard, saving you context-switching time.

- Powerful commands allow you to manipulate text with a minimal amount of keystrokes.

- All UNIX servers have vi installed, so you can edit files directly on most servers.

- It's fun to use.

Answer 4:

MULTICS was the immediate predecessor and it was developed by Bell Laboratories.

Unix was developed by Bell Labs, Ken Thompson, Dennis Ritchie and others at Bell Laboratories

Answer 5:

In VIM there are two ways to move the cursor. we can either use the arrow keys (like you would in any other editor), or we can use:

  • h – Moves the cursor left
  • j – Moves the cursor down
  • k – Moves the cursor up
  • l – Moves the cursor right
Add a comment
Know the answer?
Add Answer to:
Using your vi(m) editor, answer the following questions and email it to your instructor. Note that...
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
  • UNIX help!!!! I need what the text would look like in the vi editor. also note...

    UNIX help!!!! I need what the text would look like in the vi editor. also note this question has been posted before and the answers were all wrong!! Write a shell script (bash or sh) that prints out the following lines/information: Only your name may be hard coded, the rest must be obtained programmatically within the shell script. Name: "Your name" Hostname: "The computer's hostname" Host IP: "The computer's IP number" Default Gateway: "The computer's default gateway" OS Version: "Whatever...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

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