If you cannot access the /projects/racs_training directory, you are not a member of the racs_training PIRG. Please contact @emwin to make sure you are added before Thursday.
Change your working directory to the IntroHPC2025 directory.
cd IntroHPC2025
Change your working directory to talapas-check subfolder.
cd talapas-check
List the contents of the talapas-check subfolder. How many files are there?
ls, 2
Make a new file in the command line text editor of your choice (nano, vim, emacs, etc.) named README.txt with the words “My new file” inside.
nano README.txt or vim README.txt etc.
Output (concatenate) the contents of your README.txt to the terminal.
cat README.txt
The contents of Shakespeare’s The Tempest are contained in tempest.txt. Use a Bash command to print the last 2 lines of the play.
tail -n 2 tempest.txt
Bash Scripting on Talapas - Oct. 16th
General Knowledge:
Talapas has four login nodes. What Bash command could you use to determine which of the four login nodes you’ve connected to? hostname
What is the difference between a login node and a compute node?
Bash
Inspect the permissions of the contents of the talapas-check directory. ls -lha
Do you have permission to execute a-little-script.sh? How can you tell?
No, you do not have execute permissions.
Modify the a-little-script.sh to be executable by you.
chmod u+x a-little-script.sh
Before running a-little-script.sh, print its contents to the terminal
cat a-little-script.sh
What does this first line of this script mean?
It indicates this is a Bash script to be run by /bin/bash.
Run a-little-script.sh (it’s not a real Slurm job or doing real work, so it’s fine to run on the login node)
./a-little-script.sh
Using redirection, find all the lines in tempest.txt that contain the word “queen”, then count them.
One approach is cat tempest.txt | grep -i queen | wc -l.
Whichever approach you choose, you should find 11 lines that contain the word queen.