SlideShare a Scribd company logo
1 of 34
Operating Systems
Week 2 – The Command Line
Class Syllabus
• The syllabus has been posted on Blackboard
• The breakdown of grades is:
Linux Operating
Systems Labs
30%
Microsoft Operating
Systems Labs
35%
Hypervisor Labs 25%
Know My Computer
Assignment
10%
Software For This Class
• VMWare Workstation
– Downloadable from Blackboard
• VMWare Horizon
– Downloadable from Blackboard
• Elementary OS
– http://elementary.io
• Lubuntu OS
– http://lubuntu.net
How do Operating Systems Work?
• Last week we learned that the operating
system is everything between the user’s
programs and hardware.
OS
Hard ware
User
The “Kernel” and “Shell”
KernelKernel
ShellShell
A metaphor for explaining how operating systems work at a
theoretical level
The shell is what the user sees, while the kernel is how the
OS manages the hardware.
The “Kernel” and “Shell”
The user sends commands to the shell, which are turned
into “system calls” to the kernel, which in turns gives
instructions to the hardware.
Command Line
• Also called the “command line interface” (CLI)
• The closest you can get to the kernel while still
being in the shell.
– Again, generally. You can use system calls directly,
but this isn't usually advised unless you are doing
low-level programming.
• GUIs and windows often use command line
commands to get information and perform
actions.
“A” Shell vs. “The” Shell
• You will often here people refer to a CLI as a
“shell”
• This is because the command line is generally as low
as most people go in the Operating System
• Rule of thumb: “A” shell is a command line
interface. “The” shell is a metaphor for how
the operating system works.
Bash
• Most common CLI for Linux
• Is based on the “Bourne” Shell, which was one
of the original Unix Shells
• Bash stands for “Bourne Again Shell”
– The more time you spend in programming, the
more terrible puns you will see
Common Commands
• echo
• ls
• cd
• touch
• rm
• mkdir
• rmdir
• mv
• cp
• grep
• man
Commands
e.g.
m
echo
• Simplest command in all of linux
• Reads a string and repeats it
• e.g. echo “Hello World!”
ls
• “list”
• Lists files and directories
• Can accept “arguments” to look for more
specific information.
• Try running “ls –a” and “ls –l”. What happens?
cd
• “current directory”, although I like to think of
it as “change directory”
• Used to change the directory the user is
currently in.
• Use “ls” to get the names of the directories in
your current directory. Try using “cd
<directory>” to move into it.
• Use “cd ..” to move into the parent directory
cat
• “concatenate”
• Displays the output of one or more files
• The format is “cat <name of file>”
– e.g. cat thisfile
• Use “cd” and “ls” or “ls –l” to find some files,
then use cat to see what is inside them.
touch, rm
• touch and “remove”
• touch is used to create a blank file
– You can edit it later
– e.g. “touch test”
• rm deletes a file
–e.g. “rm test”
– There is no recycling bin for the command line, so
once a file is gone it’s gone.
mkdir, rmdir
• “make directory”, “remove directory”
• I’ll give you three guesses…
• You can only remove an empty directory
– You must delete all of the files inside the directory
first
– Deleting can be done faster using “globbing”
(discussed later)
mv & cp
• “move” and “copy”
• mv will create a copy of a file or directory and
delete the original. cp does not delete the
original.
• If the second input is a file instead of a folder,
then the file is renamed.
– e.g. mv oldfilename newfilename
Task #1 – 5 minutes
• Create a directory called “alphanumeric”
• Move into the directory, and create four files: “a”,
“b”, “1” and “2”
• Move out of the directory and create a copy of
“alphanumeric”.
• Create two new directories called “letters” and
“numbers”
• Move the files whose names are letters into the
“letters” directory, and the numbers into “numbers”
• Delete the original “alphanumeric”
Shell “Globbing”
• Moving files one at a time is incredibly tedious
• Luckily, bash lets us match many characters at
the same time. This matching is called shell
“globbing”
• Create three new files: “apple”, “apricot”, and
“banana”
• Compare “ls”, “ls a*”, “ls app*”, and “ls *a”
Special Characters in Globbing
Character Name Function
* Asterisk Wildcard. Matches any
characters to any length.
?
Question
Mark
Wildcard. Matches a single
character.
[] Square Br. Matches a range of
characters.
{} Curly Br. Matches a range of
expressions.
Fast Cleanup
• Use globbing to list all of the files in
“alphanumeric” that have a letter in their
name.
• Move a copy of every file in alphanumeric that
starts with a letter into the “letters” folder.
• Delete all of the files in alphanumeric, then
remove the directory
pipe
• Not a command, but a key feature of bash and
many other CLI s
• Allows you to take the output of one
command, and use it as the input of another
• The symbol is “|”
grep
• grep lets you search text for matching
information
– e.g. grep something filename
• By itself it is only a little bit useful, but it
becomes very powerful when combined with
pipes.
• e.g. ls | grep something
man
• Stands for “manual”
• If you don’t understand a command, “man”
will return the documentation for it.
• The format is “man <command>”
Powershell
Access Issues Off-Campus
• Apparently some people are having trouble
accessing the VDI from off campus.
• I’ve talked to the IT department and they told
that it has been resolved
• If you are still having trouble let me know and
I will investigate it further with them.
A Bit About Batch and CMD
• For over 15 years, cmd was the default shell
environment used in Windows
• Batch files were simple lists of command line
instructions.
– Although limited in what they could do
individually, it was possible to schedule multiple
batch files together to accomplish complex tasks.
• Batch files remain in widespread use today
Problems With This
• Cmd does not have a built in scripting
language
– This means that it cannot access powerful
features of the kernel in the same way that bash
can
• While you can string batch files together, this
creates many new points of possible failure
– Even with scheduling, they are still very limited in
what they can do
Introducing Powershell
• Created in 2002
• Is a shell language, scripting language, and
REPL.
• Has been slowly replacing batch over the last
decade
• The syntax of powershell is based around
three concepts:
– Cmdlet -Alias -Application
Cmdlet
• Are made of verb-noun pairs
– example “get-command”, “restart-computer”,
“set-location”
– Gives an idea of what the command does
• Try running those commands (except for
restart-computer) along with get-childitem
Alias
• An alias is an alternative name for a cmdlet
Cmdlet Alias
ls get-childitem
cd set-location
cp copy-item
Finding Common Ground
• The command get-command listed all of the
commands in Powershell
– You can narrow it down with the “-name”
argument
Find if Powershell supports cat, touch, rm,
mkdir, rmdir, mv, man, and grep.
Also, test if shell globbing works the same way.
Application
• Applications are just that, applications. You
can launch them from powershell in the same
way that you can launch them by double
clicking.
• Try running “mspaint.exe” or “notepad.exe”
for a practical example.
Longer Paths
• Right click on a desktop shortcut. Go to
“properties” and copy the “target”. Try
pasting it into powershell and running it. What
happens?
• Without using the internet, can you figure out
how to start the program from Powershell?
– Hint: try using “get-command –name”, along with
globbing, to search for commands using key
words. (e.g. “get-command -name *start*”)

More Related Content

What's hot

Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...PostgreSQL-Consulting
 
High performance network programming on the jvm oscon 2012
High performance network programming on the jvm   oscon 2012 High performance network programming on the jvm   oscon 2012
High performance network programming on the jvm oscon 2012 Erik Onnen
 
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker, Inc.
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments Ohad Raz
 
Tips from Support: Always Carry a Towel and Don’t Panic!
Tips from Support: Always Carry a Towel and Don’t Panic!Tips from Support: Always Carry a Towel and Don’t Panic!
Tips from Support: Always Carry a Towel and Don’t Panic!Perforce
 
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s goingKernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s goingAnne Nicolas
 
Scaling Your App With Docker Swarm using Terraform, Packer on Openstack
Scaling Your App With Docker Swarm using Terraform, Packer on OpenstackScaling Your App With Docker Swarm using Terraform, Packer on Openstack
Scaling Your App With Docker Swarm using Terraform, Packer on OpenstackBobby DeVeaux, DevOps Consultant
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeDanielle Madeley
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011Bachkoutou Toutou
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XJérôme Petazzoni
 
2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and DockerFabio Fumarola
 
Rake: Not Your Father's Build Tool
Rake: Not Your Father's Build ToolRake: Not Your Father's Build Tool
Rake: Not Your Father's Build Toolfilmprog
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshopRuncy Oommen
 
Infrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraInfrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraTomislav Plavcic
 
Build High-Performance, Scalable, Distributed Applications with Stacks of Co...
 Build High-Performance, Scalable, Distributed Applications with Stacks of Co... Build High-Performance, Scalable, Distributed Applications with Stacks of Co...
Build High-Performance, Scalable, Distributed Applications with Stacks of Co...Yandex
 
Infrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleInfrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleRobert Reiz
 

What's hot (20)

Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
 
High performance network programming on the jvm oscon 2012
High performance network programming on the jvm   oscon 2012 High performance network programming on the jvm   oscon 2012
High performance network programming on the jvm oscon 2012
 
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in Production
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 
Tips from Support: Always Carry a Towel and Don’t Panic!
Tips from Support: Always Carry a Towel and Don’t Panic!Tips from Support: Always Carry a Towel and Don’t Panic!
Tips from Support: Always Carry a Towel and Don’t Panic!
 
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s goingKernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
 
Scaling Your App With Docker Swarm using Terraform, Packer on Openstack
Scaling Your App With Docker Swarm using Terraform, Packer on OpenstackScaling Your App With Docker Swarm using Terraform, Packer on Openstack
Scaling Your App With Docker Swarm using Terraform, Packer on Openstack
 
Docker
DockerDocker
Docker
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12X
 
2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and Docker
 
Rake: Not Your Father's Build Tool
Rake: Not Your Father's Build ToolRake: Not Your Father's Build Tool
Rake: Not Your Father's Build Tool
 
Demo 0.9.4
Demo 0.9.4Demo 0.9.4
Demo 0.9.4
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshop
 
Infrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraInfrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfra
 
Build High-Performance, Scalable, Distributed Applications with Stacks of Co...
 Build High-Performance, Scalable, Distributed Applications with Stacks of Co... Build High-Performance, Scalable, Distributed Applications with Stacks of Co...
Build High-Performance, Scalable, Distributed Applications with Stacks of Co...
 
Network programming
Network programmingNetwork programming
Network programming
 
Infrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleInfrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & Ansible
 

Viewers also liked

порядок заполнения заявления
порядок заполнения заявленияпорядок заполнения заявления
порядок заполнения заявленияyanaosadchayaTAS
 
Production diary
Production diaryProduction diary
Production diaryngeo97
 
Little bird
Little birdLittle bird
Little birdSmith_
 
продажа тас кидс-2016
продажа  тас кидс-2016продажа  тас кидс-2016
продажа тас кидс-2016yanaosadchayaTAS
 
Activities december 2015 april 2016
Activities december 2015  april 2016Activities december 2015  april 2016
Activities december 2015 april 2016Baiba Lukasevica
 
ساختمان پزشکان
ساختمان پزشکانساختمان پزشکان
ساختمان پزشکانalo doctor
 
Неделя Байнета 2016. Максим Курбан: «Безотказная работа с возражениями»
Неделя Байнета 2016. Максим Курбан: «Безотказная работа с возражениями»Неделя Байнета 2016. Максим Курбан: «Безотказная работа с возражениями»
Неделя Байнета 2016. Максим Курбан: «Безотказная работа с возражениями»Webcom Group
 
Music Analysis: "Dog Days Are Over" (2010 version)
Music Analysis: "Dog Days Are Over" (2010 version)Music Analysis: "Dog Days Are Over" (2010 version)
Music Analysis: "Dog Days Are Over" (2010 version)carmiiewallace
 
Merged 20160609-114924
Merged 20160609-114924Merged 20160609-114924
Merged 20160609-114924shdp1
 
Principles of management and prevention of Odontogenic Infections
Principles of management and prevention of Odontogenic Infections Principles of management and prevention of Odontogenic Infections
Principles of management and prevention of Odontogenic Infections vahid199212
 
Oral Cavity is the Mirror Image of Body
Oral Cavity is the Mirror Image of BodyOral Cavity is the Mirror Image of Body
Oral Cavity is the Mirror Image of BodyNavreet Bajwa
 
РИФ 2016, Мобильная Реклама - «Новый черный»
РИФ 2016, Мобильная Реклама - «Новый черный»РИФ 2016, Мобильная Реклама - «Новый черный»
РИФ 2016, Мобильная Реклама - «Новый черный»Тарасов Константин
 

Viewers also liked (20)

порядок заполнения заявления
порядок заполнения заявленияпорядок заполнения заявления
порядок заполнения заявления
 
Production diary
Production diaryProduction diary
Production diary
 
Little bird
Little birdLittle bird
Little bird
 
Donald hjelm
Donald hjelmDonald hjelm
Donald hjelm
 
продажа тас кидс-2016
продажа  тас кидс-2016продажа  тас кидс-2016
продажа тас кидс-2016
 
new_kitching_cv
new_kitching_cvnew_kitching_cv
new_kitching_cv
 
Activities december 2015 april 2016
Activities december 2015  april 2016Activities december 2015  april 2016
Activities december 2015 april 2016
 
ساختمان پزشکان
ساختمان پزشکانساختمان پزشکان
ساختمان پزشکان
 
Turtle Cat
Turtle CatTurtle Cat
Turtle Cat
 
Неделя Байнета 2016. Максим Курбан: «Безотказная работа с возражениями»
Неделя Байнета 2016. Максим Курбан: «Безотказная работа с возражениями»Неделя Байнета 2016. Максим Курбан: «Безотказная работа с возражениями»
Неделя Байнета 2016. Максим Курбан: «Безотказная работа с возражениями»
 
Donald hjelm
Donald hjelmDonald hjelm
Donald hjelm
 
Music Analysis: "Dog Days Are Over" (2010 version)
Music Analysis: "Dog Days Are Over" (2010 version)Music Analysis: "Dog Days Are Over" (2010 version)
Music Analysis: "Dog Days Are Over" (2010 version)
 
Assessment of physical activity in nutritional epidemiology
Assessment of physical activityin nutritional epidemiology Assessment of physical activityin nutritional epidemiology
Assessment of physical activity in nutritional epidemiology
 
Merged 20160609-114924
Merged 20160609-114924Merged 20160609-114924
Merged 20160609-114924
 
Principles of management and prevention of Odontogenic Infections
Principles of management and prevention of Odontogenic Infections Principles of management and prevention of Odontogenic Infections
Principles of management and prevention of Odontogenic Infections
 
Exchange list
Exchange listExchange list
Exchange list
 
Odontogenic infections
Odontogenic infectionsOdontogenic infections
Odontogenic infections
 
Oral Cavity is the Mirror Image of Body
Oral Cavity is the Mirror Image of BodyOral Cavity is the Mirror Image of Body
Oral Cavity is the Mirror Image of Body
 
РИФ 2016, Мобильная Реклама - «Новый черный»
РИФ 2016, Мобильная Реклама - «Новый черный»РИФ 2016, Мобильная Реклама - «Новый черный»
РИФ 2016, Мобильная Реклама - «Новый черный»
 
Calsium
CalsiumCalsium
Calsium
 

Similar to Class 2

Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_bMohammad Reza Beygi
 
Linux operating system by Quontra Solutions
Linux operating system by Quontra SolutionsLinux operating system by Quontra Solutions
Linux operating system by Quontra SolutionsQUONTRASOLUTIONS
 
Introduction to Linux Slides.pptx
Introduction to Linux Slides.pptxIntroduction to Linux Slides.pptx
Introduction to Linux Slides.pptxhazhamina
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptxPriyadarshini648418
 
Linux week 2
Linux week 2Linux week 2
Linux week 2Vinoth Sn
 
PowerPoint_merge.ppt on unix programming
PowerPoint_merge.ppt on unix programmingPowerPoint_merge.ppt on unix programming
PowerPoint_merge.ppt on unix programmingPriyadarshini648418
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Chander Pandey
 
Shell Scripting crash course.pdf
Shell Scripting crash course.pdfShell Scripting crash course.pdf
Shell Scripting crash course.pdfharikrishnapolaki
 
LINUX_admin_commands.pptx
LINUX_admin_commands.pptxLINUX_admin_commands.pptx
LINUX_admin_commands.pptxGuhanSenthil2
 
Linux Administrator - The Linux Course on Eduonix
Linux Administrator - The Linux Course on EduonixLinux Administrator - The Linux Course on Eduonix
Linux Administrator - The Linux Course on EduonixPaddy Lock
 
Presentation for RHCE in linux
Presentation  for  RHCE in linux Presentation  for  RHCE in linux
Presentation for RHCE in linux Kuldeep Tiwari
 
Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Ahmed El-Arabawy
 

Similar to Class 2 (20)

redhat_by_Cbitss.ppt
redhat_by_Cbitss.pptredhat_by_Cbitss.ppt
redhat_by_Cbitss.ppt
 
LinuxCommands (1).pdf
LinuxCommands (1).pdfLinuxCommands (1).pdf
LinuxCommands (1).pdf
 
Linux Fundamentals
Linux FundamentalsLinux Fundamentals
Linux Fundamentals
 
Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_b
 
Linux operating system by Quontra Solutions
Linux operating system by Quontra SolutionsLinux operating system by Quontra Solutions
Linux operating system by Quontra Solutions
 
Linux
LinuxLinux
Linux
 
Introduction to Linux Slides.pptx
Introduction to Linux Slides.pptxIntroduction to Linux Slides.pptx
Introduction to Linux Slides.pptx
 
Linuxnishustud
LinuxnishustudLinuxnishustud
Linuxnishustud
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
PowerPoint_merge.ppt on unix programming
PowerPoint_merge.ppt on unix programmingPowerPoint_merge.ppt on unix programming
PowerPoint_merge.ppt on unix programming
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
 
Shell Scripting crash course.pdf
Shell Scripting crash course.pdfShell Scripting crash course.pdf
Shell Scripting crash course.pdf
 
LINUX_admin_commands.pptx
LINUX_admin_commands.pptxLINUX_admin_commands.pptx
LINUX_admin_commands.pptx
 
Linux Administrator - The Linux Course on Eduonix
Linux Administrator - The Linux Course on EduonixLinux Administrator - The Linux Course on Eduonix
Linux Administrator - The Linux Course on Eduonix
 
Presentation for RHCE in linux
Presentation  for  RHCE in linux Presentation  for  RHCE in linux
Presentation for RHCE in linux
 
Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell
 
Linux basic commands tutorial
Linux basic commands tutorialLinux basic commands tutorial
Linux basic commands tutorial
 
Introduction to UNIX
Introduction to UNIXIntroduction to UNIX
Introduction to UNIX
 
Unix
UnixUnix
Unix
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Class 2

  • 1. Operating Systems Week 2 – The Command Line
  • 2. Class Syllabus • The syllabus has been posted on Blackboard • The breakdown of grades is: Linux Operating Systems Labs 30% Microsoft Operating Systems Labs 35% Hypervisor Labs 25% Know My Computer Assignment 10%
  • 3. Software For This Class • VMWare Workstation – Downloadable from Blackboard • VMWare Horizon – Downloadable from Blackboard • Elementary OS – http://elementary.io • Lubuntu OS – http://lubuntu.net
  • 4. How do Operating Systems Work? • Last week we learned that the operating system is everything between the user’s programs and hardware. OS Hard ware User
  • 5. The “Kernel” and “Shell” KernelKernel ShellShell A metaphor for explaining how operating systems work at a theoretical level The shell is what the user sees, while the kernel is how the OS manages the hardware.
  • 6. The “Kernel” and “Shell” The user sends commands to the shell, which are turned into “system calls” to the kernel, which in turns gives instructions to the hardware.
  • 7. Command Line • Also called the “command line interface” (CLI) • The closest you can get to the kernel while still being in the shell. – Again, generally. You can use system calls directly, but this isn't usually advised unless you are doing low-level programming. • GUIs and windows often use command line commands to get information and perform actions.
  • 8. “A” Shell vs. “The” Shell • You will often here people refer to a CLI as a “shell” • This is because the command line is generally as low as most people go in the Operating System • Rule of thumb: “A” shell is a command line interface. “The” shell is a metaphor for how the operating system works.
  • 9. Bash • Most common CLI for Linux • Is based on the “Bourne” Shell, which was one of the original Unix Shells • Bash stands for “Bourne Again Shell” – The more time you spend in programming, the more terrible puns you will see
  • 10. Common Commands • echo • ls • cd • touch • rm • mkdir • rmdir • mv • cp • grep • man Commands e.g. m
  • 11. echo • Simplest command in all of linux • Reads a string and repeats it • e.g. echo “Hello World!”
  • 12. ls • “list” • Lists files and directories • Can accept “arguments” to look for more specific information. • Try running “ls –a” and “ls –l”. What happens?
  • 13. cd • “current directory”, although I like to think of it as “change directory” • Used to change the directory the user is currently in. • Use “ls” to get the names of the directories in your current directory. Try using “cd <directory>” to move into it. • Use “cd ..” to move into the parent directory
  • 14. cat • “concatenate” • Displays the output of one or more files • The format is “cat <name of file>” – e.g. cat thisfile • Use “cd” and “ls” or “ls –l” to find some files, then use cat to see what is inside them.
  • 15. touch, rm • touch and “remove” • touch is used to create a blank file – You can edit it later – e.g. “touch test” • rm deletes a file –e.g. “rm test” – There is no recycling bin for the command line, so once a file is gone it’s gone.
  • 16. mkdir, rmdir • “make directory”, “remove directory” • I’ll give you three guesses… • You can only remove an empty directory – You must delete all of the files inside the directory first – Deleting can be done faster using “globbing” (discussed later)
  • 17. mv & cp • “move” and “copy” • mv will create a copy of a file or directory and delete the original. cp does not delete the original. • If the second input is a file instead of a folder, then the file is renamed. – e.g. mv oldfilename newfilename
  • 18. Task #1 – 5 minutes • Create a directory called “alphanumeric” • Move into the directory, and create four files: “a”, “b”, “1” and “2” • Move out of the directory and create a copy of “alphanumeric”. • Create two new directories called “letters” and “numbers” • Move the files whose names are letters into the “letters” directory, and the numbers into “numbers” • Delete the original “alphanumeric”
  • 19. Shell “Globbing” • Moving files one at a time is incredibly tedious • Luckily, bash lets us match many characters at the same time. This matching is called shell “globbing” • Create three new files: “apple”, “apricot”, and “banana” • Compare “ls”, “ls a*”, “ls app*”, and “ls *a”
  • 20. Special Characters in Globbing Character Name Function * Asterisk Wildcard. Matches any characters to any length. ? Question Mark Wildcard. Matches a single character. [] Square Br. Matches a range of characters. {} Curly Br. Matches a range of expressions.
  • 21. Fast Cleanup • Use globbing to list all of the files in “alphanumeric” that have a letter in their name. • Move a copy of every file in alphanumeric that starts with a letter into the “letters” folder. • Delete all of the files in alphanumeric, then remove the directory
  • 22. pipe • Not a command, but a key feature of bash and many other CLI s • Allows you to take the output of one command, and use it as the input of another • The symbol is “|”
  • 23. grep • grep lets you search text for matching information – e.g. grep something filename • By itself it is only a little bit useful, but it becomes very powerful when combined with pipes. • e.g. ls | grep something
  • 24. man • Stands for “manual” • If you don’t understand a command, “man” will return the documentation for it. • The format is “man <command>”
  • 26. Access Issues Off-Campus • Apparently some people are having trouble accessing the VDI from off campus. • I’ve talked to the IT department and they told that it has been resolved • If you are still having trouble let me know and I will investigate it further with them.
  • 27. A Bit About Batch and CMD • For over 15 years, cmd was the default shell environment used in Windows • Batch files were simple lists of command line instructions. – Although limited in what they could do individually, it was possible to schedule multiple batch files together to accomplish complex tasks. • Batch files remain in widespread use today
  • 28. Problems With This • Cmd does not have a built in scripting language – This means that it cannot access powerful features of the kernel in the same way that bash can • While you can string batch files together, this creates many new points of possible failure – Even with scheduling, they are still very limited in what they can do
  • 29. Introducing Powershell • Created in 2002 • Is a shell language, scripting language, and REPL. • Has been slowly replacing batch over the last decade • The syntax of powershell is based around three concepts: – Cmdlet -Alias -Application
  • 30. Cmdlet • Are made of verb-noun pairs – example “get-command”, “restart-computer”, “set-location” – Gives an idea of what the command does • Try running those commands (except for restart-computer) along with get-childitem
  • 31. Alias • An alias is an alternative name for a cmdlet Cmdlet Alias ls get-childitem cd set-location cp copy-item
  • 32. Finding Common Ground • The command get-command listed all of the commands in Powershell – You can narrow it down with the “-name” argument Find if Powershell supports cat, touch, rm, mkdir, rmdir, mv, man, and grep. Also, test if shell globbing works the same way.
  • 33. Application • Applications are just that, applications. You can launch them from powershell in the same way that you can launch them by double clicking. • Try running “mspaint.exe” or “notepad.exe” for a practical example.
  • 34. Longer Paths • Right click on a desktop shortcut. Go to “properties” and copy the “target”. Try pasting it into powershell and running it. What happens? • Without using the internet, can you figure out how to start the program from Powershell? – Hint: try using “get-command –name”, along with globbing, to search for commands using key words. (e.g. “get-command -name *start*”)

Editor's Notes

  1. Example: 1pm you move the files to a server. 1:30 the server compresses the files. 1:45 the compressed file is moved into an archive. &amp;lt;number&amp;gt;