Edit Page

Lab 1: Getting Started

Install a Linux system, log in, and run simple commands using the shell.

Objectives

  1. Setting up a working Linux environment.
  2. Logging in, activating the user interface, and logging out.
  3. Changing user passwords
  4. Reading manuals

Setup

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 and hostnamectl.

    hostname
    

    and

    hostnamectl
    

2. Navigating the filesystem

  • Change directory cd to /root. What happens?

    cd /root
    
  • Change directory cd to your home directory using cd /home/username (change username with the your actual username) or cd ~. The tilde (~) is a Linux “shortcut” to denote a user’s home directory.

    cd /home/username
    cd ~
    
  • Now cd to .. . Use the pwd 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 run mandb as a root using sudo 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.