Download presentation
Presentation is loading. Please wait.
Published byDominick Willis Modified over 9 years ago
1
Introduction to Linux Workshop February 26 2015
2
Introduction Rob Lane & The HPC Support Team Research Computing Services CUIT
3
Introduction Linux Basics
4
Introduction Linux Basics (HPC is next week)
5
Introduction 1 st Hour: Slides + Hands-on 2 nd Hour: Hands-on
6
Introduction Second Intro to Linux Workshop Please Leave Feedback
7
Introduction What is Linux?
8
Introduction What is Linux? Linux is an operating system.
9
Introduction What is an operating system?
10
Introduction An operating system (OS) is software that manages computer hardware and software resources and provides common services for computer programs. - Wikipedia
11
Introduction
12
History This will be quick
13
History Linux is old 1991
14
History Linux is related to Unix
15
History Unix is very old 1969
16
Design Unix created by developers for developers
17
Design 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
Access Did everyone get a user ID?
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 userNN@didius.cc.columbia.edu Windows (Putty) Host Name: didius.cc.columbia.edu
23
Access Aside System: cunix.columbia.edu User: Your UNI
24
Prompt [user1@didius ~]$ User name System name Name of current directory ~ is special
25
pwd $ pwd “Print working directory”
26
Directory Path $ pwd /workshop/home/user1
27
Directory Path
28
ls $ ls “List directory” Not very interesting.
29
cd $ cd / “Change directory” $ pwd
30
ls $ ls $ ls –l Long listing.
31
cd $ cd $ pwd cd with no arguments takes you back home
32
.. $ pwd $ cd.. $ pwd “..” means “the directory above this one”
33
. $ pwd $ cd. $ pwd “.” means “this directory”
34
ls -a $ cd $ ls -a Can combine options $ ls –la
35
~ $ pwd $ cd ~ $ pwd “~” means “home directory”
36
Paths $ cd tmp $ cd /tmp Absolute: starts with “/” Relative: doesn’t
37
cp $ cd $ cp /tmp/keets. $ ls
38
rm $ cp keets junk $ ls $ rm junk $ ls
39
cat $ cat keets
40
mv $ mv keets keats $ ls
41
mkdir $ mkdir tmp $ mv keats tmp $ cd tmp $ ls
42
rmdir $ pwd $ mv keats.. $ cd.. $ rmdir tmp $ ls
43
who am i $ whoami $ id $ groups
44
id, groups $ id rl2226 $ groups rl2226
45
who $ who
46
w $ w
47
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
48
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
49
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
50
bash $ ls k[tab] $ ls keats Tab completion Works for commands as well
51
man $ man ls Display manual for “ls” command
52
ls -l $ ls –l total 4 -rw------- 1 user1 workshop 573 Sep 29 22:00 keats File type and permissions Link count User Group Date last changed File name
53
File Type $ ls –l total 4 -rw------- 1 user1 workshop 573 Sep 29 22:00 keats -Normal File dDirectory lLink OthersVarious Special Files
54
Permissions $ ls –l total 4 -rw------- 1 user1 workshop 573 Sep 29 22:00 keats rread wwrite xexecute othersvarious special settings
55
Links $ ls –l total 4 -rw------- 1 user1 workshop 573 Sep 29 22:00 keats We’ll ignore links for now.
56
User $ ls –l total 4 -rw------- 1 user1 workshop 573 Sep 29 22:00 keats The user that owns this file.
57
Group $ ls –l total 4 -rw------- 1 user1 workshop 573 Sep 29 22:00 keats The group that owns this file.
58
Size $ ls –l total 4 -rw------- 1 user1 workshop 573 Sep 29 22:00 keats The size of this file. Here listed in bytes.
59
Last Change Date $ ls –l total 4 -rw------- 1 user1 workshop 573 Sep 29 22:00 keats The last time the file was changed.
60
Name $ ls –l total 4 -rw------- 1 user1 workshop 573 Sep 29 22:00 keats The file name.
61
Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
62
Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash rread wwrite xexecute othersvarious special settings
63
Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash Nine permission settings
64
Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash Three groups of three
65
Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash First group: owner readyes writeyes executeyes
66
Permissions $ ls -l /bin/bash -rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash Second group: group readyes writeno executeyes
67
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
68
date $ date Tue Sep 30 13:27:29 EDT 2014
69
Output Redirection $ cd $ date > thedate $ cat thedate
70
Output Redirection $ cd $ ls –l > myhome $ cat myhome
71
sort $ sort keats
72
Input Redirection $ sort < keats
73
Input/Output Redirection $ sort sorted $ cat sorted
74
Appending $ date >> thedate $ cat thedate Useful for log files
75
grep $ grep planet keats When a new planet swims into his ken; Find all lines containing “planet” in “keats”
76
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
77
Editing No single obvious choice for editor vi – simple but difficult at first emacs – powerful but complex nano – simple but not really standard
78
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
79
less $ less /var/log/messages Used to read (not edit) files Very useful command
80
less [space] : next page b : previous page g : go to end of file ^g : display location in file / : search n: repeat search
81
sleep $ sleep 5 More useful than it seems
82
echo $ echo hi hi More useful than it seems
83
Multiple Commands $ sleep 5; echo hi hi Use ; to separate commands
84
Job Control $ sleep 600 ^c $ Use control-c to stop a running command
85
Job Control $ sleep 600; echo hi ^c What happened? Why?
86
exit $ exit Logs out There are other ways of logging out $ logout $ ^d
87
ps $ ps Lists the processes you have running in this session
88
ps $ ps -e List every process
89
ps $ ps -aux List every process with a lot more information Flags for ps are numerous and inconsistent
90
top $ top Lists running processes Updates every 3 seconds Many options to change display Many other top-like commands exist.
91
Questions? Any questions?
92
Other Topics This is the end of the slides proper Many other commands and concepts that could be covered Following slides just list possibilities
93
Other Topics Environment variables $PATH which type
94
Other Topics More process control ^z bg, fg jobs (command)
95
Other Topics Standard directories bin dev etc tmp usr var
96
Other Topics File systems df Space usage du
97
Other Topics Processes fork() exec() kill
98
Other Topics Shell scripts Programming
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.