Lab 9
Part I
Begin by logging into your GUI Virtual Machine through VNC Viewer.
Open a terminal
- type the command
xeyes
. If you have done this successfully, you should see some googley-looking eyes appear on your desktop and follow your mouse around. - Once that is working, suspend that program by pressing
control+z
.- Notice that the eyes are still there, but stopped following your mouse.
- You should once again be able to type at your terminal.
- Notice that the eyes are still there, but stopped following your mouse.
While it is Stopped
, complete the following:
Run the command that shows you your own running processes and will tell you
- The PID of the
xeyes
program - The PID of your current ssh session or bash connection
- Your current pseudoterminal id (pts number)
- The PID of the
Run the command that shows you the processes for all users, but using a pipe (|) and
grep
show only the processes that pertain to your user.
Take a screenshot of that process listing as described above
- Issue the command
xclock &
to run xclock in the background. You should be able to still type in the remote terminal. - Issue the
jobs
command. You should see xeyes and xclock.
Take a screenshot of the job command you entered
- Read the
man page
forps
and find the single letter option for BSD job control format (hint: it is under the Output Format Control section). Using that option run the ps command to find the parent process id (PPID) of thexclock
process.
Take a screenshot of that ps command using the BSD job control format
- Xeyes should still be stopped but visible. Without killing the process - restart the xeyes process using the
bg
command. Once restarted it will have the same PID. - Read the help page for the jobs command -
help jobs
. Find the option that will list the process id’s in addition to the normal output. Run thejobs
command using this option.
Take a screenshot of that jobs command entered
- Still in your linux GUI, install the
cmatrix
program. - In a different terminal - ssh into your GUI VM as joe and run the cmatrix program. Keep this terminal open so the program keeps running.
- As the system administrator (yourself, not joe),
find
andkill
the cmatrix process, then check your work.
Take a screenshot of the command you used to find cmatrix, the kill command and successful termination of cmatrix (check your work)
Part II
Create the following cron jobs on your CLI Virtual Machine in a regular users crontab file (DO NOT use sudo)
A cron job that runs every 5 mintes and
- Redirects the output of the ps command to a file in your $HOME directory called ps.log
A cron job that runs every day at 3pm and
- echo’s “The current date is: “ and the results of the date command
- The command redirects that output to /var/log/syslog
A cron job that runs the first day of every month at midnight and
- Removes all the files in the /tmp directory that end in
txt
. HINT: use a wildcard * in your command.
- Removes all the files in the /tmp directory that end in
List the contents of your crontab file and take a screenshot.
To pass off
Upload your screenshots to canvas.
Last Updated 12/15/2017