Welcome page - Command Quicklist - Troubleshooting - LINUX installation
These pages contain documentation of how to work in our LINUX
environment. We hope you find all necessary information. Moreover, we
hope that you inform
us about all usefull suggestions to complete this documentation.
indicated with is for advanced users, freshmen can
skip these parts.
First of all our machines run under Linux
This is a Un*x-like operating system that is freely available from the
Although this operating system is free it is a full fledged OS which
everything a serious system administrator looks for. Due to its free
Linux is not subjected to the laws of the free market. As a result
is update and enhanced almost every day since there are no investments
should pay-off before the introduction of new technology.
In the beginning a Un*x-like operating
system may look much more
difficult to use than other systems like MacO$ or M$ Windows. With a
little patience you will discover that this not the case and the you
can even do more with the same machine simply by using a good OS on it.
But the following 'things' are confusing at first:
- Most if not all the command lines interpreters are case
sensitive. This means that LS does not mean the same
as ls. For M$ users this one of the strangest things
and it get even more annoying when
you know that filenames are also case sensitive. So be careful
you save something on disk.
- A command interpreter is called a shell under Un*x, not a
prompt. It is also called a Console or Terminal.
- A Linux mouse has three
buttons: the third middle button for copying and pasting. Select
something to copy it, click the middle button for pasting (in a console
or emacs). When your (Windows) mouse has only 2 buttons, you can do
this by clicking both simulaneously.
- Each user has its own home directory. This is part of the
security features provides by the OS. This means the other users can
not remove your files and you can not remove theirs if the permissions
are set correctly.
All your files should be in your home directory, this is the only place
where you have the permission to write, rename or delete files.
- There are no drives! Everything is a file. This uniform view has
the advantage requiring no new command for accessing different drives.
you, as a normal user, can not see the difference between one drive and
another. This drive can be a floppy, a hard disk but also network drive
yet there is
no difference. I mention this, but this is not really important for
- M$ users watch it! Under Un*x the slash used to define a path to
file is the normal slash (/) not the back slash (\)
like in M$ OS-es. In other words everything is like this: '/path/file'
and not like this '\path\file'.
- What to do if you have a problem with a Un*x command? Easy, most
the commands have a so called man page (from manual page).
This page describes the functions of the command and its different
options. You just open a shell and type 'man xxx'.
Learn more about UNIX and linux
- Introduction to Unix
- chapter 3: learn the basics about the filesystem!!
- chapter 5: learn important UNIX basics like pipes, redirection,
- chapter 7: utilities
(see also below: console commands)
- chapter 8: about shell scripts
- Linux Forum: a lot of
- advanced commands (like sed)
- For a good linux manual, look under emacs:
- select menu-item Help => Manuals => Browse Manuals With
- or CTRL-h-i (keep CTRL button down, press h followed by i)
- see under Miscellaneous
- move your cursor on a bold word and press ENTER to
- press 'u' for up, 'n' for next and 'p' for previous page
We use the KDE
It has a Windows look, so using it should be straight forward.
- Note that it is Single-click to start a program or
To prevent a program or file to activate, keep the Control
button pressed when you click. For example when you want to move or
copy your file(s) to
a different directory or you want to delete it. To select multiple
files, also keep the Control button down.
- You have 4 desktops or workspaces, denoted by
One, Two, Three & Four. A program is opened in the current desktop.
They are efficient to organise your work. Just click them in the
toolbar to change between them.
Use a different desktop for each task you are doing (programming,
- Use Alt-TAB to change between windows in your workspace.
- The most important application are placed in the toolbar, more
be found under the big K (down left).
A lot of the configuration of your
system is done by so-called environment
variables. These are variables -like any variable in a program-
known in your whole environment, like makefiles, programs etc. You can
all these variables with the command env (type in a console).
Create/assign them with setenv var value, use them with a $
sign, for example to view the content, type echo $var in
Important predefined variables:
- HOME or home : the pathname of your home
- PATH or path: specifies the path that the
shell searches when asked to execute a command. If an executable is not
the path, you must specify its full pathname. Under Un*x you can only
the file the are in your path. This path is stored in
the PATH environment variable of every shell. So don't be surprised if
you can see a file but you can not execute it even if you 'stand' in
the same directory. There are two solutions to your problem: give
the full path to the executable
on the command line or change your PATH environment variable. Ex:
- USER or user: contains you login userid.
You have 2 important configuration
files, they are placed in your home
and start with a dot.
- .cshrc: contains the definition of important
These are called hidden files
(start with a dot), to view
- in a console: use ls -all
- in the file manager: menu View => Show Hidden
Login at the PC's of the 3rd floor
10.0.16.101 to 10.0.16.108
- Choose one among the following computers (use this IP-address when creating the
tunnel with putty instead of localhost):
- Choose Port according to wanted resolution and color depth:
- Specify the tunnels correctly (see
doc), don't forget to save your putty configuration.
- Too high resolutions are sometimes not accepted.
- Sometimes you'll better delete the xxx.rnd file in which putty
stores your configuration.
- Check whether cluster computer is still 'alive'. Try an ssh node01 when connected
home For security reasons we don't put the
correct addesses on the web, you'll have to ask us.
login graphically with
VNC under Mac
You can connect to our Linux system from your home PC, using ssh
(not Telnet, because it doesn't
give a secure connection).
Install putty as a terminal (homepage
Connect to one of the above computers. You get a console, no graphical
interface is available. Use for example nano myfile
as simple editor
below, console commands).
You can access your files on our system with secure ftp
than the simpe ftp), use for instance WinSCP
Work with Floppy's
Before you can read from or write to
floppy's, you'll have to mount
the floppy, type in a console:
Now you can read your files from this
with the file manager or console (cd
/floppy and ls *).
When finished, don't forget to unmount with:
- if mount /floppy doesn't work, consult the mount table (more
/etc/fstab) and look for the entry with floppy and vfat,
on some machines
you have to mount /mnt/floppy
- you must be logged in on the machine you're working on
Configure your desktop: add links to programs
- Console or terminal (in toolbar)
- File manager Konqueror
- Your personal files are under 'My Home'
- Use the right mouse click for folder and file operations
- Keep the Control key down to prevent the file to be started
(remember that it is a Single-Click environment)
- Configure it
- set in the View menu item: Show Tree & Text View
- Push the Reload button to view the changements of the directory
- a simple text editor Kedit (in toolbar)
- Mozilla: for browsing the net and reading your
- Kwrite or use the more professional Kate
- a simple file editor, with colouring of C++, html, xml, ...
- F11: show Line Numbers
- Ctrl+I: Indent, Ctrl+Shift+I
to Unindent (also when multiple lines are selected)
- Ctrl+D: Comment, Ctrl+Shift+D to
Uncomment (also when multiple lines are
- Ctrl+B: Toggle bookmark
on current line<>
- Alt+PageDown: go to
next bookmark, Alt+PageUp: go
to previous bookmark
- use Ksnapshot to make snapshots of screens
- look under Graphics => Snapshot
- use Kview to view images
- look under Graphics => Image Viewer
- use mpg123 or XMMS to listen to
- for ftp and its commands, look here
- Open the templates window (on your desktop). Drag the "Program"
to your desktop, keep the Control button pressed & select copy!. It
will be copied to the desktop.
- Now you have a program link, to configure it, right-click on it
and select "Properties"
- Under the 'General' Tab, you can specify the name of the link (eg
- under the 'Execute' Tab, you should specify the program you want
run (see higher for the right path). You can also select a different
icon by clicking the icon.
As Linux is a UNIX clone, the commands are the same.
Here is a list of the most usefull commands (look here for
info!! or man
For more details, check the above links.
- ls: list contents of directory
- ls -al: also show hidden files (start with a dot)
- lc: show all c++ files (makefile, c files, header
- cd directoryname: change directory
- when you ommit the directory, you go to your home directory
- cd .. : go back to the parent directory
- cd ~: go to your home directory
- pwd: show the path of the current directory
- mkdir directoryname: create a directory
- ssh hostname: go to another machine (eg ssh info9) and work on that
- use exit to go back
- the first time you connect to that specific machine, answer yes
he asks for a secure connection and give your password.
- with hostname you
the name of the computer you are working on
- cp pathname-filename pathname: copy file to a different
- ~/ is your home directory (eg cp mydoc.txt ~/docs/)
- mv pathname-filename pathname: move file to a different
- nano filename: offers
a simple command-line based text editor. Below you see the major
commands, ^ means the ctrl key, eg. ctrl-x to quit, (it will ask for
- use Control-c to stop a running program!!.
- use the Up & Down Keys to repeat commands
(the command history)
- copy: just select a text, it is automatically copied to
- paste: click on both mouse buttons at the same time
- TAB: to complete the name of a program, file or
directory, press TAB again to get a list of all possibilities.
- grep (look for a word in
files), diff (compare
2 files for
differences): see documentation
- ex: grep -r "blabla" * for
recursive (search subdirectories) search of blabla in all files
- for counting the number of lines in which a word occurs:
- grep blabla <file> | wc
- wc = word count,
-l option is for
the number of line
- vi is a command-line based text
editor, looks very strange if
you are used to window-based editors
- edit file with vi file
- commands that should be typed on a line:
- i to go in insert mode on that line
- Escape to quit this mode
- dd delete current line
- :w save file
- :q quit vi
- :q! quit vi without saving the file
- archive your
for example tar:
- create an archive (myfiles.tgz): tar -czvf myarchive.tgz *.*
(or multiple files, or in directories, like dir/*.*, etc)
- with the -z option, the archive is also compressed
- type tar --help
for all options
- extract archive: tar -zxf myarchive.tgz
- use the TAB to complete incomplete directory and
(if you don't remember the full name of your file or you're just lazy)
- use the keys up & down to redo commands you
typed before (very usefull!!)
- use the middle mouse button for copying, as explained here.
- for help about commands:
- command --help
- man command: consult the manual pages
Scripts are very powerfull to automate some tasks. Run them by simply
typing there name in a console.
There are many shells you can use to write scripts:
- C Shell:
- start script with line #!/bin/tcsh (tcsh instead of
NOT FORGET: make it an executable with command: chmod +x
- doc or
(Unfortunately, not everything seems to apply for our system)
- check the examples:
- sed.csh: use sed to replace a
by another in a file
- sed_arg.csh: use program
- files.csh: scans all files
- forallfiles.csh: runs
a command of all files, and recursively on all directories
convert all filenames of a directory to lower case names
run multiple experiments with different parameters
- $$ find out following scripts: check file extension, use
special characters in grep & sed, replace windows-EOL with UNIX-EOL
- for calculations: @
y=$a + $b (watch out for the spaces !!!)
- fl.sh: remove all files from
floppy and copy files from directory to floppy (very fast!)
- run.sh: run program mutiple
times with different parameters
- crunch.sh: send
to all machines