Chapter 1: Introduction to Linux PDF

Summary

This document is Chapter 1 of a textbook on operating systems, introducing the Linux operating system and its key concepts. The chapter covers the basics, including Linux distributions, graphical user interfaces (GUI) such as GNOME and KDE, and the command line interface (CLI). The material serves as a primer for understanding the fundamentals of Linux.

Full Transcript

Operating Systems 2 TECM 113 Chapter 1: Introduction to Linux Dr/ Amina Magdich TECM 113 2 Chapter 1: Introduction to Linux Chapter outline  I. Introduction  II. Linux Overview  III. Use...

Operating Systems 2 TECM 113 Chapter 1: Introduction to Linux Dr/ Amina Magdich TECM 113 2 Chapter 1: Introduction to Linux Chapter outline  I. Introduction  II. Linux Overview  III. User interfaces:  III.1. Graphical user interface  III.2. Command Line interface  IV. Conclusion Dr/ Amina Magdich TECM 113 3 Chapter 1: Introduction to Linux I. Introduction:  Linux is an open source and free Operating System  Linux offers different distributions  Linux offers two interfaces: graphical interface and command line interface  An overview of Linux will be given in this chapter Dr/ Amina Magdich TECM 113 4 Chapter 1: Introduction to Linux II. Linux Overview:  Linux is one of popular version of UNIX operating system: it was designed considering UNIX compatibility.  Linux is an operating system, much like Microsoft Windows or Apple Mac OS.  Linux is open source, freely available, secure, portable, multi- user and multi-tasking. Dr/ Amina Magdich TECM 113 5 Chapter 1: Introduction to Linux II. Linux Overview II. 2. Linux architecture  Kernel: is the core part of the Linux system. It interacts with the hardware managing various components like the CPU, peripheral devices, and memory.  Shell: It i Is a program that interprets commands and sends them to the OS.  Utilities: programs that provide the user most of the functionalities of an operating Linux architecture system. Dr/ Amina Magdich TECM 113 6 Chapter 1: Introduction to Linux II. Linux Overview II. 3. Linux Distributions  GNU/Linux offers different distributions, mainly the following: Ubuntu Fedora Linux Mint OpenSuse Debian Mandriva CentOS archlinux Dr/ Amina Magdich TECM 113 7 Chapter 1: Introduction to Linux II. Linux Overview Ubuntu :  Ubuntu is currently one of the most popular Linux distributions  Ubuntu is based on Debian distribution, one of the oldest Linux distributions  Ubuntu is stable, reliable, and easy to use  Ubuntu is open-source  It is a good distribution mainly for beginners  It was primarly intended to be used on personal computers Dr/ Amina Magdich TECM 113 8 Chapter 1: Introduction to Linux III. User interfaces  A user Interface is:  A software layer for user interaction  Includes the command processor  Includes the visual components of the OS  Types of User Interfaces: 1. Graphical User Interface (GUI)/ Desktop user interface: is an interface that allows users to interact with the system in a visual manner. GUIs typically have icons, windows, or graphics of some kind. 2. Command-Line Interface (CLI): is an interface in which the user types commands at a prompt. Dr/ Amina Magdich TECM 113 9 Chapter 1: Introduction to Linux III. User interfaces  Graphical User Interface (GUI) architecture:  GUI is an interface that allows users to interact with the system visually through icons, windows, or graphics.  GUI is the face of the operating system provided by the X Window System.  X window system is a protocol that allows interfaces to build on top of their x server Layering of Linux GUI Environment Dr/ Amina Magdich TECM 113 10 Chapter 1: Introduction to Linux III. User interfaces 1. Graphical User Interfaces (GUI) in Linux:  A desktop is the invisible window that allows users to set a background and place desktop icons.  There are two primary desktop interfaces in the Linux world: GNOME and KDE. Examples of Graphical Dr/ Amina Magdich interfaces TECM 113 11 Chapter 1: Introduction to Linux III. User interfaces 1. Graphical User Interfaces (GUI) in Linux:  GNOME:  Is the default window manager for Ubuntu and Redhat.  The GNOME project’s aim is to build a complete, user-friendly desktop based entirely on free software.  GNOME is a very popular, particularly on the Linux platform. Dr/ Amina Magdich TECM 113 12 Chapter 1: Introduction to Linux III. User interfaces  GNOME: Example of Dr/ Amina Magdich GNOME TECM 113 13 Chapter 1: Introduction to Linux III. User interfaces 1. Graphical User Interfaces (GUI) in Linux:  KDE:  Is a modern network transparent desktop environment which uses the Qt cross-platform GUI toolkit.  It contains a base set of applications such as window manager (called Kwm), web browser, integrated help system, translations for over 50 languages, and so on. Dr/ Amina Magdich TECM 113 14 Chapter 1: Introduction to Linux III. User interfaces  KDE: Example of KDE Dr/ Amina Magdich TECM 113 15 Chapter 1: Introduction to Linux III. User interfaces 1. Graphical User Interfaces (GUI) in Linux:  XFce  Is a lightweight desktop environment for UNIX platforms.  It is similar to the commercial CDE, and is now based on the GTK+ toolkit  CDE (Common Desktop Environment), is a commercial graphical user interface for UNIX. Dr/ Amina Magdich TECM 113 16 Chapter 1: Introduction to Linux III. User interfaces  XFce: KFCE interface CDE interface Dr/ Amina Magdich TECM 113 17 Chapter 1: Introduction to Linux III. User interfaces  Linux applications:  The software applications used for Linux are free and open source.  Many Linux distributions come with a number of essential software packages already bundled.  Example of Linux applications: - Internet browser (eg. Firefox) - Thunderbird : email client - Libre office : free office suite - Visual studio code: code editor - Shotcut: video editor Dr/ Amina- Magdich And so on… TECM 113 18 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Command line is a non-graphical user interface  It is a text-based user interface used to view and manage system resources through typing commands. Dr/ Amina Magdich TECM 113 19 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux: Command Line Dr/ Amina Magdich interface TECM 113 20 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Bash  Is the GNU project’s shell (the Bourne Again Shell)  Is a linux shell  is the default command interpreter on most GNU/Linux systems.  is a command language interpreter that executes commands read from the keyboard. Dr/ Amina Magdich TECM 113 21 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: a. $ history  To view the previously executed command, type the command $history  To view the limited number of commands executed previously, use the command $history N (N is the number of commands required to display) https://www.youtube.com/watch?v=RkxIWlypB-s Example: Dr/$history Amina Magdich 5  to list the last five commands TECM 113 22 Chapter 1: Introduction to Linux III. User interfaces Results of the command $history 5 Results of the command $history Dr/ Amina Magdich TECM 113 23 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: a. $ history  It is possible to list the history using specified words: $history | grep Example: $history | grep chpasswd  to list the last commands containing the word chpasswd https://www.youtube.com/watch?v=RkxIWlypB-s Dr/ Amina Magdich TECM 113 24 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux: Results of the command $history | grep chpasswd Dr/ Amina Magdich TECM 113 25 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: a. $ history  To remove the history use $history -c Example: $history -c Results of the command $history -c Dr/ Amina Magdich TECM 113 26 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: b. Shell variables  Set a variable  To set an environment variable, use the following command Variable_Name=Value Example: MyVar=435  This command creates the variable MyVar and sets its content to 435 Dr/ Amina Magdich TECM 113 27 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: b. Shell variables  Display a variable  To display the content of a variable, use the command echo echo $Variable_Name Example: echo $MyVar Dr/ Amina Magdich TECM 113 28 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: b. Shell variables  Unset a variable  To unset a variable (remove a variable from the shell environment), use the command unset unset Variable_Name Example: unset MyVar Dr/ Amina Magdich TECM 113 29 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: b. Shell variables  List the current variables  To list the current variables, use the command $set Example: $set Dr/ Amina Magdich TECM 113 30 Chapter 1: Introduction to Linux III. User interfaces Exercice: 1. Create a variable LANG with a value 45 2. Copy the value of LANG to MyLANG 3. List the current shell variables 4. Display the content of the variable LANG 5. Unset the variable LANG Dr/ Amina Magdich TECM 113 31 Chapter 1: Introduction to Linux III. User interfaces Exercice: Dr/ Amina Magdich TECM 113 32 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: c. Standard I/O and redirecting  Redirecting output: Redirecting output means redirecting the data which would normally appear on the screen to be stored in a file instead Redirect output to a file using > or >> > is used to overwrite the old content of the destination file >> is used to add the output to the content of the destination file while conserving its old content https://www.youtube.com/watch?v=XMeWcFXjRks Dr/ Amina Magdich TECM 113 33 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: c. Standard I/O and redirecting  Redirecting output: Example: - $man chmod > File1  This command redirects the results of the command man chmod to the file File1 while overwriting the old content of the file File1 Dr/ Amina Magdich TECM 113 34 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: c. Standard I/O and redirecting  Redirecting output: Example: - $man chmod >> File1  This command redirects the results of the command man chmod to the file File1 while conserving the old content of the file File1 Dr/ Amina Magdich TECM 113 35 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: c. Standard I/O and redirecting  Redirecting input: Redirecting input means redirecting any data that would normally be obtained from a file into an application Redirect input from a file using < https://www.youtube.com/watch?v=XMeWcFXjRks Dr/ Amina Magdich TECM 113 36 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: c. Standard I/O and redirecting  Redirecting input: Example: - $wc -l or 2>> Example: mkdir ‘ ‘ 2> log.text  This redirects the error raised by the invalid directory name “, and writes it to log.txt. Note that the error is still sent to the terminal and displayed as text. Dr/ Amina Magdich TECM 113 38 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: d. Pipes  Pipes are used to redirect a stream from one program to another.  When a program’s standard output is sent to another through a pipe, the first program’s data, which is received by the second program, will not be displayed on the terminal. Only the filtered data returned by the second program will be displayed.  The Linux pipe is represented by a vertical bar | Dr/ Amina Magdich TECM 113 39 Chapter 1: Introduction to Linux III. User interfaces 2. Command Line interface in Linux:  Common commands: d. Pipes Example: $ ls | less This takes the output of ls, which displays the contents of your current directory, and pipes it to the less program. less displays the data sent to it one line at a time. https://www.youtube.com/watch?v=9gSPo-9mLOs Dr/ Amina Magdich TECM 113 40 Chapter 1: Introduction to Linux IV. Conclusion ▸ Linux is a an open source and free Operating system ▸ Different distributions are available in Linux ▸ Two main user interfaces are available in Linux : GUI and CLI ▸ Commands are used while employing command line interface Dr/ Amina Magdich TECM 113 41

Use Quizgecko on...
Browser
Browser