Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
power   over    running normally    but not nearly  as  much    as  the other
options. This is the default setting and will be used if you omit -m.

Setting the wake time can be done more than one way:


    As  shown   earlier,    you can use -s, which   specifies   the number  of  seconds
before waking.
You can also use -t, which allows you to set a specific time to wake but
formatted in the number of seconds since the beginning of UNIX time
(00:00:00 UTC on 1/1/1970). The date command can help you find this
number, which is a commonly used method of performing time-related
tasks in the UNIX/Linux world. You can do so like this: sudo
rtcwake -m no -t $(date +%s -d ‘tomorrow 06:30’).

See the man files for rtcwake and date for help and more options.


Here are a few tips to help you get started:


    The letters RTC stand   for “real-time  clock,” which   refers  to  the hardware
clock that is set in your BIOS and is kept running by the battery on your
motherboard. If your computer needs a new battery, as evidenced by the
time needing to be reset every time you turn the computer back on, or if
you have other clock-related problems, this command will not work for
you.
If you have problems using sleep, hibernate, or suspend on your system,
this command will not work for you.
You probably want to avoid using this command on a notebook
computer. Overheating and/or dead batteries are a real possibility if a
system wakes itself while the computer is in a laptop bag.
If you want to run a specific command when the computer wakes up, you
can do this the same way you chain other commands to run in a series:
Put && after rtcwake and before the command you want to run when
rtcwake has completed, as discussed in Chapter 12, “Command-Line
Master Class, Part 2.”

Basic Shell Control


Ubuntu includes a rich assortment of capable, flexible, and powerful shells.
Each shell is different but has numerous built-in commands and configurable
command-line prompts and might include features such as command-line
history, the ability to recall and use a previous command line, and command-

Free download pdf