Introduction to Linux Workshop and History: A Brief Overview

undefined
I
n
t
r
o
d
u
c
t
i
o
n
 
t
o
 
L
i
n
u
x
 
W
o
r
k
s
h
o
p
February 15, 2016
George Garrett
&
The HPC Support Team
Research Computing Services
CUIT
I
n
t
r
o
d
u
c
t
i
o
n
Linux Basics
(Scripting is next week)
I
n
t
r
o
d
u
c
t
i
o
n
Session: Slides + Hands-on
I
n
t
r
o
d
u
c
t
i
o
n
Please Leave Feedback
I
n
t
r
o
d
u
c
t
i
o
n
What is Linux?
I
n
t
r
o
d
u
c
t
i
o
n
 
t
o
 
L
i
n
u
x
What is Linux?
Linux is an operating system.
I
n
t
r
o
d
u
c
t
i
o
n
 
t
o
 
L
i
n
u
x
What is Linux?
Linux is an operating system.
What is an operating system?
An 
operating system
 (
OS
) is software
that manages computer hardware and
software resources and provides
common services for computer
programs.
- Wikipedia
O
p
e
r
a
t
i
n
g
 
S
y
s
t
e
m
 
O
p
e
r
a
t
i
n
g
 
S
y
s
t
e
m
H
i
s
t
o
r
y
This will be quick
H
i
s
t
o
r
y
Linux is related to Unix
H
i
s
t
o
r
y
1969 – Unix development starts
(complex history skipped)
1991 – Linux released
H
i
s
t
o
r
y
H
i
s
t
o
r
y
?
- Dilbert, June 24 1995
(Idea stolen from Dan Mechanic at the Business School.)
H
i
s
t
o
r
y
Ken Thompson & Dennis Ritchie
D
e
s
i
g
n
Unix created by developers for developers
Unix was designed to be simple and powerful
D
e
s
i
g
n
“ […] 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)
C
u
n
i
x
System: cunix.columbia.edu
User: Your UNI
A
c
c
e
s
s
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
A
c
c
e
s
s
Mac Instructions
1.
Run terminal
A
c
c
e
s
s
M
a
c
 
(
T
e
r
m
i
n
a
l
)
$ ssh <UNI>@cunix.columbia.edu
W
i
n
d
o
w
s
 
(
P
u
t
t
y
)
Host Name: cunix.columbia.edu
A
c
c
e
s
s
Does everyone have access?
P
r
o
m
p
t
-bash-4.1$
This is the default prompt for our accounts
Let’s make it a little more user-friendly
P
r
o
m
p
t
-bash-4.1$ PS1="\W$ "
PS1 is an environment variable
\W is current directory
$ is a conventional prompt symbol
P
r
o
m
p
t
~$
Name of current directory
~ is special
.
b
a
s
h
_
p
r
o
f
i
l
e
 
a
n
d
 
.
b
a
s
h
r
c
These two files can be used to set up your
environment automatically when you log in
Beyond the scope of this session
p
w
d
$ pwd
“Print working directory”
D
i
r
e
c
t
o
r
y
 
P
a
t
h
$ pwd
/u/1/a/abc123
D
i
r
e
c
t
o
r
y
 
S
t
r
u
c
t
u
r
e
 
(
E
x
a
m
p
l
e
)
 
l
s
$ ls
“List directory”
c
d
$ cd /
“Change directory”
$ pwd
l
s
$ ls
$ ls –l
Long listing.
c
d
$ cd
$ pwd
cd with no arguments takes you back home
.
.
$ pwd
$ cd ..
$ pwd
“..” means “the directory above this one”
.
$ pwd
$ cd .
$ pwd
“.” means “this directory”
l
s
 
-
a
$ cd
$ ls -a
Can combine options
$ ls –la
~
$ pwd
$ cd ~
$ pwd
“~” means “home directory”
P
a
t
h
s
$ cd tmp
$ cd /tmp
Absolute: starts with “/”
Relative: doesn’t
c
p
$ cd
$ cp /tmp/keets .
$ ls
r
m
$ cp keets junk
$ ls
$ rm junk
$ ls
c
a
t
$ cat keets
m
v
$ mv keets keats
$ ls
m
k
d
i
r
$ mkdir tmp
$ mv keats tmp
$ cd tmp
$ ls
r
m
d
i
r
$ pwd
$ mv keats ..
$ cd ..
$ rmdir tmp
$ ls
w
h
o
 
a
m
 
i
$ whoami
$ who am i
$ id
$ groups
i
d
,
 
g
r
o
u
p
s
$ id abc123
$ groups abc123
w
h
o
$ who
w
$ w
b
a
s
h
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
b
a
s
h
$ 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
b
a
s
h
“^” 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
b
a
s
h
$ ls k[tab]
$ ls keats
Tab completion
Works for commands as well
m
a
n
$ man ls
Display manual for “ls” command
l
s
 
-
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
F
i
l
e
 
T
y
p
e
$ ls –l
total 4
-rw------- 1 user1  group 573 Sep 29 22:00 keats
P
e
r
m
i
s
s
i
o
n
s
$ ls –l
total 4
-rw------- 1 user1  group 573 Sep 29 22:00 keats
L
i
n
k
s
$ ls –l
total 4
-rw------- 1 user1  group 573 Sep 29 22:00 keats
We’ll ignore links today.
U
s
e
r
$ ls –l
total 4
-rw------- 1 user1  group 573 Sep 29 22:00 keats
The user that owns this file.
G
r
o
u
p
$ ls –l
total 4
-rw------- 1 user1  group   573 Sep 29 22:00 keats
The group that owns this file.
S
i
z
e
$ ls –l
total 4
-rw------- 1 user1  group   573 Sep 29 22:00 keats
The size of this file.
Here listed in bytes.
L
a
s
t
 
C
h
a
n
g
e
 
D
a
t
e
$ ls –l
total 4
-rw------- 1 user1  group   573 Sep 29 22:00 keats
The last time the file was changed.
N
a
m
e
$ ls –l
total 4
-rw------- 1 user1  group   573 Sep 29 22:00 keats
The file name.
P
e
r
m
i
s
s
i
o
n
s
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
P
e
r
m
i
s
s
i
o
n
s
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
P
e
r
m
i
s
s
i
o
n
s
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
Nine permission settings
P
e
r
m
i
s
s
i
o
n
s
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
Three groups of three
P
e
r
m
i
s
s
i
o
n
s
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
First group: owner
P
e
r
m
i
s
s
i
o
n
s
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
Second group: group
P
e
r
m
i
s
s
i
o
n
s
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
Third group: everyone else
P
e
r
m
i
s
s
i
o
n
s
What’s the dot?
$ ls -l /bin/bash
-rwxr-xr-x. 1 root wheel 768952 Sep 25 15:31 /bin/bash
I
n
d
i
c
a
t
e
s
 
t
h
e
 
p
r
e
s
e
n
c
e
 
o
f
 
a
n
 
A
c
c
e
s
s
 
C
o
n
t
r
o
l
L
i
s
t
 
(
A
C
L
)
Additional permission layer
d
a
t
e
$ date
Tue Sep 30 13:27:29 EDT 2014
O
u
t
p
u
t
 
R
e
d
i
r
e
c
t
i
o
n
$ cd
$ date > thedate
$ cat thedate
O
u
t
p
u
t
 
R
e
d
i
r
e
c
t
i
o
n
$ cd
$ ls –l > myhome
$ cat myhome
s
o
r
t
$ sort keats
I
n
p
u
t
 
R
e
d
i
r
e
c
t
i
o
n
$ sort < keats
I
n
p
u
t
/
O
u
t
p
u
t
 
R
e
d
i
r
e
c
t
i
o
n
$ sort < keats > sorted
$ cat sorted
A
p
p
e
n
d
i
n
g
$ date >> thedate
$ cat thedate
Useful for log files
g
r
e
p
$ grep planet keats
When a new planet swims into his ken;
Find all lines containing “planet” in “keats”
P
i
p
e
s
$ 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
E
d
i
t
i
n
g
No single obvious choice for editor
vi – simple but difficult at first
emacs – powerful but complex
nano – simple but not really standard
n
a
n
o
$ 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
l
e
s
s
$ less /var/log/messages
Used to read (not edit) files
Very useful command
l
e
s
s
[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
s
l
e
e
p
$ sleep 5
More useful than it seems
e
c
h
o
$ echo hi
hi
More useful than it seems
M
u
l
t
i
p
l
e
 
C
o
m
m
a
n
d
s
$ sleep 5; echo hi
hi
Use ; to separate commands
J
o
b
 
C
o
n
t
r
o
l
$ sleep 600
^c
$
Use control-c to stop a running command
J
o
b
 
C
o
n
t
r
o
l
$ sleep 600; echo hi
^c
What happened?  Why?
e
x
i
t
$ exit
Logs out
There are other ways of logging out
$ logout
$ ^d
p
s
$ ps
Lists the processes you have running in
this session
p
s
$ ps -e
List every process
p
s
$ ps -aux
List every process with a lot more
information
Flags for ps are numerous and
inconsistent
t
o
p
$ top
Lists running processes
Updates every 3 seconds
Many options to change display
Many other top-like commands exist.
Q
u
e
s
t
i
o
n
s
?
Any questions?
L
i
n
u
x
 
R
e
s
o
u
r
c
e
s
 
-
 
B
o
o
k
How Linux Works
by Brian Ward
Available as an 
E-book 
from Columbia
University Libraries and at Safari Books
Online
https://clio.columbia.edu/quicksearch?q=how+linux+works
L
i
n
u
x
 
R
e
s
o
u
r
c
e
s
 
-
 
V
i
d
e
o
Intro to Linux (Youtube)
by Eli the Computer Guy
https://clio.columbia.edu/quicksearch?q=how+linux+works
I
n
s
t
a
l
l
i
n
g
 
L
i
n
u
x
 
-
 
V
i
d
e
o
s
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
Slide Note
Embed
Share

Delve into the world of Linux with an introduction to its basics, operating system functionalities, and a quick history lesson from the Unix roots to the release of Linux. Explore the significance of Linux as an operating system and the evolution of computing. Get insights into key milestones like Unix development and the inception of Linux in 1991.

  • Linux Workshop
  • Operating System
  • Unix Roots
  • Computing Evolution
  • History Lesson

Uploaded on Oct 08, 2024 | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

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. Operating System An operating system (OS) is software that manages computer hardware and software resources and provides common services for computer programs. - Wikipedia

  10. Operating System

  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 <UNI>@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) / bin dev etc lib var workshop home user1 user2 user3

  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 $ who am i $ 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

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#