Paul Tibbitts - Sample Training Questions
About Sample Training Questions
These questions are
derived from a sample of our class exercises, to help
potential students determine which classes are appropriate for them.
These are not identical to the interactive
post-class assessement tests, which
utilize web-based scoring and reporting, as well as a
larger assortment of questions.
As you read through the questions for each class, consider how
confident you feel with the material. If it's completely familiar, you
probably won't gain much from the corresponding class.
Training is time-consuming
and expensive, and we don't want you to waste your time or money on
training that won't help you. If the material isn't familiar,
hopefully it would be after attending the corresponding class.
You won't find the answers here, but if you can't come up with
them on your own, you could probably
benefit from the class!
Sample questions are currently available for:
Introduction to Unix/Linux
-
What shortcut could you use with "cd" to change back to the
previous directory you were in?
-
Write an "ls" command to provide a long listing of all objects in
the /usr directory (without showing any objects below /usr.)
-
Change your default file creation permissions so new objects will
be created with no permissions for "other" or "group", but full
access for "user"; verify by creating both a new file and
directory. Do the new file and directory have identical permissions?
-
Write a command to descend the hierarchy rooted at ~, and change
the permissions on all directories found to be 755. Do not change
permission on any ordinary files you encounter.
-
What command would produce output similar to:
2a3
> to make your web page appear to be updated daily
7c8
< x/ Array of day names
---
> // Array of day names
-
Write a command to delete every instance of the ESC character contained
in binary data file "bf":
-
You create a shell script "myprog" in your home directory,
make "myprog" executable,
yet when you try to run it you receive a "command not found" error.
Why might this have occurred, and what would you do to correct the problem?
-
What command would you use to display the amount of free space remaining
on the filesystem containing your home directory?
What vi editor command would you use (in vi command mode) to append
the entire contents of the line below your cursor, to the line
your cursor is currently on?
-
What ksh option could you use to prevent overwriting files when using
the ">" operator?
-
Write a command to search your home directory hierarchy for any file
modified within the past 24-hour period.
Unix/Linux Tools
-
Using the vi editor, what command would you use to replace lines
10 through 20 of your file with an ascii-sorted instance of those
same lines?
-
Write a grep command to display all blank lines in a file, where
blank is defined as containing no characters at all, or only space
character (but not tabs.)
-
Explain the purpose of each component of this command:
find . -type f | xargs -i grep pattern {} /dev/null
-
Define a function "mkbak" that will copy each object (file or
directory) named as an argument to your ~/.bak directory.
-
Where will output written by a command run from your crontab go, if
not explicitly redirected?
-
A powerful feature of the awk language is it's ability to use
arrays indexed by any string; what is the name for these string-indexed
arrays?
-
Explain what this sed command will do:
s/\(.\)\(.\)/\2\1/
-
You are editing your .exrc file using vi, and need to place a
control-M at the end of one of the lines. What key sequence will
allow you to enter a
control-M into the file?
-
Write an egrep command to display lines matching "Easy St." in a text
file. Repeat, using fgrep.
-
Using Kornshell, what command will display the current limits set
for core file size, and maximum simultaneous open files?
Introduction to Unix/Linux System Administration
-
Someone tells you that the "sticky bit" should be applied to
the /tmp directory. What would this accomplish? What command
and arguments would you use to set it? How would the file
permissions appear when displayed in "ls -l" format?
-
The _____________ command can be used to position a tape at a
specified file marker (such as in a position to read the third
file on a tape), or to rewind a tape.
-
If you find it necessary to edit the passwd file, you should not
invoke an editor directly, but instead use the ____________ program.
-
The ____________ scripting language is especially handy for automating
interactive tasks, such as an ftp session.
-
On a System V-based system, /etc or /sbin will typically contain
directories named for run levels, such as rc2.d. Within each directory
will be "S" and "K" scripts. Describe and explain how the order of
execution for these scripts is determined.
-
In environments where the "newgrp" command is provided, what is its
purpose? Why is it present in some environments, but not others?
-
What is a "sparse" file, and why can it cause problems when copying
data from one location to another?
-
You receive the error "read only" when attempting to save changes to
a system configuration file you are editing, despite having logged in
as root. Why might this happen, and what should you do to rectify
the problem?
-
Write a find command to produce a list of set-user-id and set-group-id
files anywhere on your system.
-
The contents of the kernel ring buffer can be viewed using the ____________
command, which is typically used to view boot-time startup messages "after
the fact."
-
Users report that the "man -k" command has never worked since the system
was installed. What is the likely problem and solution?
-
After installing a major software package, such as a database, using
/opt as a package destination, what related change(s) might be required? What
would be a likely choice for a location to install the new software?
Introduction to Perl
-
Write a printf statement to display the contents of variable $x as a
numeric value, left justified in a field of 8 spaces, with 2 spaces after
the decimal point.
-
Given the IP address 192.168.10.1 stored as a string, write a perl
statement to parse the string using . as the field separator, and assign
the four integers to the variables $ip1, $ip2, $ip3, $ip4.
-
Given integers $ip1, $ip2, $ip3, $ip4, explain the result of:
$c = pack("C4", $ip1, $ip2, $ip3, $ip4);
-
What will the following code segment print?
@a = ("mon", "tue", "wed"); print pop(@a), "\n";
-
Using "next" will cause a return to the test at the top of a loop,
or to the (optional) ______________ block following the loop.
-
What is an equivalent, abbreviated form of
$var[0]->[0];
-
When initializing hashes, what two character combination is often used
as an alternative to the "," character in the initializtion list?
-
Given array @a, write a perl statement to sort @a into descending ascii order.
-
The ____________ function will return the the "next" key/value pair in a hash,
or an empty list (thus "false") when all pairs have been returned.
-
Explain whether (or not) the following statements will produce
identical results:
0 && print "yes\n";
"0" && print "yes\n";
"00" && print "yes\n";
Back to Training