The Shell Game Part 1: What is a shell?

12
The Shell Game, Part 1 Kevin O'Brien Washtenaw Linux Users Group http://www.lugwash.org

description

Beginning an exploration of the Linux shell by answering the question "What is a shell?"

Transcript of The Shell Game Part 1: What is a shell?

Page 1: The Shell Game Part 1: What is a shell?

The Shell Game, Part 1

Kevin O'BrienWashtenaw Linux Users Group

http://www.lugwash.org

Page 2: The Shell Game Part 1: What is a shell?

What is a Shell?

“A shell is a program that provides the traditional, text-only user interface for Linux and other Unix-like operating systems. Its primary function is to read commands that are typed into a console (i.e., an all-text display mode) or terminal window (an all-text window) in a GUI (graphical user interface) and then execute (i.e., run) them.”

--http://www.linfo.org/shell.html

Page 3: The Shell Game Part 1: What is a shell?

Why “Shell”?

● At its most fundamental, the OS consists of a kernel, which is the heart of the OS

● The kernel keeps track of different processes running, gives them CPU time as needed, handles interaction with peripheral devices, etc.

● The Shell surrounds all of this, and creates a way to interact with it.

Page 4: The Shell Game Part 1: What is a shell?

So what is a shell?

● It is the basic way for a person to interact with a computer

● This is done by typing in commands● If you open a terminal window, you are using

the shell● If you cannot boot into a GUI interface, you

can usually boot into a shell and fix things

Page 5: The Shell Game Part 1: What is a shell?

Servers

● Servers commonly do not even bother to install a GUI. Everything is done via the shell.

● This saves on resources, since you do not have to devote RAM and CPU cycles to the GUI, and can instead devote them to serving files, or whatever.

Page 6: The Shell Game Part 1: What is a shell?

Headless Servers

● Sometimes a server is set up without a monitor even attached. This is called “Headless”.

● Server administration is done via a terminal connection of some kind, commonly via ssh

Page 7: The Shell Game Part 1: What is a shell?

ssh

● Ssh stands for Secure Shell● This is the replacement for telnet, which was

used in the old days● Telnet is not secure, that is why it was

replaced

Page 8: The Shell Game Part 1: What is a shell?

Server Administration

● Pretty much all server administration in Linux or indeed any Unix-like operating system is done via the shell

● This is not just because the shell saves on resources. It is also the case that the shell is more efficient, and more powerful, than any GUI.

Page 9: The Shell Game Part 1: What is a shell?

Tip for new users

● Buy a box of 3X5 index cards, and keep the box by your computer

● Every time you find a useful command, write it down. You may want to use this command again at a later time.

● Sometimes you will want to group related commands

Page 10: The Shell Game Part 1: What is a shell?

Example Card – Fixing an Install

● Here is a set of commands I put on one card to help me when I have a problem with an install on my Kubuntu machine

– Sudo dpkg --configure -a

– Sudo apt-get -f install

– Sudo fuser -vik /var/lib/dpkg/lock

Page 11: The Shell Game Part 1: What is a shell?

Why you need to know this

● Jaunty upgrade → No video!● No way to launch a GUI● But I could go into failsafe mode, and get a

shell prompt● With the help of a command I found online, I

got my video up and running again

Page 12: The Shell Game Part 1: What is a shell?

Coming attractions

● This is the first in a series of short presentations designed for the newcomer to Linux

● In future installments we will look at choices among shells, techniques for the most common shell (bash), and some tips and tricks to help move you to being an expert