1 in vi what does the following accomplish 1sfoobarg a


1. In vi, what does the following accomplish? :1,$s/foo/bar/g

a. Substitute foo for bar on line 1 globally

b. Substitute bar for boo on line 1 globally

c. Substitute foo for bar on every line

d. Substitute foo for bar in the entire file globally

e. None of the above

2. $echo "$HOME * $USER" will output

a. The result of $HOME and $USER multiplied together

b. Display*

c. Display $HOME*$USER literally

d. Result in error

e. None of the above

3. The command that create directory and all parent directories is:

a. rm -r a/b/c

b. mkdir -r a/b/c

c. touch a/b/c

d. mkdir -p a/b/c

e. rmdir -r a/b/c

4. Your current working directory is /home/student/foo and you have a file name bar in that directory. What is the result of the following command:

$cp ./bar ..

a. An error will be displayed

b. A copy of bar will be made in home directory

c. File bar will be moved from /home/student/foo into /home/student

d. A copy of bar will be created in /home/student directory

e. None of the above

5. What is the link count of directory after the following set of successful commands?

$mkdir d ; cd d ; mkdir subdir

a. 1

b. 2

c. 3

d. 4

e. None of the above

6. Explain the following command and what will it match? Provide the list of matches that regular expression will match.

$egrep '[ab] [0-3]' somefile.txt

7. Explain the following command and what will it match?

$egrep ' [^ (^$) ] ' somefile.txt

8. Explain the following command and what will be the output?

$wc -w < foo > foo

Use the following named funny.txt for the question below. The field separator is a blank space

2014 Cat Ate Dog

2015 Dog Ate Cat

Mouse Chased Cat Dog

Unix Linux Linux Linux

2016 Only Unix Unix

9. What is the output of:

$sed '/201[56] /s/Dog/Cow/g' funny.txt

Solution Preview :

Prepared by a verified Expert
Business Management: 1 in vi what does the following accomplish 1sfoobarg a
Reference No:- TGS02938849

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)