element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
sudo Sergeant
  • Challenges & Projects
  • element14 presents
  • sudo Sergeant
  • More
  • Cancel
sudo Sergeant
Documents sudo Sergeant 07: System Program Shell
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
sudo Sergeant requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Engagement
Author: tariq.ahmad
Date Created: 24 Oct 2017 8:32 PM
Last Updated: 18 Jan 2019 4:12 PM
Views: 238
Likes: 5
Comments: 2
Related
Recommended

sudo Sergeant 07: System Program Shell

element14's The Ben Heck Show

Join the Ben Heck team every week for amazing hacks! Watch them build and mod community-inspired projects using electronics!

Back to The Ben Heck Show homepage

sudo Sergeant
Featured Bonus Content
See All Episodes

 

 

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

Felix gives an introduction to virtual consoles, terminal emulators, and program shells. He traces terminal emulator to its historical antecedent; an early electromechanical device known as a teleprinter, teletypewriter console, or teletype; and discusses how the terminal program emulates the legacy hardware connected to the mainframe.

 

 

A program shell is a system program for executing other programs, conducting administrative tasks, or to run scripts. It is sometimes referred to as a prompt, command line interface, console user interface, character user interface, command line/language interpreter, or interactive command line. The program shell is an interactive command interpreter intended as a scripting language and contains most of the features that are commonly considered to produce structured programs.

 

When you hear the words terminal the first thing you probably imagine is a dark screen with a blinking cursor that is used to type instructions to direct a machine.  It wasn't always this way.  The terminal emulator is the modern evolution of an early electromechanical device known as a teleprinter, teletypewriter console, or teletype. A teletype printer is an electromechanical device, similar to a typewriter, used to send commands to a mainframe and receive output. A console and a terminal were essentially the same thing, however slightly different. The console was generally comparable in hardware terms to any other terminal except that a terminal connected directly to the mainframe and was intended for system maintenance. This entire process is now emulated by software.  As Linux evolved, the functionality of consoles has been built into the kernel as virtual consoles. Software has been written to emulate terminals. Its legacy can be found in the abbreviation tty, which is used to identify virtual consoles or to represent terminal connections.

 

A terminal is a program that emulates the legacy physical hardware connected to a mainframe. It allows text input and produces text output. Just a few of the many examples of terminals include console, gnome terminal, LX terminal X term, and terminator. A console is essentially the same as terminal, however, in historical context, it was generally considered the point of interaction with a mainframe and was intended for system maintenance. In a modern system the virtual consoles serve a very similar role. The shell is a program that receives and interprets instructions. The shell can run independently of the terminal emulator, however, we will only be examining it in terms of its relation to the terminal emulator. There are numerous shells to choose from. There are quite a few examples of this including: Bourne Shell (SH), Bourne-Again Shell (BASH), C Shell (CSH), Korn Shell (KSH), and Remote Shell (RSH/IP). The prompt is the beginning line in a program shell which signifies start of input. The command line is the space to the right of the prompt where instructions and data are input. You’ll generally find your blinking cursor here.

 

Felix demonstrates how to switch between different virtual consoles. From command line he types "W" which allows him to see which user is logged into which console. The screen shows that the only virtual console that’s active is tty1:

 

On this particular machine there are six different virtual consoles that are setup.  To switch between them you simply hold down “ctrl alt” and then press either function key 1 through function key 6 sequentially.  To go from tty1 to tty2 simply hold down “ctrl alt” and function key 2.

 

 

Hitting “control alt” and then function key 3 gives you tty3. After demonstrating this with all six virtual consoles he goes back to tty2 and logs into it. Felix goes back to tty3 and logs in as a different user.

 

 

Next, Felix goes to Virtual Console 2 and instantiates another instance of the graphical environment. To do this he types startx and this gives him a whole new desktop that is completely different from the previous desktop.  Anything they do on the graphical environment that they’ve instantiated on virtual console 2 will be completely independent from anything they do on virtual console one.  A practical instance of this would be if someone wanted to set up a machine to do multiseat.  Multiseat is sort of like multihead except the difference is that there are multiple monitors connected to one computer but at each monitor there is also an addition of input devices like a keyboard and mouse. So there’s multiple keyboards and monitors, maybe even audio devices, all connected to one computer, and then it would essentially function as a mainframe did a long time ago.

 

In the comments below tell us about your experience with teletypes or what you’ve done with virtual consoles!

  • command line interface
  • csh
  • program shell
  • sh
  • sudo sergeant
  • command line language interpreter
  • terminal
  • mainframe
  • multihead
  • tty
  • terminal emulators
  • teleprinter
  • bourne shell
  • ksh
  • telewriter console
  • virtual consoles
  • korn shell
  • graphical environment
  • character user interface
  • interactive command line
  • rsh ip
  • bash
  • rpi
  • multiseat
  • program shells
  • remote shell
  • command line
  • startx
  • console user interface
  • bourne-again shell
  • prompt
  • c shell
  • teletype
  • terminal program
  • sudosergeant
  • linux
  • Share
  • History
  • More
  • Cancel
Anonymous

Top Comments

  • DAB
    DAB over 4 years ago +2

    Very nice episode.

     

    Yes, I have used a teletype device, the initial CRT terminals, vector display devices and a number of other input and output devices.

     

    I thought the talk was a little light on the shell…

  • Sean_Miller
    Sean_Miller over 4 years ago +2

    This brought back a memory from 22 years ago in college.  I was on a Silicon Graphics computer running Unix, I think.  I was running a program that took peptide molecules and iterated calculations until…

  • Sean_Miller
    Sean_Miller over 4 years ago

    This brought back a memory from 22 years ago in college.  I was on a Silicon Graphics computer running Unix, I think.  I was running a program that took peptide molecules and iterated calculations until they were in their most relaxed structure.  It hung for about 10 seconds, so, I decided to kill it the old fashion way.  I turned it off and back on.

     

    About two seconds later several heads popped up out of cubicles really mad.  Luckily, they were mad at the computer thinking it crashed versus me hard booting it.

     

    I guess I had the fast computer that everyone was running sessions on.

     

    22 years later, I learn "w".  Funny.

    • Cancel
    • Up +2 Down
    • Reply
    • More
    • Cancel
  • DAB
    DAB over 4 years ago

    Very nice episode.

     

    Yes, I have used a teletype device, the initial CRT terminals, vector display devices and a number of other input and output devices.

     

    I thought the talk was a little light on the shell idea.

     

    Back when the scripting languages began, we used them to create higher level programs that did routine and tedious tasks.  It was so much easier to type in a code word and have backup or a system checkup run without needing to repeatedly type in the individual commands for devices that did not change.

     

    The power that a script gave system mangers is amazing compared to what we needed to do with just the command line prompt, or worse, the switch panel. (yes, most of you have no idea that we used to enter binary commands directly into computer memory using switches that represented individual bits) (No you did not miss anything).

     

    DAB

    • Cancel
    • Up +2 Down
    • Reply
    • More
    • Cancel
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube