Ubuntu, by default, displays a rather wordy message upon login. This message is generated
by a program called motd (message of the day). The message you see on login is
created by executing the bash scripts in /etc/update-motd.d (in alphabetical order).
So, these scripts are named starting with two-digit numbers to ensure the desired order
of execution. You can visit that directory and manually execute the scripts one-by-one to
get a sense of which scripts are causing which outputs.
Do the following in /etc/update-motd.d:
- Create a subdirectory called archive.
- Determine which scripts you want to keep and which you want to remove from your
login screen and move those you want to remove into the archive directory.
- Create a new script called 60-disk-usage that will display current disk
usage of your root partition. The output of the script should look something
like this:
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.7G 2.5G 5.2G 33% /
NOTE: The command to get disk usage output in this format is: df -h
However, that command will produce disk stats on a variety of partitions we
are not interested in. You need to experiment with ways to show only the
header and the line that specifies the root partition. There are a wide
variety of ways to show only this line. Play around until you find something
you are satisfied with.
- Test your new-improved login screen.
Begin working through the instructions given for
Homework #5