| Task |
Command |
Comments |
| See what processes are currently running |
ps |
Notice that you will at least see
an entry for the 'ps' command and for the shell (on ACC
servers, that is 'bash') |
| Start the 'sleep' command |
sleep
10000
|
This command just makes the terminal
wait the specified number of seconds. Notice that you
can't type any commands while it's running. |
| Cancel the command |
CTRL-C
|
The command is interrupted and is
no longer running. |
| See what processes are currently running |
ps
|
You should not see 'sleep' still running |
| Start the 'sleep' command |
sleep
10000
|
This command just makes the terminal
wait the specified number of seconds. Notice that you
can't type any commands while it's running. |
| Now, suspend the process |
CTRL-Z
|
This suspends the sleep command and
brings you back to the prompt |
| See what processes are currently running |
ps
|
You should see the 'sleep' command
as well as the ones you previously saw. |
| Put the suspended command into the
background |
bg
|
The 'sleep' command continues in the
background. Hit enter a few times and you will see it
complete. |
| Start the 'sleep' command in the background |
sleep
10000&
|
Now you are automatically putting
the command in the background. Notice that you are shown
the PID and immediately returned to the command prompt. |
| See what processes are currently running |
ps
|
You should see the 'sleep' command
as well as the ones you previously saw. |
| Kill the process |
kill
PID |
Replace PID with the process ID you
saw when you started the 'sleep' command. |
| See what processes are currently running |
ps
|
You should not see 'sleep' still running. |
| Task |
Command |
Comments |
| Create a crontab entry to print "Hello
world" to the file "hello.txt" every minute
|
crontab -e
|
You will be put into the vi editor automatically. It
looks like a blank page with a bunch of tilde characters
(~) down the left hand side.
Remember to type "i" to enter insert mode
Review the
vi overview if you need to.
|
| Insert the following line: |
*
* * * * echo "Hello world" >> /home/XXX/hello.txt
Replace XXX with the remainder of the path to your
home directory. (Ex: /home/unixweb/unixweb01/hello.txt)
|
Make sure you type this all on one line, with spaces
between the asterisks.
Type ESC :wq to quit vi and save the crontab entry.
|
| Confirm your new entry |
crontab
-l |
The paramter is a lower-case L, not the number one.
You should see the line you just typed.
|
| Wait a few minutes |
|
|
| View the hello.txt file |
cat
hello.txt |
You should see several
copies of "Hello world". |
| Remove the crontab entry. |
crontab
-r |
This will delete all crontab
entries for your user ID. If you need to selectively delete
entries, you must edit the crontab. |
| Confirm you have no crontab entry |
crontab
-l |
Your crontab should be empty. |
In order to submit your project, you will need to be able
to copy the command results from your telnet session. You
can either copy the entire session or just the relevent parts.
Email the text from your telnet session, along with any other
information requested, to unix@iteachu.com
by the deadline date in the schedule.