Archive for the ‘Linux Quiz’ Category

Linux Quiz #004

Tuesday, July 11th, 2006

Logfiles galore! (Submit Answer)

Write a bash script that will compress all files named *.log in the directory “/usr/local/app/logs” that have not been accessed in the last day.

The script should only produce output if:

  • The directory does not exist
  • An error occurs compressing the file

If you need a hint, here is a good article on using find.

Linux Quiz #003

Thursday, July 6th, 2006

Panic! (Submit Answer)

Let’s say you are troubleshooting a remote system and have no physical access to the hardware. How would you ensure that you can regain control of the system if/when a kernel panic occurs?

Assume you have serial console access both during POST and after kernel bootstrap. There is more than one correct answer.

Linux Quiz #002

Wednesday, June 28th, 2006

The Patch Command (submit answer)

Create a patch file called helloworld.patch suitable for use with the
patch command to fix a typo in helloworld.c. Also, give the command line necessary to apply the patch.

To test the syntax of the .c file use: gcc -o helloworld helloworld.c

helloworld.c

Linux Quiz #001

Saturday, June 24th, 2006

This is the first in a series of Linux Quizzes. Some quizzes will be very basic while some will be quite tough even for the graybeards. I will post my version of the correct answer after a few days.

I/O Redirection (submit answer)

An imaginary bash shell script, foobar.sh, outputs data on standard output and diagnostic messages on standard error. What command line would you use to run foobar.sh and have the data output in file data.out and the diagnostic
output in file diag.out?

For extra credit, submit a bash script that creates output as described.