CS计算机代考程序代写 • Using grep on matrix, write the command line to show first 3 lines containing “/bin/bash” from /etc/passwd. You may use pipes for this answer.

• Using grep on matrix, write the command line to show first 3 lines containing “/bin/bash” from /etc/passwd. You may use pipes for this answer.

A:

2. Using grep on matrix, write the command line to show last 3 lines not containing “/bin/bash” from file /etc/passwd. You may use pipes for this answer.

A:

3. Rewrite the answer in the command line below so errors (lines containing “Permission denied”) get redirected to /dev/null. After running your answer on matrix, no lines containing “Permission denied” are displayed.

A:

4. Rewrite the answer in the command line below so only errors (lines containing “Permission denied”) are displayed. After running your answer on matrix, only lines containing “Permission denied” are displayed.

A:

5. Write a command line showing the number of lines in /etc/passwd. Do not use pipes.

A:

6. Write a command line that sorts file cars and redirects the output to file cars.sorted.

A:

7. Write the command to copy, using scp, the folder weekly_notes from user mark.fernandes on matrix into your pwd in Knoppix. How will you confirm the folder copied into Knoppix successfully?

A:

• When would you use find and when would you use grep?

A:

9. (2 Marks) Show with an example command line what ANY ONE of the following do: sort, cut, tr. Describe in at least two sentences what your command line does

A: