SlideShare a Scribd company logo
1 of 91
Download to read offline
Introduction to Linux Workshop
September 30 2014
Introduction
Rob Lane
HPC Support
Research Computing Services
CUIT
Introduction
Linux Basics for Beginners
Introduction
Linux Basics for Beginners
(No HPC Yet)
Introduction
1st Hour: Slides + Hands-on
2nd Hour: Hands-on
Introduction
First Workshop
History
This will be quick
History
Linux is old
1991
History
For our purposes
Linux = Unix
History
Unix is very old
1969
History
Unix created by engineers for engineers
History
Unix was designed to be simple and
powerful
Access
Did everyone get a user ID?
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
Access
Mac Instructions
1. Run terminal
Access
Mac (Terminal)
$ ssh userNN@didius.cc.columbia.edu
Windows (Putty)
Host Name: didius.cc.columbia.edu
Access
Aside
System: cunix.columbia.edu
User: Your UNI
Prompt
[user1@didius ~]$
• User name
• System name
• Name of current directory
~ is special
pwd
$ pwd
“Print working directory”
Directory Path
$ pwd
/workshop/home/user1
ls
$ ls
“List directory”
Not very interesting.
cd
$ cd /
“Change directory”
$ pwd
ls
$ ls
$ ls –l
Long listing.
cd
$ 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”
ls -a
$ cd
$ ls -a
Can combine options
$ ls –la
~
$ pwd
$ cd ~
$ pwd
“~” means “home directory”
Paths
$ cd tmp
$ cd /tmp
Absolute: starts with “/”
Relative: doesn’t
cp
$ cd
$ cp /tmp/keets .
$ ls
rm
$ cp keets junk
$ ls
$ rm junk
$ ls
cat
$ cat keets
mv
$ mv keets keats
$ ls
mkdir
$ mkdir tmp
$ mv keats tmp
$ cd tmp
$ ls
rmdir
$ pwd
$ mv keats ..
$ cd ..
$ rmdir tmp
$ ls
who am i
$ whoami
$ who am i
$ id
$ groups
id, groups
$ id rl2226
$ groups rl2226
who
$ who
w
$ w
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
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
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
bash
$ ls k[tab]
$ ls keats
• Tab completion
• Works for commands as well
man
$ man ls
Display manual for “ls” command
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
File Type
$ ls –l
total 4
-rw------- 1 user1 workshop 573 Sep 29 22:00 keats
- Normal File
d Directory
l Link
Others Various Special Files
Permissions
$ ls –l
total 4
-rw------- 1 user1 workshop 573 Sep 29 22:00 keats
r read
w write
x execute
others various special settings
Links
$ ls –l
total 4
-rw------- 1 user1 workshop 573 Sep 29 22:00 keats
We’ll ignore links for now.
User
$ ls –l
total 4
-rw------- 1 user1 workshop 573 Sep 29 22:00 keats
The user that owns this file.
Group
$ ls –l
total 4
-rw------- 1 user1 workshop 573 Sep 29 22:00 keats
The group that owns this file.
Size
$ ls –l
total 4
-rw------- 1 user1 workshop 573 Sep 29 22:00 keats
The size of this file.
Here listed in bytes.
Last Change Date
$ ls –l
total 4
-rw------- 1 user1 workshop 573 Sep 29 22:00 keats
The last time the file was changed.
Name
$ ls –l
total 4
-rw------- 1 user1 workshop 573 Sep 29 22:00 keats
The file name.
Permissions
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
Permissions
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
r read
w write
x execute
others various special settings
Permissions
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
Nine permission settings
Permissions
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
Three groups of three
Permissions
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
First group: owner
read yes
write yes
execute yes
Permissions
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
Second group: group
read yes
write no
execute yes
Permissions
$ ls -l /bin/bash
-rwxr-xr-x 1 root wheel 768952 Sep 25 15:31 /bin/bash
Third group: everyone else
read yes
write no
execute yes
date
$ date
Tue Sep 30 13:27:29 EDT 2014
Output Redirection
$ cd
$ date > thedate
$ cat thedate
Output Redirection
$ cd
$ ls –l > myhome
$ cat myhome
sort
$ sort keats
Input Redirection
$ sort < keats
Input/Output Redirection
$ sort < keats > sorted
$ cat sorted
Appending
$ date >> thedate
$ cat thedate
Useful for log files
grep
$ grep planet keats
When a new planet swims into his ken;
Find all lines containing “planet” in “keats”
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
Editing
No single obvious choice for editor
• vi – simple but difficult at first
• emacs – powerful but complex
• nano – simple but not really standard
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
less
$ less /var/log/messages
• Used to read (not edit) files
• Very useful command
less
[space] : next page
b : previous page
g : go to end of file
^g : display location in file
/ : search
n: repeat search
sleep
$ sleep 5
• More useful than it seems
echo
$ echo hi
hi
• More useful than it seems
Multiple Commands
$ sleep 5; echo hi
hi
• Use ; to separate commands
Job Control
$ sleep 60
^c
$
• Use control-c to stop a running command
Job Control
$ sleep 60; echo hi
^c
What happened? Why?
exit
$ exit
• Logs out
• There are other ways of logging out
$ logout
$ ^d
ps
$ ps
• Lists the processes you have running in
this session
ps
$ ps -e
• List every process
ps
$ ps -aux
• List every process with a lot more
information
• Flags for ps are numerous and
inconsistent
top
$ top
• Lists running processes
• Updates every 3 seconds
• Many options to change display
• Many other top-like commands exist.
Questions?
Any questions?
Other Topics
• This is the end of the slides proper
• Many other commands and concepts that
could be covered
• Following slides just list possibilities
Other Topics
• Environment variables
• $PATH
• which
• type
Other Topics
• More process control
• ^z
• bg, fg
• jobs (command)
Other Topics
• Standard directories
• bin
• dev
• etc
• tmp
• usr
• var
Other Topics
• File systems
• df
• Space usage
• du
Other Topics
• Processes
• fork()
• exec()
• kill
Other Topics
• Shell scripts
• Programming

More Related Content

Similar to 14_0930_Intro_to_Linux.pdf

03 browsing the filesystem
03 browsing the filesystem03 browsing the filesystem
03 browsing the filesystemShay Cohen
 
Topic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptxTopic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptxdulala3
 
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdfCesleySCruz
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.pptKiranMantri
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigationhetaldobariya
 
Linux command line cheatsheet
Linux command line cheatsheetLinux command line cheatsheet
Linux command line cheatsheetWe Ihaveapc
 
2009 cluster user training
2009 cluster user training2009 cluster user training
2009 cluster user trainingChris Dwan
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadRavikumar Nandigam
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administratorDinesh jaisankar
 

Similar to 14_0930_Intro_to_Linux.pdf (20)

03 browsing the filesystem
03 browsing the filesystem03 browsing the filesystem
03 browsing the filesystem
 
Topic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptxTopic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptx
 
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdf
 
Linux: Basics OF Linux
Linux: Basics OF LinuxLinux: Basics OF Linux
Linux: Basics OF Linux
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Lnx
LnxLnx
Lnx
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux Basics.pptx
Linux Basics.pptxLinux Basics.pptx
Linux Basics.pptx
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigation
 
Linux command line cheatsheet
Linux command line cheatsheetLinux command line cheatsheet
Linux command line cheatsheet
 
Linux And perl
Linux And perlLinux And perl
Linux And perl
 
2009 cluster user training
2009 cluster user training2009 cluster user training
2009 cluster user training
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in Hyderabad
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administrator
 
Basics of unix
Basics of unixBasics of unix
Basics of unix
 
Linux Fundamentals
Linux FundamentalsLinux Fundamentals
Linux Fundamentals
 

Recently uploaded

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 

Recently uploaded (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 

14_0930_Intro_to_Linux.pdf