+ All Categories
Home > Documents > Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t...

Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t...

Date post: 27-Mar-2020
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
53
Transcript
Page 1: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be
Page 2: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Linux Introduction

150209Martin Dahlö

[email protected]

Page 3: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Linux IntroductionIntroduction

You will not learn this now.Google it or look at lecture slides when you need it.

Practice makes perfect :)

Page 4: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

UPPMAX

Uppsala Multidisciplinary Center for Advanced Computational Science

(Uppsala supercomupter center)

Clusters Milou Tintin

Uses Linux

Page 5: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

UPPMAX

Uppsala Multidisciplinary Center for Advanced Computational Science

(Uppsala supercomupter center)

Clusters Milou Tintin

Uses Linux

Page 6: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Why Text?

UPPMAX is only accessible through SSH (Secure Shell) for security and speed

Command Line Interface (CLI)

Scary at first, but wonderful to work with Automation and scripts Super computing not

possible without it

Page 7: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

Page 8: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

ls – list the content of a directory

Page 9: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

ls – list the content of a directory

Page 10: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

ls – list the content of a directory

Page 11: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

ls – list the content of a directory

Page 12: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

cd – change working directory cd <directory name> = down cd .. = up

Page 13: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

cd – change working directory cd <directory name> = down cd .. = up

Page 14: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

cd – change working directory cd <directory name> = down cd .. = up

Page 15: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

cd – change working directory cd <directory name> = down cd .. = up

Page 16: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

pwd – print working directory

Page 17: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

pwd – print working directory

Page 18: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Navigation Commands

Summary ls – list content of directroy cd – change working directory pwd – print working directory

Page 19: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

Copy a file

cp <name of original> <name of copy>

Page 20: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

Copy a file

cp <name of original> <name of copy>

cp myText.txt copy_of_my_text.txt

Page 21: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

Copy a file

cp <name of original> <name of copy>

cp /home/dahlo/test.txt ../../myDocs/

Page 22: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

Move a file

mv <name of original> <name of copy>

mv myText.txt copy_of_my_text.txt

Page 23: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

Move a file

mv <name of original> <name of copy>

mv /home/dahlo/test.txt ../../myDocs/

Page 24: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

View content of a file

less <file name>

less readme.txt

Page 25: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

View content of a file

less <file name>

less readme.txt

Page 26: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

View content of a file

less <file name>

less readme.txt

(q to exit)

Page 27: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Head

View the first rows of a file head <filename>

Page 28: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Head

View the first rows of a file head <filename>

Page 29: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Head

View the first rows of a file head <filename>

Page 30: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Head

View the first rows of a file head <filename>

Page 31: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Head

View the first n rows of a file head -n <nr of lines> <filename>

Page 32: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Tail

View the last rows of a file tail <filename>

Page 33: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Tail

View the last n rows of a file tail -n <nr of lines> <filename>

Page 34: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

Edit content of a file

nano <file name>

nano readme.txt

Page 35: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

Edit content of a file

nano <file name>

nano readme.txt ^ = ctrl

Page 36: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Interaction Commands

Remove a file

rm <file name>

Ex.

rm readme.txt

rm ../../../file1.txt

rm /home/dahlo/test.txt

There is no trash bin in Linux! Gone is gone..

Page 37: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Wildcards

*

Works with most Linux commands

Page 38: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Wildcards

*

Works with most Linux commands

Page 39: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Wildcards

*

Works with most Linux commands

Page 40: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Wildcards

*

Works with most Linux commands

Ex: cp *.txt directory1/

Page 41: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Wildcards

*

Works with most Linux commands

Ex: rm *.tmp

Page 42: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Good to Know Commands

TABCOMPLETION

Never write a path or filename without it!

Page 43: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Good to Know Commands

TAB COMPLETION

Never write a path or filename without it!

Page 44: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Good to Know Commands

TAB COMPLETION

Never write a path or filename without it!

Page 45: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Good to Know Commands

TAB COMPLETION

Never write a path or filename without it!

Page 46: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Good to Know Commands

TAB COMPLETION

Never write a path or filename without it!

Page 47: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Good to Know Commands

How much is the computer working?

top

Page 48: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Good to Know Commands

Instructions how to use programs Easy to forget syntax Manual pages

man <program name>

Ex.

man ls

(q to quit)

Page 49: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Good to Know Commands

How do I log out? exit

Exits only the current terminal

Page 50: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Good to Know Commands Summary

cp – copy a file mv – move a file less – view a file nano – view and edit a file rm – remove a file head / tail wildcards tab completion – use it top – see active processes man – manual pages exit – Log out curren terminal

Page 51: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Connect to UPPMAX

Secure SHell connection (ssh)

ssh -X <username>@milou.uppmax.uu.se Ex: ssh -X [email protected]

Terminal in Linux and OSX MobaXterm in Windows (http://mobaxterm.mobatek.net/)

Putty also alternative, but not as good..

Page 52: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Reservations

Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon &

--reservation will be proj id and day Will start a node which you have access to

Check which node with squeue -u username ssh to given node, from within UPPMAX

Page 53: Linux Introduction - GitHub Pages · Reservations Special for this course salloc -A g2015005 -t 07:00:00 -p core -n 1 --no-shell --reservation=g2015005_mon & --reservation will be

Laboratory time!


Recommended