When you log in to a Diamond workstation, whether in person, or remotely via NX, you are working in a Linux operating system. Most data processing at Diamond happens through a text-based terminal (also called a shell or command line).
If you have never used Linux before, don't worry. You only need a handful of commands to get around, and this page covers everything you need to get started.
Once you are logged in to your Diamond session, look for a Terminal application in the taskbar or application menu (it may be labelled "Terminal Emulator" or similar). Click it to open a terminal window.
You will see a prompt that looks something like:
[user@machine ~]$
This is where you type commands and press Enter to run them.
| Command | What it does |
| pwd | Show current folder path |
| ls | List files in current folder |
| ls -l | List files with details |
| cd folder | Move into a folder |
| cd .. | Move up one level |
| cd ~ | Go to home directory |
| cat file | Print file contents |
| less file | Scroll through a file (q to quit) |
| head file | Show first 10 lines of a file |
| tail file | Show last 10 lines of a file |
| mkdir name | Create a new folder |
| cp a b | Copy file a to b |
| mv a b | Move/rename file a to b |
| rm file | Delete a file (permanent!) |
| man command | Show manual for a command |
pwd
Print Working Directory - shows the full path of the folder you are currently in. Useful for confirming your location, particularly after navigating with `cd`.
ls
Lists everything in your current folder.
ls -l
A long listing - shows file sizes, permissions, and dates. Useful for checking when files were last modified.
ls /path/to/folder
Lists the contents of a specific folder without having to navigate there first.
cd folder_name
Changes Directory - moves you into a subfolder.
cd ..
Moves you up one level (into the parent folder).
cd /path/to/folder
Moves you directly to any folder using its full path.
cd ~
Takes you back to your home directory from anywhere.
Tip: Press Tab after typing the first few letters of a folder or file name and Linux will try to complete it for you. This saves a lot of typing and prevents typos.
cat filename.txt
Prints the entire contents of a file to the terminal. Good for short files.
less filename.txt
Opens a file for scrolling. Use the arrow keys to scroll, and press q to quit.
head filename.txt
Shows the first 10 lines of a file. Useful for quickly checking log files.
tail filename.txt
Shows the last 10 lines. Useful for checking whether a processing job completed successfully.
mkdir new_folder
Creates a new folder.
cp source.txt destination.txt
Copies a file. To copy a whole folder, add `-r` (recursive):
cp -r folder1 folder2
mv old_name.txt new_name.txt
Moves or renames a file (it works for folders too).
rm filename.txt
Deletes a file. This cannot be undone - there is no recycle bin.
rm -r folder_name
Deletes a folder and everything inside it. Use with care.
man ls
Opens the manual page for a command (in this case `ls`). Press q to quit.
ls --help
Most commands accept a `--help` flag that prints a quick summary of options.
| Shortcut | What it does |
| Tab | Auto-complete a file or folder name |
| Ctrl + C | Cancel a running command |
| Ctrl + L | Clear the terminal screen |
| Ctrl + A | Jump to the start of the current line |
| Ctrl + E | Jump to the end of the current line |
Your experimental data is stored under a path like:
/dls/{beamline}/data/{year}/{visit_id}/
OR
/dls/mx/data/{proposal}/{visit_id}/
Where `{beamline}` is the beamline (e.g. `i03`, `i04`), `{year}` is the year, and `{visit_id}` is your visit identifier. You can find your visit ID in ISPyB.
Diamond Light Source is the UK's national synchrotron science facility, located at the Harwell Science and Innovation Campus in Oxfordshire.
Diamond Light Source Ltd
Diamond House
Harwell Science & Innovation Campus
Didcot
Oxfordshire
OX11 0DE
Copyright © Diamond Light Source. Diamond Light Source® and the Diamond logo are registered trademarks of Diamond Light Source Ltd
Registered in England and Wales at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom. Company number: 4375679. VAT number: 287 461 957. Economic Operators Registration and Identification (EORI) number: GB287461957003.