Lab - Intro to UNIX / Linux
is part of the broader
- On student machines (PCs in labs, and student.computing.dcu.ie) DCU uses:
- As my main DCU machine, I use:
Getting started on DCU Linux
- The Linux distribution currently
used at DCU is
currently used is
- How to find your Linux/Unix version
- There are many different GUIs.
What you see in the GUI here may not be the same on other Linux/Unix.
- GNOME 3 - Click "Activities" or press Windows key to get:
- Activities menu
- Search box
- RHS edge - multiple desktops
- Keyboard shortcuts:
- 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
- Activities menu
- Remove from Favourites
- All applications - Add to Favourites
- File Browser
- Top RHS
- Universal access
- Lock - Swipe up to unlock
- GUI text editor - gedit
- right-click on file - open with gedit
- gedit file &
- launch any windowed app from command-line
to detach app
or else command-line hangs until app exits
- saves backup files: file~
- has syntax highlighting
- touch file - make new file
- or just run gedit with new filename - if doesn't exist, gedit creates it
- "gedit" menu in top bar - Preferences
- Other editors
- Command-line editor - nano
- Ctrl-O - Save
- Ctrl-X - Exit
- Ctrl-Y - PgUp
- Ctrl-V - PgDn
- Ctrl-A - Home
- Ctrl-E - End
- Other Command-line editors
- File Browser
- dirs = directories (folders)
- [cryptic View icon] - Show Hidden Files
(see config files later)
- Ctrl-L - edit address line directly
- Wastebasket is in here - not on desktop
- Linux has all the usual applications you need
(though not all are installed on the DCU Linux setup):
- 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.
- 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
- Terminal -
- very powerful
- similar to all other Linux/UNIX
- Search for "GNOME Terminal" - Add to Favourites
- Increase font: Ctrl-Shift-+
- Default shell here is
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.
- Command-line keys:
- ls -a
- ls -l
- ls -al
- echo * (all non-hidden files)
- echo .* (all hidden files)
- echo .* * (all files)
- ls -l *
(if dir, will display contents)
- ls -ld *
(if dir, display name not contents)
- ls -l .* (don't need -a if going to actually name the hidden files)
- ls -ld .*
- . (current dir)
- .. (parent dir)
- environment variables
- set > file.txt
- 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)
- Shared, multi-user, file system:
- go home: cd
- go up to parent dir: cd ..
- go back to last dir: cd -
- command history
- up/down arrows
- 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
Top 25 Funny And Interesting Linux/*nix Terminal Commands
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
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:
to find "tracker" processes and kill them.
- Then remove .cache
Wine uses disk space
Another program that uses a lot of disk space
rm -r .wine
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.
Shakespeare files use relative
HTML links, not absolute
so can download to any location and the links still work ok.