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
used at DCU 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:
RHS edge - multiple desktops
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
Remove from Favourites
All applications - Add to Favourites
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
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
dirs = directories (folders)
[cryptic View icon] - Show Hidden Files
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):
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.)
on different OSes.
List of package managers
- 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.
List of Unix utilities
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.
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 .*
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:
current and parent dirs
. (current dir)
Example: When was the last change to the current dir:
ls -ld .
.. (parent dir)
go home: cd
go up to parent dir: cd ..
go back to last dir: cd -
!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
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
HTML links, not
so can download to any location and the links still work ok.