When you log into the cluster you start in your home directory. These are the commands you will use every single day.
Command
What it does
pwd
Shows your current location
ls
Lists files and folders here
ls -l
Detailed list with permissions, size, date
ls -a
Shows hidden files too
ls -lh
Detailed list with human readable sizes
cd foldername
Go into a folder
cd ..
Go back one level
cd
Go straight to home directory
cd /full/path
Jump to any location directly
Tip: Press Tab to autocomplete a folder or file name. Press it twice to see all matching options. This saves a lot of typing and prevents typos.
Example Session
Follow this from top to bottom. Notice how the prompt changes as you move between folders.
# Check where you are after logging in[ms21080@login1 ~]$pwd/home/ms21080# See what is in your home folder[ms21080@login1 ~]$lsprojectsnotes.txtsubmit.sh# Detailed view with sizes and dates[ms21080@login1 ~]$ls -lhdrwxr-xr-x 3 ms21080 ms21080 4.0K Jan 12 10:20 projects-rw-r--r-- 1 ms21080 ms21080 512 Jan 11 14:32 notes.txt-rw-r--r-- 1 ms21080 ms21080 248 Jan 12 09:05 submit.sh# Go into projects folder[ms21080@login1 ~]$cd projects[ms21080@login1 projects]$lsmd_simulationdft_run1# Go deeper[ms21080@login1 projects]$cd md_simulation[ms21080@login1 md_simulation]$pwd/home/ms21080/projects/md_simulation# Show hidden files too with -la[ms21080@login1 md_simulation]$ls -ladrwxr-xr-x 2 ms21080 ms21080 4096 Jan 12 10:20 .drwxr-xr-x 4 ms21080 ms21080 4096 Jan 12 10:20 ..-rw-r--r-- 1 ms21080 ms21080 128 Jan 12 10:20 .hidden_config-rw-r--r-- 1 ms21080 ms21080 2048 Jan 12 10:20 input.dat# Go back one level[ms21080@login1 md_simulation]$cd ..[ms21080@login1 projects]$pwd/home/ms21080/projects# Jump straight home from anywhere[ms21080@login1 projects]$cd[ms21080@login1 ~]$pwd/home/ms21080# Jump to scratch directly using full path[ms21080@login1 ~]$cd /scratch/ms21080[ms21080@login1 ms21080]$pwd/scratch/ms21080
mkdir — Creating Folders
mkdir creates a new folder. Use -p to create a whole nested path in one go. Notice we do ls after each step to see what changed.
# Start — home directory is empty except notes.txt[ms21080@login1 ~]$lsnotes.txt# Create a new folder[ms21080@login1 ~]$mkdir my_project[ms21080@login1 ~]$lsmy_projectnotes.txt# Create nested folders in one go with -p[ms21080@login1 ~]$mkdir -p my_project/run1/output[ms21080@login1 ~]$cd my_project[ms21080@login1 my_project]$lsrun1[ms21080@login1 my_project]$cd run1[ms21080@login1 run1]$lsoutput# Go back home[ms21080@login1 run1]$cd[ms21080@login1 ~]$
cp — Copying Files and Folders
cp copies a file. To copy a whole folder use -r (recursive).
[ms21080@login1 ~]$lsmy_projectinput.datnotes.txt# Copy a file (creates a new file alongside original)[ms21080@login1 ~]$cp input.dat input_backup.dat[ms21080@login1 ~]$lsmy_projectinput.datinput_backup.datnotes.txt# Copy a file into a folder[ms21080@login1 ~]$cp input.dat my_project/run1/[ms21080@login1 ~]$ls my_project/run1/input.datoutput# Copy a whole folder with -r[ms21080@login1 ~]$cp -r my_project my_project_backup[ms21080@login1 ~]$lsmy_projectmy_project_backupinput.datinput_backup.datnotes.txt
mv — Moving and Renaming
mv is used for both moving a file to another folder and renaming it. There is no separate rename command in Linux.
[ms21080@login1 ~]$lsmy_projectmy_project_backupinput.datinput_backup.dat# Rename a file — old name is gone, new name appears[ms21080@login1 ~]$mv input_backup.dat input_v2.dat[ms21080@login1 ~]$lsmy_projectmy_project_backupinput.datinput_v2.dat# Move a file into a folder[ms21080@login1 ~]$mv input_v2.dat my_project/[ms21080@login1 ~]$lsmy_projectmy_project_backupinput.dat# Confirm it is now inside my_project[ms21080@login1 ~]$ls my_project/run1input_v2.dat# Rename a folder the same way[ms21080@login1 ~]$mv my_project_backup old_backup[ms21080@login1 ~]$lsmy_projectold_backupinput.dat
rm — Deleting Files and Folders
rm deletes a file. To delete a folder and everything inside it use rm -rf.
[ms21080@login1 ~]$lsmy_projectold_backupinput.dattemp.log# Delete a single file[ms21080@login1 ~]$rm temp.log[ms21080@login1 ~]$lsmy_projectold_backupinput.dat# Delete a folder and everything inside it[ms21080@login1 ~]$rm -rf old_backup[ms21080@login1 ~]$lsmy_projectinput.dat# old_backup is completely gone
Warning: There is no recycle bin in Linux. Once you run rm the file is gone permanently. Be very careful with rm -rf. Always double check the path before running it.
cat, less, head, tail
Command
What it does
Best for
cat file.txt
Prints whole file at once
Small files
less file.txt
Opens scrollable viewer
Large files and logs
head file.txt
First 10 lines
Quick peek at file start
head -n 20 file.txt
First 20 lines
Custom line count
tail file.txt
Last 10 lines
Quick peek at file end
tail -n 50 file.txt
Last 50 lines
Custom line count
tail -f file.txt
Follows file as it grows live
Watching a running job log
Use less for big files: Never use cat on a large file as it will flood your terminal. Use less instead. Press Space to scroll down, b to go back, q to quit.
Example Session
[ms21080@login1 ~]$lssubmit.shjob.outoutput.dat# Print a small script file[ms21080@login1 ~]$cat submit.sh#!/bin/bash
#PBS -N MyJob
#PBS -q short
#PBS -l nodes=1:ppn=4
python script.py# Check last few lines of job output[ms21080@login1 ~]$tail -n 5 job.outStep 980/1000 | Loss: 0.0421
Step 990/1000 | Loss: 0.0398
Step 1000/1000 | Loss: 0.0374
Training complete.
Saved to output.dat# Watch a log update live as the job runs# Press Ctrl+C to stop watching (job keeps running)[ms21080@login1 ~]$tail -f job.outStep 100/1000 | Loss: 0.8231
Step 101/1000 | Loss: 0.8190
Step 102/1000 | Loss: 0.8144^C# Check first 5 lines of output file[ms21080@login1 ~]$head -n 5 output.datx y energy
0.000000 0.000000 -1042.31
0.100000 0.000000 -1041.98
0.200000 0.000000 -1041.45
0.300000 0.000000 -1040.87
grep — Searching Inside Files
Very useful for finding errors or warnings in long job output files.
# Search for the word "error" in log[ms21080@login1 ~]$grep "error" job.outFileNotFoundError: input.dat not found# Case insensitive search[ms21080@login1 ~]$grep -i "warning" job.outWarning: convergence not reached at step 450
WARNING: memory usage above 80%# Show line numbers of matches[ms21080@login1 ~]$grep -n "Step" job.out12: Step 1/1000 | Loss: 1.2341
13: Step 2/1000 | Loss: 1.1982
Using nano
nano is a simple text editor that runs inside the terminal. You will mostly use it to edit PBS scripts and config files. It is the easiest terminal editor to learn.
[ms21080@login1 ~]$lssubmit.shnotes.txt# Open an existing file[ms21080@login1 ~]$nano submit.sh [ nano editor opens — edit your file here ] [ Ctrl+O to save, Ctrl+X to exit ]# Create a brand new file[ms21080@login1 ~]$nano new_script.sh [ nano creates and opens the new file ][ms21080@login1 ~]$lssubmit.shnotes.txtnew_script.sh
Shortcut
What it does
Ctrl + O then Enter
Save the file
Ctrl + X
Exit nano
Ctrl + K
Cut the current line
Ctrl + U
Paste the cut line
Ctrl + W
Search for text
Why This Matters
The cluster has storage quotas. If your home or scratch folder fills up, your jobs will fail because they cannot write output files. Check your usage regularly after long runs.
Command
What it shows
du -sh *
Size of each item in current folder
du -sh .
Total size of current folder
du -sh /persistent/data1/ms21080
Total size of your main working directory
df -h
Disk space used and free on all partitions
Example Session
[ms21080@login1 ~]$lsmd_simulationdft_run1notes.txtsubmit.sh# Check size of each item in current folder[ms21080@login1 ~]$du -sh *1.2G md_simulation250M dft_run1
4.0K notes.txt
4.0K submit.sh# Total size of current folder[ms21080@login1 ~]$du -sh .1.5G .# Move to your working directory (persistent storage)[ms21080@login1 ~]$cd /persistent/data1/ms21080/# Check what is inside[ms21080@login1 ms21080]$lsAGAINcellwise_segmentation.CDataHGCAL# Check size of each item[ms21080@login1 ms21080]$du -sh *2.1G Data850M HGCAL
120M AGAIN
4.0K cellwise_segmentation.C# Total usage of your working directory[ms21080@login1 ms21080]$du -sh .3.1G .# Overall disk usage on cluster[ms21080@login1 ms21080]$df -hFilesystem Size Used Avail Use% Mounted on
192.168.12.247:/globalstorage1 102T 67T 30T 70% /persistent/data1
192.168.12.246:/globalstorage2 102T 27T 70T 28% /persistent/data2
10.10.10.248:/flashstorage/home 21T 1.9T 18T 10% /home
Note: If df -h shows scratch at 95% or above, contact the admin.
Connecting to the Cluster
You connect to the cluster using SSH. The login node IP address is 172.16.3.200. You must be on the IISER Mohali network or VPN for this to work.
# Basic SSH login[ms21080@laptop ~]$ssh ms21080@172.16.3.200
ms21080@172.16.3.200's password:
Last login: Mon Jan 13 09:21:14 2025 from 172.16.1.45[ms21080@login1 ~]$# SSH with -Y flag (enables graphical apps like xterm, gnuplot)[ms21080@laptop ~]$ssh -Y ms21080@172.16.3.200
[ms21080@login1 ~]$
When to use -Y: The -Y flag enables X11 forwarding. Use it only if you need to open a graphical window from the cluster on your local screen, for example running a GUI application or plotting tool. For normal terminal work you do not need it.
Recommended for Windows: MobaXterm
If you are on Windows, use MobaXterm. It gives you SSH, a file browser, and drag and drop file transfer all in one program. You do not need to type any scp commands at all.
Download it from mobaxterm.mobatek.net. The free version is enough for all HPC work.
# In MobaXterm, connect like this in the terminal tabMobaXterm$ssh ms21080@172.16.3.200
# The left panel shows your cluster files automatically# Drag files from Windows Explorer into the panel to upload# Drag files from the panel to your desktop to download
MobaXterm also supports X11 forwarding by default. So graphical apps launched from the cluster will open on your Windows screen automatically without needing the -Y flag.
scp — Copy Files Over SSH
scp works exactly like cp but over SSH. You run it from your local computer, not from inside the cluster. The format is always scp source destination where remote paths include the server address.
# Upload a single file from laptop to your home on cluster[ms21080@laptop ~]$scp myfile.txt ms21080@172.16.3.200:/home/ms21080/
myfile.txt 100% 512 1.2MB/s 00:00# Confirm it arrived[ms21080@laptop ~]$ssh ms21080@172.16.3.200 "ls /home/ms21080/"myfile.txt submit.sh notes.txt projects# Upload a whole folder to scratch (use -r for folders)[ms21080@laptop ~]$scp -r my_inputs/ ms21080@172.16.3.200:/scratch/ms21080/
input_1.dat 100% 2048 3.1MB/s 00:00
input_2.dat 100% 2048 3.1MB/s 00:00
config.ini 100% 128 0.5MB/s 00:00# Download a single result file from cluster to current local folder[ms21080@laptop ~]$scp ms21080@172.16.3.200:/home/ms21080/results.dat .
results.dat 100% 8192 4.2MB/s 00:00# Download a whole folder from cluster to local folder[ms21080@laptop ~]$scp -r ms21080@172.16.3.200:/scratch/ms21080/run1/ ./local_run1/
output_step1.dat 100% 512KB 2.1MB/s 00:00
output_step2.dat 100% 512KB 2.1MB/s 00:00
job.log 100% 128KB 1.8MB/s 00:00
The dot at the end: The . in a download command means copy it here, into my current local folder. You can replace it with any path like ~/Desktop/ or C:\Users\yourname\Downloads\.
Keyboard Shortcuts
Shortcut
What it does
Tab
Autocomplete file or folder name
TabTab
Show all possible completions
Ctrl + C
Stop the currently running process immediately
Ctrl + Z
Pause the current process and send it to background
Ctrl + R
Search through command history by typing
Up Arrow
Go to previous command
Down Arrow
Go forward through history
Ctrl + L
Clear the terminal screen
Ctrl+C is very useful: If a command is stuck or running too long or you ran the wrong thing, press Ctrl+C to stop it immediately.
Command History
The terminal remembers all your previous commands. You can search and reuse them instead of typing everything again.
# See recent commands[ms21080@login1 ~]$history 245 cd /scratch/ms21080
246 ls -lh
247 qsub submit.sh
248 qstat -u ms21080
249 tail -f job.out
250 history# Press Ctrl+R and start typing to search history(reverse-i-search)`qsub':qsub submit.sh# Press Enter to run it# Run a specific command from history by its number[ms21080@login1 ~]$!247Your job 10521 ("MyJob") has been submitted