© crown copyright met office an introduction to linux precis workshop, university of reading, 23rd...

16
© Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

Upload: martin-peters

Post on 26-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

An Introduction to LinuxPRECIS Workshop, University of Reading, 23rd – 27th April 2012

Page 2: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

• What is Linux

• Installing Linux

• Directory structure

• Demonstration

• Useful websites

Contents

Page 3: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Tux the penguin, mascot of Linuxhttp://www.linux.org/

• A form of the Unix operating system.

• Created by Linus Torvalds.

• Freely downloadable from the internet.

What is Linux?

Page 4: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Installation of Linux

• openSUSE

• Insert Linux DVD and start up computer

• Installation instructions are in the PRECIS technical manual section 2.3

• List of software needed is in the PRECIS manual section 2.5

http://www.opensuse.org/

Page 5: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Organisation of Linux systems

H/W

Users & Apps

Shell

Commands & Utils

Kernel

Page 6: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Directory structure

//

binbin devdev homehome rootroot usrusr

dir1dir1 dir2dir2

Page 7: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Demonstration…

Page 8: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

command [options] [arguments]

(what to do) (how to do it) (what to do it with)

at least one space at least

one space

Page 9: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Navigating the file system

cd Change Directory

• cd home/dir1 to get to the dir1 directory

• cd .. to go up one directory (parent directory)

• cd $HOME or cd ~ to navigate back to your personal directory no matter where you are

• cd - goes to the former working directory

pwd Print Working Directory to display the path of the current directory

Page 10: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

List directory contents

ls Lists files and directories

• ls -a lists all files, including hidden ones.

• ls -l displays the file list in long format, including file details like size, time stamp, and owner.

• ls -F adds / after the name for directories, an * for executables, and @ for linked files.

• ls -r reverses the sort order (alphabetic or time).

• ls -t sorts the list by the time each file was created.

Page 11: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Copying and renaming files

cp Copy

• cp file1 file2 makes a copy of file1 in same directory

• cp file1 /dir2/ makes a copy of the file in dir2

mv To move or rename files

• mv file1 file001 to rename file1 to file 001

• mv file001 dir2 to move file001 into dir2

Page 12: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Creating and deleting files and directories

Files

• touch newfile.dat makes a new empty file or updates the time and date stamp on an existing file.

• rm file1 removes the file.

Directories

• mkdir dir3 makes a new directory.

• rmdir -r dir1 deletes the directory and the r flag is used to delete everything underneath it.

Page 13: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Useful shortcuts…

• ls e* lists all files that start with e

• ls *pdf lists all files that end in pdf

• ls file?.dat will list files such as file1.dat and file7.dat but will not list file001.dat

*?

• To copy double click with left mouse button and paste by pressing middle mouse button.

• Control + A to go to beginning of typed line.

• Control + E to go to the end of typed line.

• Control + K deletes the line.ctrlKctrlEctrlA

Page 14: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Other Basic Commands

• cat Concatenate and display

• less Can move through a file when viewing it

• man Manual

• touch Makes a new file

• clear Clears the terminal screen

• emacs Editor

• pico Editor

• vi Editor

• acroread Acrobat Reader

Page 15: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Some useful websites

• Doctor Bobs Lowfat Linux http://lowfatlinux.com/

• Getting started with Linux http://www.linux.org/lessons/beginner/toc.html

• Unix Tutorial for beginners http://www.ee.surrey.ac.uk/Teaching/Unix/index.html

Page 16: © Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012

© Crown copyright Met Office

Questions