Install a Linux system, log in, and run simple commands using the shell.
Objectives
- Setting up a working Linux environment.
- Logging in, activating the user interface, and logging out.
- Changing user passwords
- Reading manuals
Setup
- Download and install Oracle VM VirtualBox, a free and open-source hypervisor.
- Download and install Ubuntu Server (the LTS server ISO file) on VirtualBox.
- You may refer to this tutorial, which will walk you through the steps of installing Ubuntu virtual machine using VirtualBox. While the tutorial is for installing Ubuntu Desktop, the steps should be the same for installing Ubuntu Server.
Lab Exercises
1. Basic info
Obtain the following results:
The name and version of the Operating System using the commands:
lsb_release -a
and
uname -a
The logged in user name using the command
whoami
.whoami
The host name using the commands
hostname
andhostnamectl
.hostname
and
hostnamectl
2. Navigating the filesystem
Change directory
cd
to /root. What happens?cd /root
Change directory
cd
to your home directory usingcd /home/username
(change username with the your actual username) orcd ~
. The tilde (~) is a Linux “shortcut” to denote a user’s home directory.cd /home/username cd ~
Now
cd
to..
. Use thepwd
command. Where are you now?cd .. pwd
3. Getting help
man
- Read the manual for the ls command using
man ls
.man ls
- How to list hidden files?
- How to display the output in a long listing format and print directory size info in human readable format (e.g., KB, MB, GB)?
- Read the manual for the apt, the package manager for Ubuntu using
man apt
. What are some command options you can use with apt?
The advanced package tool (apt), is a powerful tool that simplifies the process of installing and uninstalling software packages.
apropos
- The apropos tool is particularly useful when searching for commands without knowing their exact names. apropos’s syntax is:
apropos
followed by the search keywords.The database searched by apropos is updated by the mandb program, so you need to update it as a root user using
sudo mandb
, which will create or update the manual page index caches.sudo mandb
Search for disk related tools using
apropos disk
:apropos disk
- What is the name of the tool that gives you information about disk usage and space? If you have a problem, see the notes section below.
Use apropos to find the editing programs that are available on your system? If you have a problem, see the notes section below.
Note: if the command
apropos
returns nothing appropriate on every search keyword you use or does not show recently installed software packages, then you’ll have to runmandb
as a root usingsudo mandb
and run apropos again.
Submission
Submit your answers with screenshots showing the commands you executed as a PDF file by the due date.
Lab submissions are due one hour before the next week’s lab begins.