Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Linux Workshop February 15, 2016.

Similar presentations


Presentation on theme: "Introduction to Linux Workshop February 15, 2016."— Presentation transcript:

1 Introduction to Linux Workshop February 15, 2016

2 George Garrett & The HPC Support Team Research Computing Services CUIT

3 Introduction Linux Basics (Scripting is next week)

4 Introduction Session: Slides + Hands-on

5 Introduction Please Leave Feedback

6 Introduction What is Linux?

7 Introduction to Linux What is Linux? Linux is an operating system.

8 Introduction to Linux What is Linux? Linux is an operating system. What is an operating system?

9 An operating system (OS) is software that manages computer hardware and software resources and provides common services for computer programs. - Wikipedia Operating System

10

11 History This will be quick

12 History Linux is related to Unix

13 History 1969 – Unix development starts (complex history skipped) 1991 – Linux released

14 History

15 History? - Dilbert, June 24 1995 (Idea stolen from Dan Mechanic at the Business School.)

16 History Ken Thompson & Dennis Ritchie

17 Design Unix created by developers for developers Unix was designed to be simple and powerful

18 Design “ […] the power of a system comes more from the relationships among programs than from the programs themselves. Many UNIX programs do quite trivial things in isolation, but, combined with other programs, become general and useful tools.” The UNIX Programming Environment, Kernighan and Pike (1984)

19 Cunix System: cunix.columbia.edu User: Your UNI

20 Access Windows Instructions 1.Search for putty on Columbia home page 2.Select first result 3.Follow link to Putty download page 4.Download putty.exe 5.Run putty.exe

21 Access Mac Instructions 1.Run terminal

22 Access Mac (Terminal) $ ssh @cunix.columbia.edu Windows (Putty) Host Name: cunix.columbia.edu

23 Access Does everyone have access?

24 Prompt -bash-4.1$ This is the default prompt for our accounts Let’s make it a little more user-friendly

25 Prompt -bash-4.1$ PS1="\W$ " PS1 is an environment variable \W is current directory $ is a conventional prompt symbol

26 Prompt ~$ Name of current directory ~ is special

27 .bash_profile and.bashrc These two files can be used to set up your environment automatically when you log in Beyond the scope of this session

28 pwd $ pwd “Print working directory”

29 Directory Path $ pwd /u/1/a/abc123

30 Directory Structure (Example)

31 ls $ ls “List directory”

32 cd $ cd / “Change directory” $ pwd

33 ls $ ls $ ls –l Long listing.

34 cd $ cd $ pwd cd with no arguments takes you back home

35 .. $ pwd $ cd.. $ pwd “..” means “the directory above this one”

36 . $ pwd $ cd. $ pwd “.” means “this directory”

37 ls -a $ cd $ ls -a Can combine options $ ls –la

38 ~ $ pwd $ cd ~ $ pwd “~” means “home directory”

39 Paths $ cd tmp $ cd /tmp Absolute: starts with “/” Relative: doesn’t

40 cp $ cd $ cp /tmp/keets. $ ls

41 rm $ cp keets junk $ ls $ rm junk $ ls

42 cat $ cat keets

43 mv $ mv keets keats $ ls

44 mkdir $ mkdir tmp $ mv keats tmp $ cd tmp $ ls

45 rmdir $ pwd $ mv keats.. $ cd.. $ rmdir tmp $ ls

46 who am i $ whoami $ id $ groups

47 id, groups $ id abc123 $ groups abc123

48 who $ who

49 w $ w

50 bash bash is a “shell” It prints the prompt and interprets what you enter It has many keyboard shortcuts that can really speed up your work

51 bash $ ls jeats ls: jeats: No such file or directory Up arrow to retrieve the command Left and right arrows to navigate on line Change the “j” to a “k” and rerun

52 bash “^” means “hold down control” ^a : go to beginning of line ^e : go to end of line ^k: delete to end of line Many more useful bash commands

53 bash $ ls k[tab] $ ls keats Tab completion Works for commands as well

54 man $ man ls Display manual for “ls” command

55 ls -l $ ls –l total 4 -rw------- 1 user1 group 573 Sep 29 22:00 keats File type and permissions Link count User Group Date last changed File name

56 File Type $ ls –l total 4 -rw------- 1 user1 group 573 Sep 29 22:00 keats -Normal File dDirectory lLink OthersVarious Special Files

57 Permissions $ ls –l total 4 -rw------- 1 user1 group 573 Sep 29 22:00 keats rread wwrite xexecute othersvarious special settings

58 Links $ ls –l total 4 -rw------- 1 user1 group 573 Sep 29 22:00 keats We’ll ignore links today.

59 User $ ls –l total 4 -rw------- 1 user1 group 573 Sep 29 22:00 keats The user that owns this file.

60 Group $ ls –l total 4 -rw------- 1 user1 group 573 Sep 29 22:00 keats The group that owns this file.

61 Size $ ls –l total 4 -rw------- 1 user1 group 573 Sep 29 22:00 keats The size of this file. Here listed in bytes.

62 Last Change Date $ ls –l total 4 -rw------- 1 user1 group 573 Sep 29 22:00 keats The last time the file was changed.

63 Name $ ls –l total 4 -rw------- 1 user1 group 573 Sep 29 22:00 keats The file name.

64 Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash

65 Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash rread wwrite xexecute othersvarious special settings

66 Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash Nine permission settings

67 Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash Three groups of three

68 Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash First group: owner readyes writeyes executeyes

69 Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash Second group: group readyes writeno executeyes

70 Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash Third group: everyone else readyes writeno executeyes

71 Permissions What’s the dot? $ ls -l /bin/bash -rwxr-xr-x. 1 root wheel 768952 Sep 25 15:31 /bin/bash Indicates the presence of an Access Control List (ACL) Additional permission layer

72 date $ date Tue Sep 30 13:27:29 EDT 2014

73 Output Redirection $ cd $ date > thedate $ cat thedate

74 Output Redirection $ cd $ ls –l > myhome $ cat myhome

75 sort $ sort keats

76 Input Redirection $ sort < keats

77 Input/Output Redirection $ sort sorted $ cat sorted

78 Appending $ date >> thedate $ cat thedate Useful for log files

79 grep $ grep planet keats When a new planet swims into his ken; Find all lines containing “planet” in “keats”

80 Pipes $ cat keats $ cat keats | grep planet When a new planet swims into his ken; Pipes connect output from one command to the input of another command

81 Editing No single obvious choice for editor vi – simple but difficult at first emacs – powerful but complex nano – simple but not really standard

82 nano $ nano keats “^” means “hold down control” ^a : go to beginning of line ^e : go to end of line ^k: delete line ^o: save file ^x: exit

83 less $ less /var/log/messages Used to read (not edit) files Very useful command

84 less [space] : next page b : previous page Shift-g : go to end of file g : go to beginning of file ^g : display location in file / : search n: repeat search

85 sleep $ sleep 5 More useful than it seems

86 echo $ echo hi hi More useful than it seems

87 Multiple Commands $ sleep 5; echo hi hi Use ; to separate commands

88 Job Control $ sleep 600 ^c $ Use control-c to stop a running command

89 Job Control $ sleep 600; echo hi ^c What happened? Why?

90 exit $ exit Logs out There are other ways of logging out $ logout $ ^d

91 ps $ ps Lists the processes you have running in this session

92 ps $ ps -e List every process

93 ps $ ps -aux List every process with a lot more information Flags for ps are numerous and inconsistent

94 top $ top Lists running processes Updates every 3 seconds Many options to change display Many other top-like commands exist.

95 Questions? Any questions?

96 Linux Resources - Book How Linux Works by Brian Ward Available as an E-book from Columbia University Libraries and at Safari Books OnlineE-book https://clio.columbia.edu/quicksearch?q=how+linux+works

97 Linux Resources - Video Intro to Linux (Youtube) by Eli the Computer Guy https://clio.columbia.edu/quicksearch?q=how+linux+works

98 Installing Linux - Videos You can install Linux as an application on your computer using VirtualBox which runs within your current operating system. How to Install Ubuntu Linux on Windows 7 How to Install Ubuntu Linux on Mac https://clio.columbia.edu/quicksearch?q=how+linux+works


Download ppt "Introduction to Linux Workshop February 15, 2016."

Similar presentations


Ads by Google