Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The program I use is putty. 1. Assume that you are in vi. What would you expect

ID: 3537066 • Letter: T

Question

The program I use is putty.


1.       Assume that you are in vi. What would you expect to happen if you typed the following:

<esc>:-5 , +5 s@^tony@Tony@



2.      When you type a command, the shell checks several places to see if it can find a command with that name to run. Put the following in the order that the shell checks by default. If the shell does not check it by default, draw a line through the item.

___ All directories in $path

___ All directories in $PATH

___ Hash table created from $path

___ Current directory

___ Built in commands

___ History list

___ System root directory

___ Alias list

___ Shell variables

___ Your home directory


3.      How do you add the directory /usr/local/bin to the end of your existing shell path?

4.       After you ran your command from the previous question, would you need to do anything to change your environment PATH?

5.   Write down three ways you could repeat the last command you entered?


I need help on these question. It truly help if you can help on these question. It my first time learning Unix.

Explanation / Answer

<esc>:-5 , this will go 5 lines above the current line

+5 s@^tony@Tony@ --- here +5 says replace on 5th line AFTER the current line, ^ -- first non space char, Replace tony by Tony



This should be the order :


___ Built in commands

___ Current directory

___ Your home directory

___ System root directory

___ History list

___ Alias list

___ All directories in $path

___ All directories in $PATH

___ Hash table created from $path

___ Shell variables

3) export PATH=/usr/local/bin:|echo $PATH


4) Nothing, the above command should work


5) A) press the up arrow then enter

B) !! <enter>

C) fc -N -1

Where the -N is the last N commands you want to repeat.

This will open an editor with the last N commands in it. You can edit the commands as desired and when you close the editor, they will all be run in sequence


Comment if you have any doubts.