Chapter 4 Answers to Exercises in Section 4.6
4.6.1. General
-
top
-
ps
-
man ps
ps aux or ps -e
- The load on cpu goes very high. To stop, use Ctrl-C.
-
xclock
Ctrl-Z (stops the xclock. Ctrl-C would kill it)
bg
ps |grep xclock
kill <pid for xclock>
(or kill -15 <pid for xclock> for SIGTERM,
or kill -9 <pid for xclock> for SIGKILL)
-
xcalc &
- From “EXAMPLES” in
man kill : “Kill all processes you can kill”
-
$ who
ajlewis2 pts/0 2006-11-25 21:54 (:0.0)
ajlewis2 pts/1 2006-11-26 14:38 (:0.0)
$ write ajlewis2 pts/1
hello there!
what's happening?
- After typing the write command, there may be a beep and there will be a new line. Type message. After you are finished, do Ctrl-C.
- The write command is not enabled in all distributions.
- In that case, for an alternative to this command, try:
-
$ who
ajlewis2 pts/0 2006-11-25 21:54 (:0.0)
ajlewis2 pts/1 2006-11-25 21:54 (:0.0)
$ echo "Hello user, let's have lunch together?" > /dev/pts1
- displays bootup messages from the kernel and modules. System administration command.
- practically instantaneous (.005 seconds) since there are few files in the directory
-
ps aux | grep "ajlewis2"
(replace ajlewis2 with the appropriate user name)
- There are a lot of options to read about in man ps. To find a UID, there is a command called getuid. However, it is not recognized in Debian Etch.
-
uptime
-
tty, or who
- [Removed question from exercises]
- mount, umount, su. Commands that affect the system, but may need to be run by authorized users
- Look for processes at the top of:
4.6.2. Booting, init, etc.
- ?
- ?
-
telinit 5
telinit 3
- ?
-
uname -r
- One of the following or similar:
- Move
deliver_pizza to /etc/rc4.d or wherever your run level 4 script links are located
- Move
deliver_pizza to /etc/init.d and link to it from /etc/rc4.d
- Simply link to the current location of
deliver_pizza from /etc/rc4.d
- Create a new script that runs
deliver_pizza and put it in /etc/init.d with a link to it in /etc/rc4.d
4.6.3. Scheduling
-
(sleep 600; echo Pasta\'s ready) &
-
at 20:58
at> cp -a ~/* /var/tmp/anita-home/
- Then do Ctrl-D which produces
at> <EOT>
crontab -e and add:
00 12 * * 1-5 cp -a ~/* /var/tmp/anita-home/
- Check for results after the time has passed
- Should get an email reporting error. I don’t have internal mail set up.
Home
Copyright (c) by the authors.
This section of the wiki is licensed under the terms of the GNU Free Documentation License.
See the LBook-licensing page for details.
Linux® is a registered trademark of Linus Torvalds.
Welcome to LinuxBasics.org - The online community that helps people to get Linux installed and running.
During this tour, we will guide you through our website, which has many facets which wait to be explored
The biggest project we are running is our Linux course, based on the LBook.
The book is stored in wiki-format, which enables us to update and correct it as we go.
Discussion for the course is on our Forum
Our Forum is used for discussion of Linux and for questions and answers.
Search the mailing-list that was used prior to the Forum.
The questions and answers from the list are stored in the list's archives in order to help others with the same problems.
Every weekend, we meet to chat in IRC. These meetings are NOT mandatory, but are a nice chance to get to know each other better.
IRC is also a great tool to solve many problems, since it is very quick and easy to ask for more details if you need them.
The tutorials are one of the oldest sections on the LBo-website.
Here you find explanations on how to do specific tasks in Linux. Many of the tutorials were created after a certain problem
has been discussed (and usually solved :) on the mailing-list.
The tutorials are categorized in
In the links section, you find outbound links to other valuable resources.
One of our later additions to the site. We maintain a mirror of the Linux Documentation Project. This is our contribution to the "home of the HOWTOs"
Another later addition is the LBlog which focuses on how to do stuff on the Linux Desktop. It begins with the basics on installing Ubuntu.
Using the integrated site-search, you can search the tutorials, the LBook and all other wiki-pages
Simply type the search term into the box in the upper-right corner of our webpages
As a community, we depend on your feedback and collaboration. So, if you have something to share with others, please contact us. If you have a suggestion for a topic you would like to see covered here, please add it on the Wishlist.
There are many ways to contribute: You can answer questions on the Forum, you can write a complete tutorial or just a step-by-step documentation on how you completed a specific task using linux. Ask questions if the information on this site is not clear, tell us if we got something wrong, spell-check our writings, whatever.
We are looking forward to meeting you at LinuxBasics.org
Anita, Jisao, Sam and Stefan