Introduction To The Linux and Unix Command
Introduction To The Linux and Unix Command
https://goo.gl/BXvXK9
HPC support team
4 staff
Discussion list
Contact: arc-help@lists.leeds.ac.uk
ARC/HPC Training Portfolio
HPC 4:Introduction
ARC training to MPI and MPI/IO
www.arc.leeds.ac.uk
arc-help@lists.leeds.ac.uk
Me:
m.callaghan@leeds.ac.uk
Introductions and
Motivations
[RIGHT-CTRL] + F
What is BASH?
What is a shell?
MobaXTerm
Launch...
Filesystem basics
Forward slash / and backslash \
Filesystem basics: absolute path
Filesystem basics: relative path
Exercise 1
First, get hold of the sample data we will be using today. Type this in your
command shell:
wget --no-check-certificate
https://github.com/callaghanmt/shell-training/archive/master.zip
Exercise 2:
Two new commands:
• The sort command will sort lines alphabetically
• You can use the cut command to split lines of text based on a given character
e.g. cut -d ',' -f 2 will split lines around the comma and give you the second part
Combine cat, cut, and sort to print out the Latin names from birds.txt in
alphabetical order Save the output to a new file
Exercise 3
List all the animals on the Isle of Mann alphabetically and find the 50th item in that
list.
https://goo.gl/66zbCO
Exercise 4
shell-training/data/ contains 300 data files, each of which should contain 100
values. One of these files is missing some data though. . .
Use a series of commands connected by pipes to identify the file with missing data
hint wc -w will tell you the number of values in a file, sort -n will sort numerically
Exercise 5
• Use a for loop to create five directories called calculation_?, where ? is a
number.
• Use a loop to create five directories, each one the parent of the next.
Exercise 6
• In the wildcards directory, create a variable called files listing all of the text files.
• Loop through this list and print out the first line from each file.
Exercise 7
What will this command print to the screen?