Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

Online coding site: Ancient Brain



CA114      CA170

CA686      Projects

Free AI coding exercises

Lab - Intro to UNIX / Linux

Here at DCU you use:

In other places and companies you will meet:

Getting started on DCU Linux

  1. The GUI used here is GNOME 3.
  2. There are many different GUIs. What you see in the GUI here may not be the same on other Linux/Unix.

  3. GNOME 3 - Click "Activities" or press Windows key to get:
    1. Activities menu
    2. Search box
    3. RHS edge - multiple desktops

  4. Keyboard shortcuts:

  5. Show desktop:
    • GNOME 2 - Ctrl-Alt-D (actually toggle raise/lower all windows)
    • GNOME 3 - May need to set up a key for it:
      Settings - Keyboard - Shortcuts - Navigation - Hide all windows - Ctrl-Alt-D

  6. Activities menu
    • Remove from Favourites
    • All applications - Add to Favourites
    • File Browser
    • Settings

  7. Top RHS
    • Universal access
    • Power
    • Lock - Swipe up to unlock

Text editors

More GUI

  1. File Browser
    • dirs = directories (folders)
    • [cryptic View icon] - Show Hidden Files
    • Ctrl-L - edit address line directly
    • Wastebasket is in here - not on desktop

  2. Linux has all the usual applications you need (though not all are installed on the DCU Linux setup):

  3. Take Screenshot
    • GNOME 2 - PrintScreen pops up an application to save as PNG.
    • GNOME 3 - How to take screenshot - Different keys for whole screen or window or selection - Automatically saved as PNG in Pictures.

  4. Installing and updating applications on Linux is easy (if you have administrator rights):
    • APT package management tool ("apt-get" command)
    • Will need administrator rights to modify system directories. (e.g. Install Linux on your laptop and try it.)
    • Package managers on different OSes.
    • List of package managers


  1. Terminal - command line - very powerful - similar to all other Linux/UNIX
    • Search for "GNOME Terminal" - Add to Favourites
    • Increase font: Ctrl-Shift-+
    • Default shell here is bash. Other shells are installed.
    • Unix shell
    • List of Unix utilities
    • Shell script
    • In GNOME Terminal, if a URL appears in the text on the command-line, you can right-click on it to open it in browser.

  2. Command-line keys:

  3. ls
    • ls
    • ls -l
    • echo * (all normal, non-hidden files and dirs)
    • ls -l * (if dir, will display contents)
    • ls -ld * (if dir, display name not contents)

  4. hidden files
    • ls -a
    • ls -al
    • echo .* (all hidden files)
    • echo .* * (all files)
    • ls -l .* (don't need -a if going to actually name the hidden files)
    • ls -ld .*

  5. environment variables
    • set
    • set > file.txt
    • env
    • env | sort
    • echo HOME - the string "HOME"
    • echo $HOME - the global (environment) variable HOME
    • PATH = list of dirs searched for command when you type a command, separated by colons (:)
    • SHELL = shell we are using (default here is bash)

  6. Shared, multi-user, file system:
    • HOME = something like:

    • My test account is here:

  7. current and parent dirs
    • . (current dir)
    • Example: When was the last change to the current dir:
       ls -ld . 
    • .. (parent dir)

  8. cd
    • go home: cd
    • go up to parent dir: cd ..
    • go back to last dir: cd -

  9. command history
    • up/down arrows
    • history
    • h (alias)
    • !n - repeat command n
    • !string - repeat last command that began with string
    • !c - repeat last command that began with character c
    • !! - last command

Disk quota

You have 500 M disk quota.

If you get "Disk quota exceeded"

  • You need to delete some files.
  • To see which dirs are taking up room:
    du | sort -n 

MetaTracker uses disk space

A program called MetaTracker may be using a lot of your disk space.
  • MetaTracker uses a directory $HOME/.cache
  • This is safe to delete:
    rm -r .cache

  • See now instruction in default .bashrc that removes .cache for each new shell.

  • If .cache will not delete because MetaTracker is running:
    1. Use ps to find "tracker" processes and kill them.
    2. Then remove .cache

Wine uses disk space

Another program that uses a lot of disk space is Wine.
rm -r .wine

Installed at DCU - Works of Shakespeare

For testing manipulation of data with Linux commands, it helps if we have some data to manipulate. So I have installed the works of Shakespeare to use for testing.

These Shakespeare files use relative HTML links, not absolute HTML links, so can download to any location and the links still work ok.

ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.

Wikipedia: Sometimes I link to Wikipedia. I have written something In defence of Wikipedia. It is often a useful starting point but you cannot trust it. Linking to it is like linking to a Google search. A starting point, not a destination. I automatically highlight in red all links to Wikipedia and Google search and other possibly-unreliable user-generated content.