Introduction to Linux – Full Course for Beginners

**Understanding IP Addresses and Networking**

IP addresses are unique logical network addresses assigned to devices on a network. IPv4 uses 32 bits for addresses, while IPv6 uses 128 bits for addresses. Every IP address contains both a network and a host address field. There are five classes of network addresses available: A, B, C, D, and E.

**Domain Name System (DNS)**

The Domain Name System (DNS) is used for converting Internet domain and host names to IP addresses. DNS plays a crucial role in facilitating communication between devices on the internet by translating human-readable domain names into machine-readable IP addresses.

**Configuring Network Interfaces**

The ifconfig program is used to display current active network interfaces. The commands IP addr show and IP route show can be used to view IP addresses and routing information, respectively. Additionally, using the ping command allows users to check if a remote host is alive and responding.

**Managing IP Routing**

The route utility program is used to manage IP routing. This includes setting up routes, modifying existing routes, and deleting unnecessary routes. The route program provides detailed information about the network routes configured on the system.

**Debugging Networking Issues**

Networking tools such as routing tables, ping commands, and packet sniffers can be used to monitor and debug networking problems. These tools help identify issues with connectivity, routing, and other network-related concerns.

**Graphical Browsers vs. Text Browsers**

Linux offers both graphical browsers (such as Firefox, Google Chrome, Chromium, and Epiphany) and text-based or non-graphical browsers (such as Links and W3M). Graphical browsers provide a user-friendly interface for browsing the internet, while text browsers offer a simple way to view web pages without the need for graphics.

**Downloading Web Pages**

The `wg` command can be used to download web pages. This allows users to easily save websites to local storage or transfer files from one system to another.

**Obtaining Information about URLs**

Curl is a powerful command-line tool that can be used to obtain information about URLs, such as headers, metadata, and other details. Users can use Curl to fetch data from websites, inspect the contents of web pages, and perform various other tasks related to URL management.

**Secure Shell (SSH) and Secure Copy (SCP)**

Secure Shell (SSH) is a cryptographic network protocol used for secure data communication between two devices on a network. SSH provides a secure way to administer systems that are not easily accessible physically but can be accessed remotely using a username.

When using SSH, users can log in to remote systems without having to enter a password each time. This feature can be configured using SSH keys or other authentication methods. Once logged in, users can run commands on the remote system and perform various tasks.

Secure Copy (SCP) is another protocol that uses SSH for transferring data between two networked hosts. SCP allows users to securely copy files from one system to another without exposing sensitive information over the network.

**Demonstrating SSH and SCP**

A demonstration of using secure shell and secure copy between two virtual machines, Ubuntu and Centos, can be used to illustrate these concepts in practice. The demonstration involves:

* Obtaining IP addresses for both machines

* Logging into the remote system using SSH

* Copying files from one machine to another using SCP

This example shows how users can leverage SSH and SCP to securely manage data and interact with remote systems.

**Networking Tools and Utilities**

Various networking tools and utilities are available in Linux, including:

* IP addr show and IP route show commands for displaying network information

* Ping command for checking if a remote host is alive and responding

* Route utility program for managing IP routing

* Networking tools for debugging and monitoring network issues

**Additional Resources**

For users interested in learning more about Linux networking, there are additional resources available:

* A text-based version of the course linked from the video description

* Sections on bash shell and scripting

* Information on printing and local security principles

"WEBVTTKind: captionsLanguage: enwelcome to this introduction to Linux course I'm Bo K and I will be teaching this course this course is designed for computer users who have limited or no previous exposure to Linux whether they're working in an individual or Enterprise environment this course explores the various tools and techniques commonly used by Linux system administrators and endusers to achieve their day-to-day work in a Linux environment you will gain a good working knowledge of Linux and how to navigate through major Linux distributions system configurations and graphical interfaces of L Linux basic command line operations common applications of Linux and more upon completion of this training you should have a good working knowledge of Linux from both a graphical and command line perspective allowing you to easily navigate through any of the major Linux distributions the content of this course was developed by the Linux Foundation Who provided a Grant to make this course possible I've taken their primarily text based course and turned it into a video-based course throughout the course you will see some video segments that were developed by the Linux Foundation also you should know that sometimes throughout this course I put Linux commands on the screen like this the dollar sign at the beginning is not part of the command that just indicates the command should be typed into the system shell or terminal so if you're following along type everything after the dollar sign in the description of this video I've linked to a text based version of this course okay let's get started by the end of this chapter you should be able to describe the software environment required for this course and describe the three major Linux distribution families in order to fully benefit from this course you will need to have at least one link Linux distribution installed if you're not already familiar with the term distribution as it relates to Linux you soon will be you are about to learn some more details about the many available Linux distributions because there are literally hundreds of distributions I'm not covering them all in this course instead I'll focus on the three major distribution families the families in representative distributions this course will focus on are red hat family system sys including C OS and Fedora Susi family systems including open Susi and Debian family systems including Ubuntu and Linux Mint I'm about to tell you more about red hat Susi and Debian well this course focuses on these three major Linux distribution families as long as there are talented contributors the families of distributions and the distributions within these families will continue to change and grow people see a need and develop special configurations and utilities to respond to the need sometimes that effort creates a whole new distribution of Linux sometimes that e effort will leverage an existing distribution to expand the members of an existing family Red Hat Enterprise Linux or Rel heads the family that includes cnos cnos stream fedora and Oracle Linux Fedora has a close relationship with re and contains significantly more software than Red Hats Enterprise version one reason for this is that a diverse Community is involved in building Fedora with many contributors who do not work for Red Hat furthermore it's used as a testing platform for future real releases in this course we'll mainly use syn OS stream from the Red Hat Family the basic version of CN OS is also virtually identical to Rel the most popular Linux distribution in Enterprise environments however cnos 8 has no more scheduled updates the replacement is cnos 8 stream some of the key facts about the red hat distribution family are Fedora serves as an upstream testing platform for real cnos is a close clone of real while Oracle Linux is mostly a copy with some changes it supports Hardware platforms such as Intel x86 arm itanium power PC and IBM system Z it uses the Yum and dnf RPM based yum package managers uh to install update and remove packages in the system re is widely used by Enterprise which hosts their own systems the Susi family and their the relationship between Susi and open Susi is similar to the one described between real cnos Idora we use open Susi as the reference distribution for the Susi family as it's available to end users at no cost because the two products are extremely similar the material that covers open Susi can typically be applied to SLE with few problems some of the key facts about the Susi family are the Susi Linux Enterprise server or SLE is Upstream from open Susi it uses the RPM based zipper package manager which we'll cover later to install update and remove packages in the system it includes the yast or yet another setup tool application for system administration purposes slas is widely used in retail and many other sectors the Debian distribution is Upstream for several other distributions including auntu in turn a Von 2 is Upstream for Linux Mint and a number of other distributions it's commonly used on both servers and desktop computers Debian is a Pure open- Source Community project which is not owned by any Corporation and has a strong focus on stability and dbm provides by far the largest and most complete software repository to its users of any Linux distribution Ubuntu aims to at providing a good compromise between long-term stability and ease of use since autu gets most of its packages from Debian stable Branch it also has access to a very large software repository for those reasons we will use auntu LTS or long-term support as the reference to the dbm family distributions for this course some key facts about the dbm family are the dbm family is Upstream for Ubuntu and yuntu is Upstream for Linux Mint and others it uses the dpkg based AP package manager which we'll cover later in detail to install update and remove packages in the system Ubuntu has been widely used for cloud deployments while and while Ubuntu is built on top of Debian and is gnome based under the hood it differs visually from the interface on standard Debian as well as other distributions so in conclusion there are three m Major Distribution families within Linux Red Hat Susi and Debian in this course we'll work with Representative members of all of these families throughout by the end of this chapter you should be able to define the common terms associated with Linux and discuss the components of a Linux distribution in order for you to get the most out of this course we recommend that you have Linux installed on a machine that you can use throughout this course you can use this brief installation guide preparing your computer for Linux training it will help you to select a Linux distribution to install decide on whether you want to do a standalone pure Linux machine or a dual boot one whether to do a physical or virtual install and more and then it guides you through the steps I'll also cover installation soon well we have not covered everything in great detail but keep in mind that most of the documentation in Linux is actually already on your system in the form of band Pages which we'll discuss in great detail later whenever you do not understand something or want to know more about a command program topic or utility you can just type man and then the topic at the command line so I'll just assume you're thinking this way so I won't constantly repeat for more information look at the man page for this topic on a related note throughout the course we'll use a shorthand that is common in the open-source Community when referring to cases where the user has to make a choice of what to enter like a name of a program or file we use the shorthand Fu to represent the to basically represent insert file name here so we're not actually suggesting that you manipulate files or install Services called Foo the best way to learn Linux is by doing it so make sure to try things out yourself as you follow along you'll need to have a Linux system up and running that can either be a native Linux system on your Hardware running through a live USB stick or CD or a virtual machine running through a hypervisor we'll show you all these methods so let's get going before you begin using Linux you need to be aware of some basic terms such as kernel distribution boot loader service file system X Windows system desktop environment and command line these are very commonly used by the Linux Community the kernel is considered the brain of the Linux operating system it controls the hardware and makes the hardware interact with the applications an example of a kernel is the Linux kernel the most recent Linux kernel along with past Linux kernels can be found at the kernel.org website a distribution also known as dros is a collection of programs combined with the Linux kernel to make up a linux-based operating system some common examples of a distribution are red hat Enterprise Linux Fedora Ubuntu and gentu the boot loader as the name implies is a program that Boots the operating system two examples of a boot loader are grub and isol Linux a service is a program that runs as a background process some examples of the service are a httpd nfsd ntpd ftpd and name d a file system is a method for storing and organizing files in Linux some examples of file systems are ext3 ext4 fat xfs and butter FS the X Windows system provides the standard toolkit and protocol to build graphical user interfaces on nearly all Linux systems the desktop environment is a graphical user interface on top of the operating system gome KDE xfce and fluxbox are some examples of the desktop environment the command line is an interface for typing commands on top of the operating system the shell is the command line interpreter that interprets the command line input and instructs the operating system to perform any necessary test tasks and commands for example bash TC shell and zshell suppose you've been assigned to a project building a product for a Linux platform project requirements include making sure that project works properly on the most widely used Linux distributions to accomplish this you need to learn about the different components services and configurations associated with each distribution we're about to look at how you would go about doing exactly that so what is a Linux distribution and how does it relate to the Linux kernel the Linux kernel is the core of the operating system a full Linux distribution consists of the kernel plus a number of other software tools for file related operations user management and software package management each of these tools provides a part of the complete system each tool is often its own separate project with its own developers working to perfect that piece of the system while the most recent Linux kernel and earlier versions can always be found in the Linux kernel archives Linux distributions may be based on different kernel versions for example the very popular real 8 distribution is based on the 4.18 Kernel which is not new but is extremely stable other distributions may move move more quickly in adopting the latest kernel releases it's important to note that the kernel is not an All or Nothing proposition for example re and C OS have Incorporated many of the most the more recent kernel improvements into their older versions as have auntu op sui SL and more examples of other essential tools and and ingredients provided by distributions include the C and C++ and claim compilers the GDB de debugger the core system libraries applications need to to link with in order to run the low-level interface for drawing graphics on the screen as well as the higher level desktop environment and the system for installing and updating the various components including the C the kernel itself in all distributions come with a rather complete Suite of applications already installed the vast variety of Linux distributions are designed to cater to many different audiences and or organizations according to their specific needs and tastes however large organizations such as companies and governmental institutions and other entities tend to choose the major commercially supported distributions from Red Hat Susi and canle which is iunu SOS and C OS stream are popular free alternatives to Red Hat Enterprise Linux real and are often used by organizations that are comfortable operating without paid techn technical support huntu and pedora are widely used by developers and are also popular in the educational realm scientific Linux is favored by the scientific research Community for its compatibility with scientific and mathematical software packages both cnos variants are binary compatible with real which means in most cases binary software packages will install properly across the distributions many commercial Distributors including Red Hat Ubuntu Susi and or Le provide long-term fee based support for their distributions as well as hardware and software certification all major distributions provide update services for keeping your system primed with the latest security and Bug fixes and performance enhancements as well as provide online support resources you have completed chapter 2 let's summarize the key Concepts covered Linux borrows heavily from the Unix operating system with which its creators were well-versed Linux accesses many features and services through files and filik objects Linux is a fully multitasking multi-user operating system with built-in networking and service processes known as dam some of the more common terms used in Linux are kernel distribution bootloader service file system X window system desktop environment and command line and a full Linux distribution consists of the kernel plus a number of other software tools for file related operations user management and software package management by the end of this chapter you should be able to identify Linux file systems identify the differences between partitions and file systems describe the boot process and install Linux on a computer the Linux boot process is the procedure for for initializing the system it consists of everything that happens from when the computer is first switched on until the user interface is fully operational having a good understanding of the steps in the boot process may help you with troubleshooting problems as well as with tailoring the computer's performance to your needs on the other hand the boot process can be rather Technical and you can start using Linux without knowing all the details starting an x86 based Linux system involves a number of steps when the computer's powered on the basic input output system or bios in initializes the hardware including the screen and keyboard and tests the main memory this process is also called post power on self test the bio software is stored on a ROM chip on the motherboard after this the remainder of the boot process is controlled by the operating system once the post is completed the system control passes from the BIOS to the bootloader the boot loader is usually stored on one of the hard diss in the system either in the boot sector for traditional bios or MBR systems or the EFI partition for more recent or unified extensible firmware interfaces or EFI ufi systems up to this stage the machine does not access any mass storage media there after information on date time and the most important peripherals are loaded from the seos values after technology used for the battery powered memory store which allows the system to keep track of the date and time when even when it's powered off a number of boot loaders exist for Linux the most common ones are grub for Grand unified boot loader isol Linux for booting from removable media and dos uboot for booting on embedded devices appliances most Linux boot loaders can present a user interface for choosing alternative options for booting Linux and even other op operating systems that might be installed when booting Linux the boot loader is responsible for loading the kernel image and the initial Ram disc or file system into memory the boot loader has two distinct stages for systems using the BIOS MBR method the bootloader resides at the first sector of the hard disk also known as the master boot record the size of the MBR is just 512 bytes in this stage the bootloader examines the partition table and finds a bootable partition once it finds a bootable partition it then searches for the second stage boot loader for example grub and loads it into RAM for systems using the EFI slfi method UEFI firmware reads its boot manager data to determine which UEFI application is to be launched and from where the firmware then launches the UEFI application for example grub as defined in the boot entry in the firmware boot manager the second stage boot loader resides under slash boot a splash screen is displayed which allows us to choose which operating system to boot after choosing the OS the boot lead boot the boot loader loads the Kel of the selected operating system into RAM and passes control to it kernels are almost always compressed so its first job is to uncompress itself after this it will check and analyze the system hardware and initialize any hardware device drivers built into the kernel the init Ram FS file system image contains programs and binary files that perform all actions needed to mount the proper root file system like providing kernel functionality for the needed file system and device drivers for mass storage controllers with a facility called udev for user device which is responsible for figuring out which devices are present locating the device drivers they need to operate properly and loading them after the root file system has been found it's checked for errors and mounted the mount program instructs the operating system that a file system is ready for use and Associates it with a particular point in the overall hierarchy of the file system the mount point if this is successful the the init Ram FS is is cleared from RAM and the init program from the root file system is executed init handles the mounting and pivoting over to the final real root file system if special Hardware drivers are needed before the mass storage can be accessed they must be in the init ramfs image near the end of the boot process init starts a number of text mode login prompts these enable you to type your username followed by your password and to eventually get a command shell however if you're running a system with a graphical login interface you'll not see these at first usually the default command shell is Bash but there are a number of other Advanced command shells available the shell prints a text prompt indicating it is ready to accept commands after the user types the command and presses enter the command is executed and another prompt is displayed after the command is done the boot loader loads the kernel and an initial Ram based file system into memory so it can be used directly by the kernel when the kernel is loaded in Ram it immediately initializes and configures the computer's memory it also configures all the hardware attached to the system this includes all processors IO subsystems storage devices and more the kernel also loads some necess are user space applications once the kernel has set up all its hardware and mounted the root file system the kernel runs the sbin init this then becomes the initial process which then starts other processes to get the system running most other processes on the system Trace their origin ultimately to init exceptions include the so-called kernel processes these are started by the kernel directly and their job is to manage internal operating system details besides starting the system init is responsible for keeping the system running and for shutting it down cleanly one of it one of its responsibilities is to act when necessary as a manager for all non-el processes it cleans up after them upon completion and restarts user login Services as needed when users log in and out and does the same for other background system services traditionally this process startup was done using conventions that date back to the 1980s and the system V variety of Unix this serial process had the system passing through a sequence of run levels containing collections of scripts that start and stop Services each run level supported a different mode of running the system with within each run level Individual Services could be set to run or to be shut down if running however all major distribu s have moved away from this sequential runlevel method of system initialization although they usually emulate many system V utilities for compatibility purposes next we'll discuss the new methods of which system MD has become dominant systems with system D start up faster than those with earlier init methods this is largely because it replaces a serialized set of steps with aggressive pitalization techniques which permits multiple services to be initiated simultaneously it has been adapted by all major distributions and so we'll not discuss the older system V method or upstart which has become a dead end complicated Startup shell scripts are replaced with simpler configuration files which enumerate what has to be done before a service is started how to execute service startup and what conditions the service should indicate have been accom accomplished when startup is finished one thing to note is that s spinit now just points to lib system d/ systemd so system D takes over the init process one system D command system control is used for most basic tasks while we have not yet talked about working at the command line here's a brief listing of its use think of a refrigerator that has multiple shelves that can be used for storing various items these shelves help you organize the grocery items by shape size type Etc the same concept applies to a file system which is the embodiment of a method of storing and organizing arbitrary collections of data in a human usable form different types of file systems supported by Linux include conventional disk file systems flash storage file systems database file systems and special purpose file systems this section will describe the standard file system layout shared by most Linux distributions a partition is a physically contigous section of a dis or what appears to be so in some Advanced setups a file system is a method of storing or finding files on a hard disk usually in a partition one can think of a partition as a container in which a file system resides although in some circumstances a file system can span more than one partition if one uses symbolic links which we'll discuss much later a comparison between file systems in Windows and Linux is shown in this table Linux systems store their important files according to a standard layout called the file system hierarchy standard which has long been maintained by the Linux Foundation having a standard is designed to ensure that users administrators and developers can move between distributions without having to relearn how the system is organized Linux uses the slash care to separate paths unlike Windows which uses the backslash and it does not have multiple Drive letters multiple drives and or partitions are mounted as directories in the single file system removable media such as USB drives and CDs and DVDs will show up as mounted at run/ media your username slis Lael for recent Linux systems or under SL media for older distributions for example if your username is student a USB pin Drive labeled Fedora might end up being found at run/ media student Fedora and a file readme.txt on that dis would be at run/ media student Fedora readme.txt all Linux file systems are case sensitive so these different ways of spelling boot represent three different directories or folders many distributions distinguish between core utilities needed for proper system operation and other programs and place the ladder in directories under SL USR or user now let's learn about viewing the file system hierarchy from the graphical interface in yuntu Click the file manager icon on the left panel by default it explores your home directory to see all directories under root directory click computer on the left places pane inside this window doubleclick the Etsy directory to open it double click aahi and press control L to see the current location the current path appears at the top of the window the path for this is Etsy aah now let's learn about viewing the file system hierarchy from the graphical user interface in open Susi click activities on the top left corner of the screen Corner click the file manager your icon on the left panel by default it explores your home directory click computer on the left places pane inside this window you can see all directories under the root directory doubleclick the Etsy directory to open it to see the current location doubleclick the avahi folder and press control L the current path appears at the top of the window the path for this is Etsy aahi suppose you intend to buy a new car what factors do you need to consider to make a proper Choice requirements which need to be taken into account include the size needed to fit your family in the vehicle the type of engine and gas economy your expected budget and available financing options reliability record and after Sal Services Etc similarly determining which distribution to deploy also requires planning here you can see some but not all choices note that many embedded Linux systems use custom crafted contents rather than Android or yako some questions worth thinking about before deciding on a distribution include what is the main function of the system what types of packages are important to the organization for example web server word process processing Etc how much hard disk space is required and how much is available for example when installing Linux on an embedded device space is usually constrained how often are packages updated how long is the support cycle for each release for example LTS releases have long-term support do you need kernel customization from a vendor or a third party what Hardware are you running on for example it might be x86 arm or PPC do you need long-term stability can you accept or need a more volatile Cutting Edge system running the latest software the partition layout needs to be decided at the time of installation it can be difficult to change later while Linux systems handle multiple partitions by mounting them at specific points in the file system and you can always modify the design later it's always easier to try to get it right to begin with nearly all installers provide a reasonable default layout with either all space dedicated to normal files on one big partition and a smaller swap partition or with separate partitions for some space sensitive areas like home and VAR you may need to override the defaults and do something different if you have special needs or if you want to use more than one dis all installations include the bare minimum software for running a Linux distribution most installers also provide options for adding categories of software common applications such as the Firefox web browser and Libra office office suite developer tools like the V and emex text editors which we'll explore later and other popular services such as the Apache web server tools or mySQL database are usually included in addition for any system with a graphical desktop a chosen desktop such as nomer KDE is installed by default all installers set up some initial security features on the new system one basic step includes setting the password for the super user rout and setting up an initial user in some cases only an initial user set up direct root login is not configured and root access requires logging in first as a normal user and then using PSE sudo as we'll describe later some distributions will also install more advanced security Frameworks such as SE Linux or app armor for example all red hat based systems including Fedora and CN OS always use SE Linux by default and yuntu comes with app armor up and running like other operating systems Linux distributions are provided on removable media such as USB drives and CDs or D DVDs most Linux distributions also support booting a small image and downloading the rest of the system over the network these small images are usable on Media or as Network boot images in which case it is possible to perform and install without using any local media many installers can do an installation completely automatically using a configuration file to specify installation options this file is called a Kickstart file for Red Hat based systems and Auto yes profile for Susi based systems and a preed file for Debian based systems each distribution provides its own documentation and tools for creating and managing these files the actual installation process is pretty similar for all distributions after booting from the installation media the installer starts and asks questions about how this system should be set up these questions are skipped if an automatic installation file is provided then the installation is performed finally the computer reboots into the newly installed system on some distributions additional questions are asked after the system reboots most installers have the option of downloading and installing updates as part of the installation process this requires internet access otherwise the system uses its normal update mechanism to retrieve retrieve those updates after the installation is done the demonstrations we see show how to install Linux directly on your machine erasing everything that was there while the demonstrations will not alter your computer following these procedures in real life will erase all current data there are also alternate methods to install Linux where you won't lose any data so some of those methods include repartition your hard disk to free up enough room to permit dual boot or side by-side installation of Linux along with your present operating system or using a host machine hypervisor program such as vmware's products or Oracle virtual box to install a client Linux virtual machine and finally booting off of and using a live CD or USB disc and not riding to the hard disk at all the first method is sometimes complicated and should be done when your confidence is high and you understand the steps involved the second and third methods are quite safe and make it difficult to damage your system here are the steps to install yuntu now going to do an install of Ubuntu 1804 as a virtual machine under the VMware hypervisor using a redhead 7 host system running VMware Player so first thing we need to do is to create a new virtual machine and for that I already have the uh Ubuntu install disc mounted uh in the virtual CD drive and we'll give it a name for the user as LF student with a username of student and we have to give a password which I've done and then for the name let's just call it Ubuntu and then on the host machine I want to have a certain place I want to put it uh rather than my home directory I want it in a on a disc that has a lot of space and then let's allocate 30 gigabyt of space and I prefer to have it as one big file rather than multiple files or slices I find that clutters my system less and really that's all you have to do to start setting up the install but it's better to click on customize hardware and increase the amount of memory from 1 Gigabyte to four in my case and I might as well take advantage of having multiple processors so I'll let it use all four processors on this host machine and then I'll just click on finish and uh it will start the install after a couple of harmless messages about how the virtual machine graphics driver doesn't permit accelerated graphics performance now the beautiful thing about the Ubuntu install on this recent version is that I am done there are no more choices to make I don't have any more parameters to specify Etc if I hadn't been installing in a virtual machine it would have asked me information like username and password at this stage but it was able to pick that up because of the intelligent way that VMware can handle UB to so I'm doing this in real time if you can read the messages you see it just created the the main file system on the system and now it's going to the stage of copying all the files over to the hard disk or I should say the simulated hard disk now this takes a little bit of time so I'll pause the recording for a few seconds so you don't have to watch not much happening I skipped about a minute or so and now it says it's almost finished copying files it's showing a bunch of different blurbs for various features in this bionic Beaver or Ubuntu 18.04 release the status bar has reached all the way to the right so it should be almost done and now it's doing the actual install of the system so it's copied all the files it needs over to the hard disk and it's doing the actual configuration so once again I believe I'll pause for a little while so you don't have to sit here and watch not much happening paused for about a minute now it says it's configuring Hardware so it's finding all the hardware devices in the system making sure it has the right device drivers for it Etc it's now configuring the boot loader the grub and now it's doing cleanup it's getting rid of packages which were only needed during the install and of course that's rolling by far too fast to be readable and so it's doing a little bit more package installation I think I'll pause again for a little while so it reached the end of the status bar and now it's doing the reboot and shortly I should be getting a login prompt if you notice it's installing open VM tools that's a package of special drivers and configuration stuff that's used when you're running it as a guest under VMware hypervisor and we've reached the login screen running under the greeter so I'll just log in as student and oops I typed in the wrong password I suppose yep and now the system's running there's a few introductory uh messages here and I'll just click through them to get to a fully up system and then just to see what really happened here if I right click I can open up a terminal and then I'm going to run the command DF for dis free- T to show me what type of file systems I have in h to print out the results in megabytes and gigabytes and I see that in the main file system I have 30 GB of space of which I'm using 5.3 and it's an ext4 file system when we install Centos we need to actually specify the type of file system the size of the partition Etc but auntu made choices that it thought were best likewise uh we won't talk about this now but if I look at Swap files you'll see that there is a swap file of about 1 and a 12 Gab created uh instead of a swap partition usually distributions create swap partitions so that's all there is to install the latest uh version of Ubuntu uh absolutely nothing to do during the install it makes what it thinks as sensible decisions for everything and after the system is up and running you could then go into the package manager and put in exactly what you need and configure the system in other ways if you need a more flexible installation to begin with you can make such choices uh when you start but we we took the easy path here here are the steps to install syn OS we are now going to do a fresh install of Centos 8.1 the latest version of Centos at the time of this installation we have already allocated hard disk space for this install ation to make a virtual machine under VMware and we have inserted the install dis image and we're ready to begin so we will uh not take the step of testing the media and installing it because uh that takes some time so we'll just go directly to an install so I'll just move to the first element here and hit return and uh we'll try to do this install as as quickly as possible so we'll choose mostly the uh default choices and we're going to do a workstation install rather than a server install uh because this is what is desired for this course um to have an to have a user based uh install Okay so the first choice is to pick the language we'll pick English and then uh we can go really through any order we want through these different choices uh to begin with but let's just go in order so we've already picked an English keyboard with the US uh layout and also language support is set up for English for United States you can click on these to make those changes for the time and date uh it's actually better to to make sure the network is installed first so here I'm going I clicked on network and I'm going to turn on the network it found the network card and it's kind of ready to go probably should configure uh but I think the default choices will be fine if I go to General uh it says all users May connect and then if I go to ipv vce settings you'll see it's automatic DHCP uh so that's generally what you want rather than having to give it a fixed address so we'll just say okay for all this and uh um I guess we should say connect automatically with priority zero that means it'll always connect when you start up the machine and we can say done the reason it's good to do that before we set the time and date is we can now have Network time on which means it will automatically find a time uh I'm currently doing this installation from Central Time Zone in the United States so you can try to do that with the mouse and I got it right it's set for Chicago which is Central Time so I'll say done and then uh the installation source is uh rather important but that's local media I already have the DVD set as you see at Centos 8-11 1911 that's the uh latest version of Centos for the software selection uh let's just keep the workstation I could make it a server with a graphical interface or just a server if I really wanted to be quick I could do a minimal install and then bring everything up later that I need uh but within the workstation I should pick a few things so I'll pick gnome applications internet applications uh you'll probably want to pick the office suite and productivity but I'd like this to go quickly so I won't do that right now uh I'll pick development Tools in case I want to compile anything um and that's probably the main things I need right now but you can always change everything in detail once the system's up so it's it's good to do a a relatively quick install the trickiest part here is to do the installation um partitioning setup so I'll pick I've already got picked here the virtual 30 gigabyte disc and if I wanted to take things really fast I would do automatic storage configuration uh and let it decide what kind of partitions I should have how big they should be Etc and you may want to at least look at that but I let me just do custom because it fits in better with my needs and then I can say done okay and then I get to pick what kind of installation I want to do a standard partition and not an lvm which is logical volume management uh I just want a simple standard partition so I'll do that and then I actually have to create the partitions I need so I hit the plus sign and I'll have one big partition for everything so it's mounted at slash and let's give it 29 gabes and I'll add that this is a 30 G abte dis and then I'll add one more okay and that won't be mounted that'll be for Swap and if I don't give it desired capacity it should take it all uh which it actually decided it should have three gigabytes I'll let the system go with what it wants it's it's doing that based on how much uh memory I have okay um and it says I have only like one megabyte left I the total 30 gabt the one other thing I get to do for the first Mount Point here is pick what kind of file system and you notice the default on red hat now is or C is xfs let me make it ext4 um which is which is easier to mount from other other machines Etc than xfs but you can just take the the uh default if you prefer and then I'd say done and and should be done it's telling me do I really want to do this cuz it's going to wipe out everything that's on that dis I'll say sure accept the changes so uh I'm pretty much done uh K dump is a system you can set up so that if the system crashes you produce what's called a cord dump file so I'll just you know you probably won't need to use that it'll be a little faster to boot uh when you have a new kernel so I'll just not enable that but if you're doing a develop machine you probably want that we already configured the network and under security policy uh we won't do any specialization we'll just leave it alone for now you can always change it later and then you just say begin installation now it'll already take a head start on trying to load some packages and files while you have some more information to put in uh first have to pick a password for the root account and so I'll do that and it's actually LF train for uh Mach virtual machines we use for the classes which is a pretty simple password and uh it's it's hard to read here but it it should be saying it's too simple I can't see that oh it says weak here but it says press done again to use the password anyway so I'll do that this is a away machine and then I have to create a user I'll make the full name of the user LF student and by choice by default it wants to make the username of the account L student but we'll just make it student um it will require a password to use this account if we said make this user administrator it would be like Ubuntu systems where there's just one password and uh you have to do su to do anything privileged but let's keep a standard Unix type set up with separate accounts and passwords for the student user and the root user so we're going to give a very simple password again just the word student and once you get it oh it says it does not match I must have typed things wrong let's try again St ENT St ENT yeah so now it says the password contains the username and some form you will have to pass done twice to confirm it it's also considered very weak but we'll accept it once again it's a throwaway machine in real life you shouldn't do this and so I say done and now uh we just have to wait for the install you'll see it has installed F 500 some odd packages out of 1481 we could keep watching while this happens but it takes some time so I'm going to pause the recording and come back when it's almost done so it has finished and it's configuring the kernel now uh that takes a little bit of time it installed I think, 1481 packages so now it's doing the actual configuration of the kernel it is doing a few other configuration steps you'll notice it is is installing the boot loader it configured the editors is generating What's called the init Ram FS which is uh needed to boot it contains the initial file system which is stored in memory for just for the system booting which we talk about in detail in this course and this is probably the last thing it really has to do before it's done uh depending on the complexity of things it can take away while is now complete so now we can simply reboot so let's do that and we should have a running system and you see it's wants to boot there into the default kernel 4.8.0 and I didn't do anything it will automatically boot on its own and then there's a few things that happen when you start up the first time I it wants me to accept the uh and user license which is pretty simple for uh open source product uh and then finish configuration it has a few other things to set up and we're ready to do our first login as student so I clicked on that I type in the password and we have an up and running system and uh it's going to ask us to confirm again our choice of language and uh we could check to make sure the keyboard is okay but uh we're fine with English us and uh I'm going to turn off location services that's a that's a choice you can make and if you want you can connect to various online accounts so we're going to skip all that and we're ready to go so now we have a fully functional system it brings up so a tutorial screen if you want to get some more information we'll just skip that and here we are it's a fully functional system if I want to uh get a little information let me drop to a command line so I clicked on activities I'll say terminal and and here we are so for instance if I do df- you'll see uh I've used 5.2 GB uh and there's plenty of space available uh if I wanted to change the size of the screen depending on your hypervisor sometimes you can just kind of drag it out or something but uh here let me go to display settings and it's set for 1280 time 78 768 and I obviously can go bigger so just to show you for instance let's say I take 19 20 by 1220 and I'm filling up the whole screen now it's actually bigger than my whole screen so I'll revert the settings but you can do all sorts of other adjustments and we've done a complete install of centos8 it's all set and ready to use and customize to your heart's content here are the steps to install open Susi we are now going to do a fresh install of open Su as a virtual machine under a VMware hypervisor on a red hat 7 system we have already inserted the installed DVD and we are about to begin notice that in our initial screen we can do an installation and upgrade or if we scroll down to more we see that we can also use the install DVD as a rescue system uh uh we can check memory and do various things but we're going to do an install so I'll just pick on install and then it will cook for a while before it asks me to do anything uh so now it's finding all the hardware deciding what drivers to use Etc and getting started this is open Su leap version 42.3 and this is a typical gnome graphical booting screen while it's getting itself ready it should take a few more seconds I'll pause so we don't have to watch the whole thing okay it has moved on and it's about ready to bring up a graphical screen and there we go so it's initializing the hardware on the system okay now it's asking whether we want to accept English as a language and also the license agreement so we'll just say sure click on the next button it's doing more probing of the system deciding what to do and it says in a very small font initializing the installation now it would like to take a default partition scheme which we will override um so let me say edit proposed settings and I will take a partition-based proposal I will choose for my root partition ext4 I won't have any separate home partition or other partitions to keep things simple and that's all I have to choose so it's pretty simple and it says here it's going to create a swap partition of 2 gabt and then a root partition for everything else 28 gigabytes um and so I'm happy enough with that so I'll just say next and first thing is just to pick the time zone so I'll pick central time where I am currently sitting and I could do some other settings that unless I don't want to take automatic time setting so I just say next and here I have a choice for what kind of desktop let me pick the gome desktop I could pick the KDE or as a server pure text mode no graphical or I could do custom to do something a little more complicated or different and then it wants me to give a a full name name for uh the main user I'll say LF student and for username I'll pick student and I'll give a password and then I will not pick use this password for system administrator that would be like what auntu does and I will not pick automatic log and it's generally not a good idea to let your system log in without having to give a password so I'll say next it doesn't like my password because it's too simple but I'll say okay do it and now I have to give a root password and you might want to test your keyboard layout to make sure you have the right language I'll say next and once again it's going to complain my password is too simple and then I just say install and that's all the choices that I actually have to make uh so really nothing except specifying username password and what kind of desktop I want we can do further adjustments once the system is fully installed now while it's installing which should take about 10 minutes uh the default screen here is a slide show giving you brochures and information if I click on details it's a little more fun to look at so you can see the overall progress as it goes this first bar here is for each package as it is being installed and on the bottom you can see I'm already about 15% installed so I'm going to pause the recording cuz it's kind of boring to watch it install all 1500 packages and I'll wait until it's asking me to do something again before resuming okay that took about less than 10 minutes and now it's telling me the system is going to reboot and it did um and so we'll just see our normal booting uh of the new open Su system and uh it should quickly bring up the login screen just a few more seconds and there's our usual greeter screen I'll just type in the password for the student account and we have a fully operational open Su system now the first thing I would do from here is update the system because there's always new updates to various packages since the DVD install disc was released so that's important for both security and performance and it's even prompting me to go go ahead and do that and then I'd probably do some minor customizations about what kind of menus I see how Windows behave the keyboard Etc but I'll leave that for people to do as an exercise you have completed chapter 3 Let's summarize the key Concepts covered a partition is a logical part of the dis a file system is a method of storing or finding files on a hard disk by dividing the hard disk into partitions data can be grouped and separated as needed when a failure or a mistake occurs only the data in the effective partition will be damaged while data on the other partitions will likely survive the boot process has multiple steps starting with the BIOS which triggers the boot loader to start up the Linux kernel from there the init Ram FS file system is invoked which triggers the anet program to complete the startup process and determining the appropriate distribution to deploy requires that you match your specific system needs to the capabilities of the different distributions by the end of this chapter you should be able to manage graphical interface sessions perform basic operations using the graphical interface change the graphical desktop to suit your needs needs you can use either a command line interface or a graphical user interface when using Linux to work at the CLI you have to remember which programs and commands are used to perform tasks on the other hand using the guey is often quick and easy it allows you to interact with your system through graphical icons and screens for repetitive tasks the CLI is often more efficient while the guei is easier to navigate if you don't remember all the details or do something only rarely we'll learn how to manage sessions using the guey for the three Linux distribution families that we cover the most in this course which are red hat including C and Fedora Susi open Susi and deian Ubuntu and mint in subsequent sections of this course we'll concentrate in great detail on the command line interface which is pretty much the same on all distributions generally in a Linux desktop system the x windows system is loaded as one of the final steps in the boot process it's often just called x a service called the display manager keeps track of the displays being provided and loads the X server so-called because it provides graphical services to Applications sometimes called X clients the display manager also handles graphical logins and starts the appropriate desktop environment after a user logs in X is rather old software it dates back to the mid1 1980s and as such it has certain def deficiencies on Modern systems for example with security and it's been stretched rather far from its original purpose a newer system known as Wayland is gradually superseding it and is the default display system for Fedora real 8 and other recent distributions for the most part it looks just like x to the user although under the hood it's quite different a desktop environment consists of a session manager which starts and maintains the components of the graphical session and the window manager which controls the placement and movement of Windows the window title bars and controls although these can be mixed generally a set of utilities session manager and Window Manager are used together as a unit and together they provide a seamless desktop environment if the display manager is not started by default in the default run level you can start the graphical desktop in different in a different way after logging into a text mode console by running start X from the command line when you install a desktop environment the X display manager starts at the end of the boot process it's responsible for starting the graphics system logging in the user and starting the user's desktop environment you can often select from a choice of desktop environment when logging into the system gnome is a popular desktop environment with an easyto usee graphical user interface it's bundles as the default desktop environment for most Linux distributions including Red Hat Enterprise Linux re Fedora Centos Susi Linux Enterprise auntu and deian gome has menu based navigation and is sometimes an easy transition to accomplish for Windows users however as you'll see the look and feel can be quite different across distributions even if they're all using gnome another common desktop environment very important in the history of Linux and also widely used is KD e which has often been used in conjunction with Susi and open Susi as previously mentioned most desktop environments follow a similar structure to gnome and we'll restrict ourselves mostly to it to keep things less complex let's demonstrate how we log in and log out of a system which has already been booted on all recent distributions this looks pretty much the same here we're showing an instance of Centos stream which has three users on the system and I can log in in any one of them by selecting so let's go with the second one BJ moose and you'll notice that when I log in if I click on the gear item I have a choice of different desktops okay here's the default on couette stream which is a whan but I can pick a couple different kinds of x11s if I want I'll type in the password and I log in I depending on what's going on it may see a little bit of information um and that's all involved in logging in I probably won't see a hell of a lot uh this is a new user without much going on if I click on activities for instance I'll see some favorite applications uh if I click on Terminal here I can bring up a terminal if I want to do command line activity to log out all I have to do is go in the upper right corner and I can click on my name and then I can say either switch user or log out I would do switch user if I want to keep more than one session active at a time for different people which is something you probably won't want to do very often but it would mean if I came back into this user session I would see the whatever applications I had open but I'll just pick on log out and then I click here log out and I'm back to my greeter or my login screen where I can pick the users again so I can log in on any one of them so that's a simple demonstration of how one logs in and out of a system each Linux distribution comes with its own set of desktop backgrounds you can change the default by choosing a new wallpaper or selecting a custom picture to be set as the desktop background if you don't want to use an image as the background you can select a color to be displayed on the desktop instead in addition you can also change the desktop theme which changes the look feel of the Linux system the theme also defines the appearance of application windows so let's see how to change the desktop background and theme we are going to demonstrate how to change the background wallpaper on a red hat 7 system all recent Linux distributions have exactly the same method so this will suffice to show for all so all we have to do is click on the background with a right click and change background click on background again and then we have a choice between wallpapers that the system knows already and it's possible to load up other ones so let's say we pick this one here and you see now the background has been changed or I could pick for instance a picture stored on my machine in my pictures directory under my home directory so I'll pick this one and you see it's been changed so that's all we have to do to change the background on any recent Linux system most common settings both personal and systemwide are to be found by clicking in the upper right hand corner on either a gear or other obvious icon depending on your Linux distribution however there are many settings which many users would like to modify which are not accessible in that way the default settings utility is unfortunately rather Limited in modern gnome based distributions unfortunately the Quest for Simplicity has actually made it difficult to adapt your system to your tastes and needs fortunately there is a standard utility gnome tweaks which exposes many more setting options it also perits you to easily install extensions by external parties not all Linux distributions install this tool by default but it's always available you may have to run it by hitting alt F2 and then typing in the name you may want to add it to your favorites list as we shall discuss in this screenshot the keyboard mapping is being adjusted so the useless cap loot key can be used as an additional control key this saves users who use control a lot such as emac efficient autos from getting physically damaged by pinky strain the visual appearance of applications the buttons scroll bars widgets and other graphical components are controlled by a theme gnome comes with a set of different themes which can change the way your applications look the exact method for changing your theme may depend on your distribution for older gnome based distributions you can simply run gnome tweaks as shown in this screenshot from Ubuntu however now you'll be able to see a demonstration for logging in and out on the major Linux distribution families we'll concentrate on in this course note that Evolution has brought us to a stage where little it matters little which distribution you choose as they're all rather similar recent Linux distribution which use the gnome desktop look remarkably the same when it comes to the process of starting up and shutting down so we will demonstrate that here by using a VMware hypervisor on a red hat Enterprise Linux host and we'll demonstrate three recent distributions and how they boot so we've already teed them up so here I will start Centos stream here I will start Ubuntu 2004 and here I will start open Su leap 15.3 so you'll see a little bit different messages on each as they boot uh according to how grub is configured and what the possible kernel choices are it will take longer to boot than they were normally would if I was only doing one at a time simply because uh the host machine's a little bit overloaded running three virtual Machin machines it really doesn't have a ton of memory uh in this case I have allotted 3 GB of memory to each out of a total of 16 gab on the machine so it's a little bit memory stressed uh so we'll just wait till they start and reach their greeter screen which you see we've already done that on auntu we've already done that on open Su leap and it's taking somewhat longer on s uh H stream so let's log into these guys while we wait for SOS stream to get ready so I'll log in the student password here on the uh Ubuntu machine I'll do the same thing on the open Su machine and now we're just waiting for the Cent 8 machine finally ready and then I'll log in there as well and you notice they have different background pictures just because we have selected different background pictures over time but they all arrive to pretty much the same appearance with an activities and an applications menu and then uh Ubuntu still likes to have this uh sidebar on the left with major applications um I can easily bring that up on the other ones for instance if I type activities here activities on open Su I will see the same thing there and then the process of shutting down is also quite similar all I need to do is click in the upper right hand corner and I find the power icon and I just say power off I'll do the same thing with the Buu I get power off going to go power off and I can do the same thing with open SU power off and power off so it's remarkably the same from distribution to distribution these days it's often a good idea to lock your screen to prevent other people from accessing your session while you're away from your computer note this does not suspend the computer all your applications and processes continue to run while the screen is locked let's show how to lock and unlock your screen on any recent gnome distribution so the simplest way is to go to the upper right corner and click and find the lock button and simply and simply click on that and then you can unlock it by clicking on the display on the time there and just typing in the password again very simple another way to do it is through combination of keys uh depending on your machine this will generally be the Super Key plus l or the Super Key plus the Escape where the super key is also known as the Windows key uh so let me do that here and once again I brought up the lock window and I can simply unlock it again so that's all that's involved it's very simple Linux is a true multi-user operating system which allows more than one user to be simultaneously logged in if more than one person uses the system it's best for each person to have their own user account and password this allows for individualize settings home directories and other files users can take turns using the machine while keeping everyone's sessions alive or even be logged in simultaneously through the network let us demonstrate how to switch users on an Ubuntu machine with several accounts so first I will choose the Linux Foundation student as the account to log into type my password and sign in and then if I look in the upper right hand corner and click there I will see LF student and I can click on either log out or switch user notice if I log out I really log out but if I switch user I will just lock the user account and then when I start up I will preserve all of my sessions and open Windows Etc when I restart on some distributions you may actually see a list of users at this screen but not on Ubuntu so I'll say switch user I'm back to the greeter screen and let me pick the second one Theodor Cleaver and log in as that other user and there we go and now if I look up here again I can do the same thing so let me click on the name and I'll say switch user and if I pick student again you notice here it says unlock and not restart that means that if I were to log in now I will have preserved all the open windows and running applications from before this will look the same essentially on all Linux distributions of recent vintage so it's very easy to switch users and not lose any information from what you're already doing besides normal daily starting and stopping of the computer a system restart may be required as part of certain major system updates generally only those involving installing a new Linux kernel initiating the shutdown process from the graphical desktop is rather trivial on most current Linux distributions with very little variation we'll discuss later how to do this from the command line using the shutdown command in all cases you click on either a settings or gear or a power icon and follow the prompts to shut down the computer on any recent gnome based Linux distribution perform the following steps uh first click the power or the gear icon in the upper right hand corner of the screen second click on click on the power off restart or cancel if you do nothing the system will shut down in 60 Seconds shutdown reboot and logout operations will ask for confirmation before going ahead this is because many applications will not save their data their data properly when terminated this way always save your documents and data before restarting shutting down or logging out all modern Computers support suspend or sleep mode when you want to stop using your computer for a while suspend mode saves the current system state and allows you to resume your session more quickly while remaining on but uses very little power in the sleeping state it works by keeping your systems applications desktop and so on in system Ram but turning off all the other Hardware this shortens the the time for a full system startup as well as conserves battery power once you note that modern Linux distributions actually boot so fast that the amount of time saved is often minor even experienced users can forget the precise command that launches an application or exactly what options and arguments it requires fortunately Linux allows you to quickly open applications using the graphical interface applications are found at different places in Linux and within gnome they can be found from the applications menu in the upper leftand corner or from the activities menu in the upper left hand corner also in some Ubuntu versions from the dash button in the upper leftand corner for KDE and some other environments applications can be opened from the button in the lower leftand corner in the upcoming sections you will learn how to perform basic Linux operations using the graphical interface unlike other operating systems the initial install of Linux usually comes with a wide range of applications and software archives that contain thousands of programs that enable you to accomplish a wide variety of tasks with your computer for most key tasks a default application is usually already installed however you can always install more applications and try different options for example Firefox is popular as the default browser in many Linux distributions while Epiphany codor and chromium the open source uh of Google Chrome are usually available for install from software repositories proprietary web browsers such as Opera and chrome are also available locating applications from The Gnome and KDE menus is easy as they're neatly organized in functional submenus multiple applications are available to accomplish various tasks and to open a file type a file of a given type for example you can click on a web address while reading an email and launch a browser such as fir fox or Chrome to set the default applications enter the settings menu on all recent Linux distributions and then click on either default applications or details default applications let's now demonstrate how to set default applications on a red hat system we go to the upper right hand corner click on the top bar then scroll down to the gears icon for settings go down to the bottom for d details and then I can click on default applications so you see under web or browser there are three choices on this system I have Google Chrome Firefox or Opera we'll leave it at Google Chrome for video the default choic is videos which is actually a program called totem but let's switch it to the VC media player and for the image viewer I have the built-in image viewer or I could switch to the new image manipulation program better known as so on all recent distributions with a gnome desktop the procedure is identical and absolutely the same and it's very simple to change your default applications each distribution implements the naist or file manager utility which is used to navigate the file system it can locate files and when a file is clicked upon either it will run if it's a program or an associate application will be launched using the file as data this behavior is completely familiar to anyone who has used other operating systems to start the file manager you will have to click on its icon a file cabinet which is easily found usually under favorites or accessories it will have the name files this will open a window with your home directory displayed the left panel of the file manager window holds a list of commonly used directories such as desktop documents downloads and pictures the file manager let you access different locations on your computer and the network including the home directory the desktop uh documents pictures and other other locations every user with an account on on the system will have a home directory usually created under home slome and usually named according to the user such as slome SL student by default files the user saves will be placed in a directory Stree starting there account creation whether during system installation or at a later time when a new user is added also induces default directories to be created under the user's home directory such as documents desktop and and downloads the file manager allows you to view files and directories in more than one way you can switch between the icons and list formats either by clicking The Familiar icons in the top bar or you can press control1 or control2 respectively in addition you can also arrange the files and directories by name size type or modification date for future sorting to do so click View and select arrange items another useful option is to show hidden files sometimes I'm precisely called system files which are usually configuration files that are hidden by default and whose name starts with a DOT to show hidden files select show hidden files from the menu or press controll h the file browser provides multiple ways to customize your window view to facilitate easy drag and drop file operations you can also alter the size of the icons by selecting zoom in and zoom out under the view menu the file manager includes a great Search tool inside the file browser window one click search in the toolbar to bring up a text box then enter the keyword in this text box this causes the system to perform a recursive search from the current directory for any file or directory which contains a part of this keyword you can refine your search beyond the initial keyword by providing drop-down menus to further filter the search deleting a file in Nautilus will automatically move the deleted file to the lo/ share tr/ files directory uh basically a trash can under the user's home directory there are several ways to delete files and directories under Nautilus one you can select all you select all the files and directories that you want to delete then press control delete on your keyboard or right click the file then select move to trash note that you may have a delete permanently option which bypasses the trash folder and this option may be visible all the time or only in list rather than icon mode to permanently delete a file on the left panel inside a nautilus file browser window rightclick on the trash the the on the trash directory select empty trash and that's all alternatively select the file or directory you want to permanently delete and press shift delete let's see how to locate the Firefox application in locate Firefox click activities on the top left corner of your desktop on the left panel click the show applications icon click the Firefox icon close Firefox by clicking close in the top right corner of the Firefox window next let's explore the home directory using the file manager try to View files in list mode create a new empty document save it and remove it click activities in the upper left corner of your desktop in the left panel click the file manager icon this will by default open the home directory to View files in list mode click the list icon in the upper right of the file manager window doubleclick the document directory to open it click activities in the top left corner of your desktop to launch gedit type gedit in the search box click the gedit icon to open it type your name and click close in the top right corner of the gedit window to create and close a file click save as to save the created file select documents from the left panel of the save as window type test to save the file by that name click save to save the file and close gedit this brings you back to the document directory rightclick the test file in the document window select move to trash to remove the file you have completed chapter 4 let's summarize the key Concepts covered gome is a popular desktop environment and graphical user interface that runs on top of the Linux operating system the default display manager for Gnome is called gdm the gdm display manager presents the user with the login screen which prompt for the user the login username and password loging out through the desktop environment kills all processes in your current X session and returns to the display manager login screen Linux enables users to switch between logged in sessions suspending puts the computer into sleep mode for each key task there is generally a default application installed every user created in the system will have a home directory the places menu contains entries that allow you to access different parts of the computer and the network Nautilus gives three formats to View files each each Linux distribution comes with its own set of desktop backgrounds gnome comes with a set of different themes which can change the way your applications look by the end of this chapter you should be able to apply system display and date and time settings using the system settings panel track the network settings and manage connections using the network manager in Linux install an update soft Ware Linux from a graphical interface note that we'll revisit all these tasks later when we discuss how to accomplish them from the command line the system settings panel allows you to control most of the basic configuration options and desktop settings such as specifying the screen resolution managing network connections or changing the date and time of the system for The Gnome desktop manager one clicks on the upper right hand corner and then selects the tools image the screwdriver crossed with a rinse or a gear uh depending on your distribution you may find other ways to get into the settings configurations as well you'll also find variations in the menu layout between Linux distributions and versions so you may have to hunt for the settings you need or to examine or modify to get deeper into configuration one can click on the devices on the previous menu in order to configure items like the display the keyboard the printers Etc one can also click on the users icon which may be under details to set values for system users such as their login picture password Etc a lot of personalized configuration settings do not appear on the settings menu instead you have to launch a tool called either gnome tweaks or gnome tweak tool we have not really discussed working at the command line yet but you can always launch a program such as this by doing alt F2 and typing in the command some distributions have a link to the tweaks menu in the settings but for some mysterious reason many obscure this Tool's existence and it becomes hard to discover how to modify even rather basic desk type attributes and behaviors important things you can do with this tool include selecting a theme configuring extensions which you can get from your distribution or download from the internet you can control fonts mod modify the keyboard layout and set which program start when you log in the most recent gnome versions have removed a lot of the functionality of gnome tweaks extensions now have to be configured using a new a new app called gnome extensions app the reasoning for this is obscure here you can see a screenshot from a red hat system with quite a few extensions installed but not all being used clicking on settings displays or settings devices displays will expose the most common settings for changing the desktop appearance these settings function independently of the specific display drivers you're running the exact appearance will depend enormously on how many monitors you have and other factors such as Linux distribution and particular vers if your system uses a proprietary video card driver usually from Nvidia or AMD you'll probably have a separate configuration program for that driver this program may give more configuration options but may also be more complicated and might require admin root access if possible you should configure the settings in the displays panel rather than with the proprietary program the X server which actually provid Ides the the guey uses SLC x1x org.com as its configuration file if it exists in modern Linux distributions this file is usually present only in unusual circumstances such as when certain less common graphic drivers are in use changing this configuration file directly is usually for more advanced users while your system will usually figure out the the best resolution for your screen automatically it may get this wrong in some cases or you might want to change the resolution to meet your needs you can accomplish this using the displays panel the switch the switch to the new resolution will be effective when you click apply and then confirm that the resolution is working in case the selected resolution fails to work or you're just not happy with the appearance the system will switch back to the original resolution after a short timeout once again the exact appearance of the configuration screen will vary a lot between distributions and versions but usually it's rather intuitive and easy Once you find the configuration menus in most cases the configuration for multiple displays is set up automatically as one big screen spanning all monitors using a reasonable guess for screen layout if the screen layout is not as desired a checkbox can turn on mirrored mode where the same display is seen on all monitors clicking on a particular monitor image lets you configure the resolution of each one and whether they make one big screen or mirror the same video configuring display settings such as resolution is almost identical on all major distributions so we'll demonstrate that running virtual machines under VMware on a red hat 8 host so let's begin with showing what it looks like on auntu so I go up in the upper right hand corner and I find the settings button and then uh in the main uh panel here we have displays so we've already clicked on that and you see uh the easiest thing to do here is I can change the resolution to be any one of these numbers now you can continuously vary the display size usually on a virtual machine um and by dragging and dropping the corners you see now it's changed to another number but that's all that's involved in Ubuntu for instance if I want to go to open well let's try Centos Centos uh H stream actually I find the settings once again and then here you have to scroll down to devices and then displays is in there and we have the identical setup except for this NightLight uh option which is for looking in a darker situation a which we also had in the auntu was just located in a different place on open Su you'll see it's virtually identical as well I just click on the uh settings gear button here and uh once again I have to go to devices like I did on the red hat system and I have the identical situation you couldn't tell what operating system you were on if you just looked at this now the these are all virtual machines with one terminal if I look on the host which actually has three different monitors hooked up to it you'll see then I get something like this where I can see all three of my monitors uh I can figure any one of them here it's doing the the smaller one the 18inch one but I could switch to the 27 or the 24 and I can control uh their different resolutions if I move these around here I can change the way the three of them are laid out from left to right I don't particularly want to do that uh because it gets kind of messy but this is how you can control which one's in the middle which is on the right or left Etc so these days configuring the display resolution and some other basic things is really very simple very intuitive the hardest thing is just to find the the um settings icon to click on by default Linux always uses coordinated universal time for its own internal timee keeping displayed or stored time values rely on the system time zone setting to get the proper time UTC is similar to but more accurate than green witch meantime if you click on the time displayed on the top panel you can adjust the format with which the date and time is shown on some distributions you can also alter the values the more detailed date and time settings can be selected from the date and time window in the system settings menu the automatic settings are referring to the use of network time protocol which we'll discuss next the network time protocol is the most popular and reliable protocol for setting the local time by Consulting established internet servers l distributions always come with a working ntp setup which refers to a specific time servers run or relied on by the distribution this means that no setup Beyond on or off is generally required for Network time synchronization all Linux distributions have network configuration files but file formats and locations can differ from one distribution to another hand editing of these files can handle quite complicated set but it's not very dynamic or easy to learn and use network manager was developed to make things easier and more uniform across distributions it can list all available networks both wired and wireless allow the choice of a wired Wireless or mobile broadband Network handle passwords and set up virtual private networks except for unusual situations it's generally best to let network manager establish your connections and keep track of your settings in this section you'll learn how to manage network connections including wired and wireless connections and mobile broadband and VPN connections wired connections usually do not require complicated or manual configuration the hardware interface and Signal presence are automatically detected and then network manager sets the actual network settings via Dynamic host configuration protocol or DHCP for static configurations that do not use DHCP manual setup can also be done easily through network manager you can also change the Ethernet Mac address or media Access Control address if your Hardware supports it the MAC address is a unique hexadecimal number of your network card wireless networks are usually not connected by default you can view the list of available wireless networks and see which one if any you're currently connected to by using network manager you can then add edit or remove known wireless networks and also specify which one which ones you want connected by default when present to configure a wireless network in any recent gnome based distribution click on the upper right corner of the top panel which brings up a settings and or Network window while the exactic appearance will depend on Linux distribution inv verion it will always be possible to click on a Wi-Fi submenu as long as the hardware is present here is an example from a real 8 System select the wireless network you wish to connect to if it's a secure network the first time it will request that you enter the appropriate password by default the password will be saved for subsequent connections if you click on Wi-Fi settings you will bring up this if you click on the gear icon for any connection you can configure it in more detail older and other Linux distributions may look quite a bit different in detail but the steps and choices are essentially identical as they're all running network manager with perhaps somewhat different clothing let's demonstrate how to control wired and wireless network connections on a red head system if I click on the upper right hand corner for instance if I want to look at the wired connection I can just scroll down to the wired connection and then wired settings and it asks me for my password the root the root password because it it wants to have a super user only control network connections and you'll see I have a th000 megabit connection if I click on the gear icon I can control the settings on the details first screen it says it connects automatically when the system starts and all users can use it on identity I give what the name of the interface looks like not the name of the system uh in older systems that would have been eth0 eth1 Etc but as we will discuss later newer systems have these more complex names under ipv4 we control the basic Internet Protocol system systems settings most of the time you'll leave it alone at automatic DHCP Dynamic host configuration protocol where the system figures out its address from the server Etc if you understand how the importance of manual settings you can specify an address a net mask a Gateway you can select a particular DNS server and you can specify roots to certain addresses if you understand understand those Concepts this is where you would go to control all that we're not changing anything so I'll just hit cancel now if I want to control Wi-Fi settings I could go back to that upper right corner or I can just click on the Wi-Fi setting here and once again it's asking me for the super user password these are the different wireless networks that have to be that are available at the moment they all have locks next to them means they require a password this is the one that I'm actually on Coupe J the first one and if I click on the settings there once again it's going to ask me for um my P my super user password and I see essentially the exact same settings I had on the wir connection the automatic startup as other people use it the identity and whether I want to use DHCP or set things manually or not so that's all there really is in the graphical interface to control basic network connections it's rather simple and it looks the same at all recent Linux distributions you can set up mobile broadband connection with network manager which will launch a wizard to set up the connection details for each connection once the configuration is done the network is configured automatically each time the broadband network is attached network manager can also manage manage your VPN connections it supports many VPN Technologies such as native IPC Cisco open connect via either the Cisco client or a native open source client Microsoft pptp and openvpn you might get support for VPN as a separate package from your distributor you need to install this package if your preferred VPN is not supported each package in Linux distribution provides one piece of the system such as the Linux kernel the C compiler utilities for manipulating text or configuring the network or for your favorite web browsers and email clients packages often depend on each other for example because your email client communicates using ssltls it will depend on a package which provides the ability to encrypt and decrypt SSL and TLS communication and will not install unless that package is also installed at the same time all systems have a lower level utility which handles the details of unpacking a package and putting the pieces in the right places most of the time you will be working with a higher level utility which knows how to download packages from the internet and can manage dependencies and groups for you in this section you will learn how to install and update software in Linux using the dbn packaging system used by systems such as Ubuntu as well and RPM Packaging Systems which is used by both red hat and the Susi family systems there are these are the main ones in use although there are other ones which work well for other distributions which are less used let's look at the package management for the Debian family system dpkg is the underlying package manager for these systems it can install remove and build packages unlike higher level packages Management Systems it does not automatically download and install packages and satisfy their dependencies for deviant based systems the higher level package management system is the advanced package tool or a system of utilities generally while each distribution with within the devian family uses AP it creates its own user interface on top of it for example AP kit or app kit sympatic uh yuntu software Center Etc although apt repositories are generally compatible with each other the software they contain generally is not therefore most repositories Target a particular distribution like yuntu and often software Distributors ship with multiple repositories to support multiple distributions demonstrations are shown later in this section Red Hat package manager or RPM is the other package management system popular on Linux distributions it was developed by red hat and adopted by a number of other distributions including Susi and open Susi uh C OS Oracle Linux and others the highlevel package manager differs between distributions Red Hat Family distributions historically use re or SOS and fedora uses dnf while retaining good backward compatibility with the older yum program Susi family distribution such as open Susi also use RPM but use the zipper interface the yet another setup tool or yast software manager is similar to other graphical package managers it's an RPM based application you can add remove or update packages using this application very easily to access the yes software manager first click activities then in the search box type yes and click on the yes icon then click software management you can also find yes by clicking on applications other yes which is a strange place to put it uh but open su's yes software management application is similar to The graphical package managers and other distributions uh demonstration of the Yas software manager is seen later in this section we are now going to demonstrate software package management from a graphical interface using the open Su Linux distribution the tool we want to use for doing this is yast yst and there's two different ways I can reach it if I have the gnome shell extension installed which shows the application s menu which doesn't come by default I can go down to systems tools and then go down to yes or I can always go up to the upper right hand corner click on the tool icon and then at the bottom here on the system click on yes it will want the root password CU I'm going to manipulate what's installed on the system and so if I go to software I can go to software management now the first thing that yes has to do is study the system and get a database of every possible package so it you can look at the packages on the system in different ways you can look by what's called RPM groups so here's all the games are grouped under amusements I have applications development and all different kinds of development subcategories tools documentation Etc or RPM groups that is rpm groups okay yeah pack or I can look at package groups which maybe is a little more intuitive so I could click on let's say multimedia and see all the different programs are involved in uh in dealing with multimedia suppose I want to install something or inquire as to where something is installed I can click on search and type something in here I'll type G plot and I bring up quickly all the different G plot uh pro programs there are the main one you see has a check mark in the box that means it's already installed um I will decide to install gup plot do doc which is a small documentation package and then in order to do the install I will click on accept and I we go ahead and do it it's a pretty small package it doesn't take long if you needed some other packages a function it would have installed them at the same time so now I'll say continue and if I can want to remove it because I don't really need it I'll type it that in the search again and then I click on here um until I get an X for removal and then I say accept and it's removing it so that's all I had to do to do some basic package installation and removal under gnome software with open Su pretty simple experienced Linux administrators probably do most of their package management from the command line rather than from a graphical interface however every Linux distribution has at least one graphical interface for installing upgrading removing Etc various software packages so let's take a look at a recent Ubuntu system uh I can go to Applications and then down to system tools and first let's look at the one at the bottom here which just says software this is actually a program progr called gnome software uh you can always install it if it hasn't been installed on your system it looks somewhat like an app store or Play Store from Android and uh it's pretty obvious you can click in any one of these to try to install Etc and at the bottom you'll see things are grouped by category so for instance oh I could click on utilities and then I'll see a bunch of different utilities uh that may or may not be installed on your system already okay or I could search for various things so let me go back to the main page and um if I click on The Hourglass up in the corner here I can search so let's say I search on Terminal and you'll see it'll come up with a number of different things I could install you'll see here this terminal here is the a gome terminal and it says installed in a rather small font here uh and if I wanted to install something else I could just say for instance here I could click on that and I would say install and it could just be installed or if I want something a little more fun let's say I'll look for a program called cheese which let's you use your um webcam to take pictures or or make videos Etc and I can say remove cuz it turns out it's already installed so let me remove it and it's going to want a password to do this which shouldn't be that priz surprising so I type my password and it's removing it and then uh you know if I want to reinstall it which I'll do I'll just say install and give the password again so this is not a very complex program to use uh it's pretty easy to use gome software and you notice at the top you have a list here of explore which is where you are now installed would be all your installed packages and if you do updates it's telling me the system has two sets of updates that I really should install but the save time I'll do that right now so that's one graphical interface there's a much older graphical interface that's available intu called synaptic so let's do that one uh I thought it was it's under system tools there we go synaptic package manager and once again this is going to ask for a password and uh it's an informatory message and this is actually a very simple easy to use and uh it gives you a clear uh vision of exactly where everything came from compared to the more modern graphical interfaces it's pretty straight forward to use um it's organized by either sections here I can do it in other ways I can do searching uh uh Etc so suppose I want to search well I'll do the same search your terminal and it's going to show me all the packages that either have terminal in the name or discuss terminal if I want to restrict it to ones that have only uh in the name I can do that and it's pretty straightforward to use I won't run through this these are already installed because they're in green uh I can install any of these other ones and I can just click on that and then up let's say I want to do QT terminal I would say Mark for installation and it says in order to this to work it has to install these other packages too which it depends on so we won't bother to do that and that's briefly what you can do on a auntu system with a graphical software package installations and removals you have completed Che chapter 5 so let's summarize the key Concepts covered you can control basic configuration options and desktop settings through the system settings panel Linux always uses coordinated universal time or UTC for its own internal timekeeping you can set the date and time settings from the system settings window the network time protocol is the most popular and reliable protocol for setting the local time via internet server the displays panel allows you to change the resolution of your display and configure multiple screens the network manager can present available wireless networks it allows the choice of a wireless or mobile BRB Brad Network handles passwords and sets up vpns the dpkg and RPM are the most popular package Management Systems used on Linux distributions deviant distributions use dpkg and AP based utilities for package management RPM was developed by red hat and adopted by a number of other distributions including open Susi SOS oracal Linux and others by the end of this chapter you should be familiar with common Linux applications including internet applications such as browsers and email programs office productivity Suites such as Le RA office developer tools such as compilers debug debuggers Etc multimedia applications such as those for audio and video graphic editors such as the and other Graphics utilities the internet is a Global Network that allows users around the world to perform multiple tasks such as searching for data communicating through emails and online shopping obviously you need to use Network aware applications to take advantage of the internet these include web browsers email clients streaming media applications Internet relay chats and conferencing software as discussed in the graphical interface chapter Linux offers a wide variety of web browsers both graphical and text space including Firefox Google Chrome chromium epiphany renamed web conquer links links w3m and Opera email applications allow for sending receiving and reading messages over the Internet Linux systems offer a wide number of email clients both graphical and text based in addition many users simply use their browsers to access their email accounts most email clients use the internet message access protocol or IMAP or the older pop post office protocol to access emails stored on a remote mail server most email applications always also display HTML formatted emails that include objects like pictures and hyperlinks Linux support the following types of email applications graphical email clients such as Thunderbird Evolution and Claus mail text mode email clients such as mut and mail all web browser based client cents such as Gmail yah and Office 365 Linux systems provide many other applications for performing internet related tasks these include filezilla pigeon AA and hexchat most day-to-day computer systems have productivity applications sometimes called office suites available or installed each Suite is a a collection of closely coupled programs used to create and edit different types of files such as text spreadsheets presentations graphical objects most Linux distributions offer Libra office an open- source office suite that started in 2010 and is evolved from open Office while other office suites are available as as we have listed Libra office is the most mature and it's most it's also the most widely used and intensely developed in addition Linux users have full access to internet-based office suites such as Google Docs and Microsoft Office 365 the component applications included in Libra office are writer for word processing calc for spreadsheets impress for presentations draw for creating and editing graphics and diagrams the Libra office applications can read and write non-native document formats such as those used by Microsoft Office usually Fidelity is maintained quite well but complicated documents might have some imperfect conversions Linux distributions come with a complete set of applications and tools that are needed by those developing or maintaining both user applications and the kernel itself these tools are tightly integrated and include Advanced editors customized for programmers needs such as V and emac compilers for every computer language that has ever existed including very popular new ones such as go L and rust debuggers such as GDB and various graphical front ends to it and other and many other debugging tools performance measuring and monitoring programs some with easy to ous graphical interfaces others more Arcane and meant to be used only by serious experienced development Engineers complete integrated develop environments or idees such as eclipse and visual studio code that put all these tools together on other operating systems these tools have to be obtained and installed separately often at a high cost while in Linux they are all available at no cost through standard package installation systems multimedia applications are used to listen to music watch videos Etc as well as to present and view text and Graphics Linux systems offer a number of sound player applications including amck audacity and Rhythm box of course Linux systems can also connect with commercial online music streaming services such as Pandora and Spotify through web browsers movie and video players can portray input from many different sources either local to the machine or on the Internet Linux systems offer a number of movie players including VLC imp player Zen Totem Movie editors are used to edit videos or movies link systems offer a number of movie editors including cin paint blender CA and ffmpeg graphic editors allow you to create edit View and organize images of various formats the new image manipulation program or is a feature image retouching and editing tool similar to Adobe Photoshop and it's available on all Linux distributions some features of of are it can handle any image format it has many special purpose plugins and filters it provides extensive information about the image such as layers channels and histograms in addition to there are other Graphics utilities that help perform various imag related tasks including EOG inkscape convert and scribus you have completed chapter six let's summarize the key Concepts covered Linux offers a wide variety of Internet applications such as web browsers email clients online media applications and others web browsers supported by Linux can be either graphic iCal or text based such as Firefox Google Chrome Epiphany w3m links and other others Linux supports graphical email clients such as Thunderbird Evolution and Claus mail and text mode email clients such as mut and mail Linux systems provide many other applications for performing internet related tasks such as filezilla xchat pidgen and others most link distributions offer Libra office to create an different kinds of documents Linux systems offer entire Suites of development applications and tools including compilers and debuggers Linux systems offer a number of sound players including amarok audacity and Rhythm box Linux systems offer a number of movie players including VC M player Zen and totem Linux systems offer a number of movie editors including Kino cin paint blender among others the utility is a featur rich imagery touching and editing tool available on all Linux distributions other Graphics utilities that help perform various image related tasks are EOG inkscape convert and scribus by the end of this chapter you should be able to use the command line to perform operations in Linux search for files create and manage files install and update software Linux system administrators spend a significant amount of their time at a command line prompt they often automate and troubleshoot tasks in this text environment there's a saying graphical user interfaces make easy tasks easier while command line interfaces make difficult tasks possible Linux relies heavily on the abundance of command line tools the command line interface provides the following advantages no gooey overhead is incurred virtually any and every task can be accomplished while sitting at the command line you can Implement scripts for often used or easy to forget tasks and series of procedures you can sign into remote machines anywhere on the internet you can initiate graphical applications directly from the command line instead of hunting through menus while graphical tools may vary among Linux distributions the command line interface does not a terminal emulator program emulates or simulates a standalone terminal within a window on the desktop by this we mean it behaves essentially as if you were logging into the machine at a pure text terminal terminal with no running graphical interface most terminal emulators programs support multiple terminal sessions by opening additional tabs or Windows by default on gnome desktop environments The Gnome terminal application is used to emulate a text mode terminal in window other available terminal programs include xterm console default on KDE and Terminator to open a terminal on any system using a recent gnome desktop click on applications system tools terminals or applications utilities terminal if you do not have the applications menu you will have to install the appropriate gnome shell extension package and turn it on with gnome tweaks on any but some of the most recent gnome based distributions you can always open a terminal by right clicking anywhere on the desktop background and selecting open in terminal if this does not work you will once again need to install and activate the appropriate gnome shell package you can also hit alt F2 and type in either gnome terminal or console whichever is appropriate because distributions have had a history of bearing opening up a command line terminal and the place and menus may vary in the desktop guey it is a good idea to figure out how to pin the terminal icon to the panel which might mean adding it to the favorite grouping on gnome systems there are some basic command line utilities that are used constantly and it would be impossible to proceed further without using some some of them in simple forms before we discuss them in more detail a short list has to include cat used to type out a file or combined files head used to show the first few lines of a file tail used to show the last few lines of a file man used to view documentation this screenshot shows Elementary uses of these programs note the use of the pipe symbol the vertical line you used to have one program take as input the output of another for the most part we will only only use these utilities and screenshots displaying various activities before we discuss them in detail most input lines entered at the Shell prompt have three basic elements the command the options and the arguments the command is the name of the program you are executing it may be followed by one or more options or switches that modify what the command may do options usually start with one or two dashes for example- p or-- print in order to differentiate them from arguments which represent what the command operates on however plenty of commands have no options no arguments or neither in addition other elements such as setting environment variables can also appear on the command line when launching a task all the demonstrations created have a user configured with pseudo capabilities to provide the user with administ rative privileges when required pseudo allows users to run programs using the security privileges of another user generally root the super user on your own systems you may need to set up an enable Pudo to work correctly to do this you need to follow some steps that will not explain much detail now but you will learn about later in this course when running on yuntu and some other recent distributions pseudo is already always set up for you during installation on other Linux distributions you will likely need to set up pseudo to work properly for you after the initial installation next you will learn the steps through setup and run pseudo on your system if your system does not already have pseudo set up in and enabled you need to do the following steps you'll need to make modific ations to the administrative or super user route while pseudo will become the preferred method of doing this we not have to have it set up yet so we you we will use Su which we'll discuss later in detail Instead at the command line prompt type Su and press enter you'll then be prompted for the root password so enter it and press enter you'll notice that nothing is printed this is so so others cannot see the password on the screen you should end up with a different look prompt often ending with a hashmark or a pound sign for example Su and then password uh now you need to create a configuration file to enable your user account to use Pudo typically this file is created in the /c/ Su doers. d/d directory with the name of the file as the same as your username for example for this demo let's say your username is student after doing step one you would then create the configuration file for student by doing this Echo student all equals all all and then the the directory here finally some Linux distributions will complain if you do not also change permissions on the file by doing uh chod 440 and then put the file name uh that should be it for the rest of this course if you use pseudo you should be properly set up when using pseudo by default you will be prompted to give a password you your own user password at least the the first time you do it within a specified time interval it's possible the varant secur to configure pseudo to not require password or change the time window in which the password does not have to be repeated with every pseudo command the customizable nature of Linux allows you to drop the graphical interface temporarily or permanently or to start up after the system has been running most Linux distributions give an option during installation or have more than one version of the install media to choose between desktop with a graphical desktop and server usually without one Linux production servers are usually installed without the guei and even if it is installed usually do not launch it during the system startup removing the graphical interface from a production server can be very helpful in maintaining a lean system which can be easier to support and keep secure VT or virtual terminals are console sessions that use the entire display and keyboard outside of a graphical environment such terminals are considered virtual because although there can be multiple active terminals only one terminal remains visible at a time a VT is not quite the same as a command line terminal window you can have many of those visible at once on a graphical desktop one virtual terminal usually number one or seven is reserved for the graphical environment and text logins are enabled on the unused VTS Ubuntu uses vt7 but s OAS and real and openi use vt1 for the graphical display an example of a situation where using VTS is helpful is when you run into problems with the graphical desktop in this situation you can switch to one of the text VTS and trouble shoot to switch between VTS press control alt function key for for the VT for example press control alt F6 for vt6 actually you only have to press the alt F6 key combination if you are in a VT and want to switch to another VT Linux distributions can start and stop the graphical desktop in various ways the exact method differs from distribution and among distribution versions for the newer system MD based distributions the display manager is run as a service you can stop the guey desktop with the system control utility and most distributions will also work with the uh T init command as in pseudo system control stop gdm or studo telet 3 and restart it after logging into the console with pseudo system control start start gdm Oro pseudo Talent 5 on move to versions before 18.04 LTS substitute light DM for gdm in this section we will discuss how to accomplish basic operations from the command line these include how to log in and log out from the system restart or shut down the system locate applications access directories identify absolute and relative paths and EXP for the file system an available text terminal will prompt for a user name with the string login and password when typing your password nothing is displayed on the terminal not even a an asri to indicate that you typed in something and this is to prevent others from seeing your password after you've logged into the system you can perform basic operations once your session is started either by logging into a text terminal or via a graphical terminal program you can also connect and log into remote systems by using SSH for example by typing SSH student remotes server.com SSH would control would connect securely to the remote machine or remotes server.com and give student that's the user a command line terminal window either using a password as with regular logins or a cryptographic key to sign in without providing a password to a verified the identity the preferred method to shut down or reboot the system is to use the shutdown command this sends a warning message and then prevents further users from logging in the init process will then control shutting down or rebooting the system it's important to always shut down properly failure to do so can result in damage to the system and or loss of data the Halt and power off commands issue shutdown DH to Hal the system reboot issue shutd down- R and causes the machine to reboot instead of just shutting down both rebooting and shutting down from the command line requires super user or root access when administering a multi-user system you have the option of notifying all users prior shutdown as in pseudo shutdown DH uh 10:00 shutting down for scheduled maintenance depending on the specifics of your particular distributions policy programs and software packages can be installed in various directories in general executable programs and scripts should live in the SL bin or SL user bin or/ sbin or/ user sbin directories or somewhere under slop they can also appear in the/ user looc /bin or/ user locsin or in a directory in a user's account space such as slome student /bin one way to locate programs is to employ the witch utility for example to find out exactly where the diff program resides on the file system you can do which diff SL user bin diff if which does not find the program where is is a good alternative because it looks for packages in a broader range of system directories so where is diff when you first log into a system or open a terminal the default directory should be your home directory you can PR you can print the exact path of this by typing Echo home many Linux distributions actually open new graphical terminals in the dollar China home/ desktop the following commands are useful for directory navigation let's get some practice navigating among directories at the command line so suppose I go to the temp directory cdmp I do PWD for print working directory I'm at TMP I could do go to the home directory by doing CD dollar home you see PWD now is home student if I do cd. dot I go up one level to just home another way to navigate is to use the push D and pop D commands so I could do push D temp okay and it show me my previous history I was at Temp and uh I was at home and I go to Temp now if I do pop D it puts me back at the home directory another thing I can do is CD Dash and that takes me to the previous directory just like popd did so that's some basic day-to-day practices of navigating directories that one does all the time on a Linux system there are two ways to identify paths absolute path name which an absolute path name begins with the root directory and follows the tree branch by Branch until it reaches the desired directory or file Absolut paths always start with a slash or the relative PA path name a relative path name starts from the present working directory relative paths never start with a slash multiple slashes between directories and files are allowed but all but one slash between elements in the path name is ignored by the system so if you have a bunch of slashes it's valid but it's just seen as just having a single slash by the system most of the time it's most convenient to use relative paths which require less typing usually you take advantage of the shortcuts provided by use dot for present directory do dot for Parent Directory or the tilty for your home directory for example suppose you're currently working in your home directory and wish to move to the/ user spin directory the following two ways will bring you to the same directory from your home directory there is the absolute path name method and the relative path name method in this case the absolute path name method requires less typing traversing up and down the file system tree can get tedious the tree command is a good way to get a bird's eye view of the file system tree use tree- D just to view just the directories and to suppress listing the names the following commands can help in exploring the file system let's get started with how to explore the file system to access SL USR looc from the/ USR directory using absolute path at command prompt type cd/ USR SL looc SL live and press enter go back to/ USR directory by typing cd/ USR and press enter to access SL USR looc from the/ USR directory using relative path at command prompt type CD local /li and press enter get to the root directory at the command prompt type the cd/ command and press enter to get a list of the files and directory in the present working directory at the command prompt type the ls command and press enter to get a list of hidden files and hidden directories at the command prompt type the ls- a command and press enter to get a tree view of the file system at the command prompt type the tree command and press enter to get a treeview of only directories in the file system at the command prompt type the tree- d/ command and press enter the inutility is used to create hard links and with the- s option soft links also known as symbolic links or Sim links these two kinds of links that are very useful in Unix based operating systems suppose that file one already exists a hard link called file two is created with the with this command note that two files now appear to exist however a closer inspection of the file listing shows that this is not quite true so we'll do ls- Li file one name file two and the- I option to LS prints out in the First Column the inode number which is a unique quantity for each file object this field is the same for both these so what is really going on here is that there's only one file but has more than one name associated with it as indicated by the two that appears in the ls output thus there was already another object linked to file one before the command was executed hard links are very useful and they save space but you have to be careful with their use sometimes in subtle ways for one thing if you remove either file one or file two in the example the inode object and the remaining file name will remain which might be undesirable as it may lead to subtle errors later if you recreate a file of that name if you edit one of the files exactly what happens depends on your editor most editors including V and gedit will retain the link by default but it's possible that modifying one of the names may break the link and result in the creation of two objects soft or symbolic links are created with a-s option as in ln- s file 1 file 3 or ls- Li file one file three notice file three no longer appears to be a regular file and it clearly points to file one and has a different enode number symbolic links take no extra space on the file system unless their names are very long they're extremely convenient as they can easily be modified to point to different places an easy way to create a shortcut from your home home directory to long path names is to create a symbolic link unlike hard links soft links can point to objects even on different file systems partitions and or Diss and other media which may or may not be currently available or even exist in the case where the link does not point to a currently available or existing object you obtain a dangling link the CD command remembers where you were last and let you get back there with CD dash for remembering more than just the last directory visited use push D to change the directory instead of CD this pushes your starting directory onto a list using popd will then send you back to those directories walking in reverse order the most recent directory will be the first one retrieve with popd the list of directories is displayed with the dur command Linux provides many commands that help you with viewing the contents of a file creating a new file or an empty file changing the timestamp of a file and moving removing and renaming a file or directory these commands help you in managing your data and files and and in ensuring that the correct data is available at the correct location in this section you will learn how to manage files let's get a feel for how to look at some of the lines in a given text file on your machine so we have on all our Linux Foundation virtual machines a file called Ready for. sh which I'm using word count to show me it has 5,127 lines if I just want to type the whole file out I could do that with the cat utilities so let me just do that but it went very very fast and in fact if I do cat dasn it shows me the line numbers as it goes and it is indeed 5127 the way to page your way through is to use the less utility so then I would do less ready forsh and then I get one screen at a time if I hit the space bar I see the second screen third screen Etc and I can keep going all the way through the file as fast as I want and by the way I can also do the less- capital in option and then I also get line numbers I did with cat Dash in so similar thing now suppose I just want to look at the first few lines of the file I could do head ready4 Dosh and you see that only gave me I believe 10 lines if I wanted to get 20 lines I could just give that as an argument okay so there we see the first 20 lines likewise with tail by default I get the last 10 lines if I wanted to see the last 20 lines I would do tail -20 and if you want to have some fun you can use the TAC utility where you'll notice that Tac is cat backwards and that just gives do the entire file backwards so these are day-to-day utilities one uses just to look at the contents of text files touch is often used to set or update the access change and modify times of files by default it resets a file's timestamp to match the current time however you can also create an empty file using touch uh like this touch and then the file name this is normally done to create an empty file as a placeholder for a later purpose touch provides several useful options for example the- T option allows you to set the date and timestamp of the file to a specific value as in touch DT and then we put the value uh and then the file name maker is used to create a deck directory such as maker samper it creates the sample directory named samper under the current directory maker user samper will create a sample directory called samper under SL user removing a directory is done with rmd or remove directory the directory must be empty or the command will fail to remove a directory and all of its contents you have to do rm-rf note that MV B does double duty in that it can simply rename a file or move a file to another location while possibly changing its name at the same time if you're not certain about removing files that match a pattern use Supply it's always good to run RM in interactively rm-- I to prompt before every removal rmd IR Works only on empty directories otherwise you get an error so while typing rm-- RF is a fast and easy way to remove a whole file system tree recursively it's extremely dangerous and should be used with the utmost care especially when used by root recall that recursive means drilling down through all subdirectories all the way down a tree the PS1 variable is the character string that is displayed as the prompt on the command line most distributions set PS1 to a known default value which is suitable in most cases however users may want custom information shown on the command line for example some system administrators require the user and the host system name to show up on the command line as in this example this could prove useful if you're working in multiple roles and want to be always reminded of who you are and what machine you are on the prompt above could be implemented by setting the PS1 variable to the following for example you could do that with this command here by convention most systems are set up so that the root user has a pound sign as their prompt let's gain some experience with day-to-day basic fire file operations on a Centos stream system this would be the same on any Linux system so first let's create a couple of files uh they could be empty or they could be small uh one way to do it is to use the echo command and just say Echo and direct actually nothing into file one another way to do it is with the touch command I'll say Touch file two then if I do ls- a file one and file 2 I see two very small files that are both created uh at the same time basically uh if I want to rename one of them I could rename it with the move command like move file one to file one new name and then if I do ls- L star file star I see there it is uh it it it it has the new name now if I want to remove them I can simply say RM File 2 and it just work it's a good idea though to always use the eye option for interactive when doing removal then I would say rm- I file one new name and it'll ask me if I really want to do it uh many distributions will set up the eye option to be the default so that you always have a chance uh to change your mind about removing something before you do it now how would I make a directory I could do make deer uh deer one in fact I can make more than one directory on the same line I can do make deer deer 2 and deer 3 and if I look now I see I have three different directories they're all actually empty so let me put a couple of files in one of the directories so I'll do touch deer 2 to file one and I'll do touch deer to file two so if I do ls- LR just to see everything that's there in the directory files uh so I'll see deer one is empty deer 2 has these two files and deer three uh is also empty now the command for removing directories is RM deer so let's say I just try to remove them all with a RM deer deer star uh you notice it got rid of deer 1 and deer 2 but it couldn't remove deer deer 1 and deer 3 I should say it couldn't get rid of deer 2 because there's files in it to do that instead of using RM deer I would say RM RF deer 2 and then that goes and descends into the directory and gets rid of all the files be very careful with the rm-rf uh command because if you give the bad argument you could even wipe out your whole system but that is the standard way to get rid of a whole directory Tre so that's just some of the very basic commands for renaming files moving them creating directories removing them Etc when commands are executed by default there are three standard file streams or descriptors always open for use standard input standard output and standard error usually standard in input is your keyboard and standard output and standard error are printed on your terminal standard error is often redirected to an error logging file while standard in is supplied by directing input to to come from a file or from the output of a previous command through a pipe standard out is also often redirected into a file since standard error is where error messages are written usually nothing will go there in Linux all open files are represented internally by what are called file descriptors simply put these are represented by numbers starting at zero standard in is file descriptor zero standard out is file descriptor one Standard air is file descriptor 2 typically if other files are opened in addition to these three which are open by default they will start at the file descrip scriptor 3 and increase from there in the next section and in the chapters ahead you'll see examples which alter where a where a running command gets its input where it writes its output or where it prints diagnostic or error messages through the command shell we can redirect the three standard file stream so that we can get input from either a file or another command instead of from our keyboard and we can write output and errors to files or use them to provide input for subsequent commands for example if we have a program called do something that reads from standard in and writes to standard out and standard error we can change its input source by using the less than sign followed by the name of the file to be consumed for input data here's an example if you want to send the output to a file use the greater than sign as in this example because standard error is not the same as standard out air messages will still will still be seen on the terminal windows in the above example if you want to redirect standard error to a separate file you use standard errors file descriptor number two the greater than sign followed by the name of the file you want to hold everything the running command writes to standard error so here's how you would do that a special shorthand notation can send anything written to file descriptor 2 standard erir to the same place as file descriptor one standard out you can do it like this bash perits an easier Syntax for the above which is like so the unix/linux philosophy is to have many simple and short programs or commands cooperate together to produce quite complex results rather than have one complex program with many possible options and modes of operation in order to accomplish this extensive use of pipes is made you can pipe the output of one Commander program into another as its input in order to do this we use the vertical bar pipe symbol between commands as in this example here this represents what we often call a pipeline and allows Linux to combine the actions of several commands into one this is extraordinary efficient because Command 2 and command 3 do not have to wait for the previous pipeline commands to complete before they can begin hacking at the data in their input streams on multiple CPU or core systems the available computing power is much better utilized and things get done quicker furthermore there is no need to save output in temporary files between the stages in the pipeline which saves disk space and reduces reading and writing from disk which is often the slowest bottleneck in getting something done being able to quickly find the files you are looking for will save you time and enhance productivity you can search for files in both your home directory space or in any other directory or system or or location on the system the main tools for doing this are the locate and find utilities we'll also show how to use wild cards and Bash in order to specify any file which matches a given generalized request the locate utility program performs a search taking advantage of a previously constructed database of files and directories on your system matching all entries that contain a specified character string this can sometimes result in a very long list to get a shorter and possibly more relevant list we can use the grep program as a filter grep will print only the lines that contain one or more specified string as in this example which will list all the files and directories with both zip and Bin in their name we'll cover grap in much more detail later notice the use of the pipe or the vertical line to pipe the two commands together locate utilizes a database base created by a related utility update DB most Linux systems run this automatically once a day however you can update it at any time by just running update DB from the command line as the root user let's get some practice with locating and finding files on an Ubuntu system so suppose I want to find all files that have the string lfs 300 in them so I could do locate lfs 300 and it finds indeed just one file that's in the home student directory on the subd directory there and I could also find it by doing find dot meaning the current directory name lfs 300 star and then I'll see it finds it and if I want to find out a little more I can give the ls option which will show me who owns it what group they're in the length of the file the iode the date Etc now if I create another file just by doing Echo into lfs 300 so it creates essentially an empty file the find command will find the new file as well as the old one but the locate command will not because I need to update the database that uh that the locate command uses and I do that by running as roots so I need SU do as you do update DB and that was pretty quick uh and then I say locate it now it finds both files okay and um just to get rid of the file I didn't really need I'll remove it I run update DB again well I need it to be root so I have to say s you do and then once again locate fs300 won find this new file now I can configure update DB and locate to do a bunch of things so if I go to the ETC directory you'll see there's a file called update db. com and it controls where update DB does not look where locate does not look so for instance under prun task it says don't look in these places like the temp directory because they're temporary and you don't want to keep TR of what's there particularly and prun Fs these are file systems really pseudo file systems that are not real file systems that you shouldn't look in because they're also the uh contents change every time you boot let's say uh so for instance you don't look in the proc directory or the CIS FS directory or the dev directory uh well Dev FS directory because these things disappear every time you reboot uh and so that's pretty easy to configure there's some other things you can do which you can learn by looking at the documentation on your system you can search for a file name containing specific characters using wild cards to search for files using the question mark Wild Card replace each unknown character with question mark for example if you know only the first two letters are ba of a three-letter file name without an extension you can type this to search for files using the Wild Card replace the unknown string with the aster for example if you remember only that the extension was out type LS as. out let's get some experience using wild cards on an auntu system so I've gone to the VAR log directory and let me just do an LS to see what's there so for instance uh let me use the DU or dis usage utility which tells me all the bytes that are being used by a given file or subdirectory I could do something like D.S H uh AAR and you'll see these are all the different things under a uh some are directories like app the others are just files if I only wanted to look at ones which have log in the name I could do du s s h a star log star and so only ones that have log and their names if I only wanted to look at the ones that start from the letter P or later in the alphabet I could do du. sh a and then I could say uh square brackets p through Z Star you see it neglected the alternative one uh which would have done that if I just want to look at uh ones which have a certain character in them I could do something like duar do uh one character do star so those are all the ones that have a substring in them with one character uh here it's always a number but it wouldn't have to be um surrounded by periods on both sides now you have to be careful with wild cards that the system doesn't quote glob what you are doing the string that you are putting in so to give you an example uh you'll notice there's a bunch of different files here that start with the name VMware well they're all over in the right column here so suppose I try to do uh uh appg install VMware star and I should make that Su do well it's actually looking for packages with all these names like VMware Network one VM VSC Route 2 that log and there are of course no packages with silly names like that but I could do something like this now let me put the VMware star in quotes and you see it actually uh did find things it found two packages VMware NSX common VMware manager and it wants to install them and it needs these other Utilities in order for them to work uh I'm not going to do this because I don't need these guys so I'll just say no so when you put something in quotes it says don't look in the current directory to like fill out the names to expand what you're doing uh instead looking in this case in the database of packages um so you have to be careful and you'll often see people use quotes even when there's no need for them just to be safe so that's a little bit of demonstration of the use of wild cards find is an extremely useful and often used utility program in the daily life of a Linux system administrator it recurses down the file system tree from any particular directory or set of directories and locates files that match specified conditions the default path name is always the present working directory for example administrators sometimes scan for potentially large core files which contain diagnostic information after a program fails they're more than several weeks old in order to remove them it's also common to remove files that are not essential or that are outdated in the/ TMP directory especially those that have not been accessed recently many Linux distributions use shell scripts that run periodically through cron to perform such house cleaning when no arguments are given find list all files in the current directory and all of its subdirectories commonly used options to shorten the list include - name which only list files with a certain pattern in their name - iame also ignore the case of the file names and dash type which will restrict the results to files of a certain specifi type such as D for directory L for symbolic link or F for a regular file here's how you can search for files and directories named GCC here's how to search only for directories named GCC here's how to search for only for regular files named GCC another good use of find is being able to run commands on the files that match your search criteria the dash EXA option is used for this purpose to find and remove all files that end with s swp you can use this the squiggly brackets are a placeholder that will be filled with all the file names that result from the find expression and the proceeding command will be run on each one individually please note that you have to end the command with either a semicolon including the single quote or a SL semicolon both forms are fine one can also use the- okay option which behaves the same as- exact except that fine will prompt you for permission before executing the command this makes it a good way to test your results before blindly executing any potentially dangerous commands it is sometimes the case that you wish to find files according to attributes such as when they were created last used or based on their size it's easy to perform such searches to find files based on time you can use this here- C time is when the enode metadata or the the file in ownership that permissions last change it's often but not necessarily when the file was first created you can also search files based on when they were accessed or last read or based on when they were modified or last written the number is the number of days and can be expressed in either a number n that means exactly that Value Plus n which means greater than the number or minus n which means less than that number there are similar options for times and minutes as in the- cmen D aen and DM Min to find files based on sizes you can do this note that the size here is in 52 byte blocks by default you can also specify bytes kilobytes megabytes gigabytes Etc as with the time numbers above file sizes can also be exact numbers for details consult the man page to finded for example to find files greater than 10 megabytes in size and running a command on those files you can use this command let's gain some experience using a very powerful find utility on a nobuntu system and I'll work in the VAR log directory so suppose I wanted to see every file here that's uh underneath our log and let me do it as Su do because otherwise it will give me error messages about not having permissions to look at some files so do s you do find Dot and I get a very long list of every single file and directory that's underneath here if I wanted to restrict it just to directories I would do type D and you'll see this just shows me the directories and subdirectories okay cuz like some of them like live vert have multiple directories if I add to that another parameter Max Def One you see it suppressed the subdirectories here I only see live ver now so I only went down a depth of one and actually I could do two three or whatever is necessary though here it doesn't go that deep anyway now you can always add commands um to any fine command so I could do fine DOT type f and then I can say exact grip DH uh log and I put in that parentheses uh pair there and then let's say slash um semicolon you can also do a single Dash semicolon single Dash and it search to every single file that had the word log in it and printed out all the different things that were there or to keep it a little simpler I could have done exec just ls- L and it would give me listings of all these files okay now there actually is a LS option built into find so I didn't really have to do that and it will just show me that kind of information there's other things things I can do like find size zero it's finding all the files I should have done Su do but all the files that have a size of zero and if I want to verify that I'll add the ls option you see these are all files of the name with size zero uh you can also do things like find uh let's say I want to find everything that's newer than this file BM here I could do something like Su do find. uh newer B temp and it show me everything that's been done since then there's a million options to find you can be used on a lot of complicated ways you can negate any parameter you want to put in by saying not uh you can combine uh different search criteria and I recommend heavily that you really read up on mind if you're going to use it CU it's a little hard to describe in a few seconds but there's a million things you can do with it the core parts of a Linux distribution and most of its add-on software are installed via the package management system each package contains the files and other instructions needed to make one software component work well and cooperate with the other components that comprise the entire system system packages can depend on each other for example a package for a web-based application written in PHP can depend on the PHP package there are two broad families of packages package managers those based on Debian and those which use RPM as their low-level package manager the two systems are incompatible but broadly speaking provide the same features and satisfy the same needs there are some other systems used by more specialized Linux distributions in this section you will learn how to install remove or search for packages from the command line using these two package Management Systems both package Management Systems operate on two distinct levels a low-level tool such as dpkg or RPM takes care of the details of unpacking individual packages running scripts getting the software installed correctly while a highle tool such as aptg dnf yum or zipper works with groups of packages downloads packages from the vendor and figures out dependencies most of the time users need to work only with the highlevel tool which will take care of calling the low-level tool as needed dependency resolution is a particularly important feature of the highlevel tool as it handles the details of finding and installing each dependency for you be careful however as installing a single package could result in many dozens or even hundreds of dependent packages being installed the advanced packaging tool apt is the underlying package management system that manages software on Deviant based systems while it forms the back end for graphical package managers such as the yuntu software Center and synaptic its native user interface is at the command line with programs that include apt or appg and apt cach dnf is the op Source command line package management utility for the RPM compatible Linux systems that belongs to the red hat family dnf has both command line and graphical user interfaces Fedora and real 8 replaced the older yum utility with dnf thereby eliminating a lot of historical baggage as well as introducing many nice new cap abilities dnf is pretty much backwards compatible with yum for day-to-day commands zipper is the package management system for the Susi or open Susi family and it's also based on RPM zipper also allows you to manage repositories from the command line zipper is fairly straightforward to use and resembles dnf or yum quite closely to learn the basic package commands take a look at these basic packaging commands let's get some practice with the basic low-level command for the Debian packaging system dpkg or D package so to get a list of all the pack packages on the system I can simply type dpkg d-list and I'll just pipe that into list because it's a long list okay actually if I don't use list for some reason it's more compact okay so there are a lot of different packages on the system now if I want to see some information just about a particular package I could just grap let's say bzip 2 to see what's going on with bzip 2 and that's the information about bzip 2 that tells us the version number the architecture which here is amd64 and it's description as a highquality block sorting file compressor utility so it's a more advanced program with better compression than gzip or the oldfashioned zip program if I want to see what's actually contained in that package I can do DP kg list files and then the name of it and then I'll go slower by putting it into less and you'll see there's the executables in the bin directory and then what's under user is basically documentation under user share doc user sh man Etc if I try to remove the package let's see what happens so do su do dpkg I of course have to have root privilege to remove the package so I'm removing bzip 2 D package remove bzip 2 and it's telling me I cannot do this because I need the develop in package dpkg-dev that would be headers and stuff for programs which use uh this in a library version and firew raller with which is a archive extraor that's common on Linux systems so I would have to remove all three of them we'll see later when we use tools like appg it's easier to deal with these dependencies but now get some practice using the low-level RPM command in order to look at a package try to remove it Etc so we're going to type RPM dqa for query and look at all packages on the system and then then we're going to grip to look for the package bzip 2 okay and you see there's actually two RPM packages which have bzip 2 in there names the actual bzip 2 program and then bzip 2 lives which is libraries that depend on bzip 2 so let's take a look more at information about bzip 2 if I do RPM if I do RP m-q for query I for information and then L for a list of files and that's a lot so I'll pipe it through less oops I forgot to give the name of the package so bzip 2 you see the name is bzip 2 you see it's version 1.06 um we see it's Source RPM here we see when it was released in November 2015 at of sos.org and then a description of what it does it's a freely available patent-free highquality data compressor Etc and then a list of the files that are part of bzip 2 if I want to get a little bit more detailed look at what's in there I could do something a little fancier like RPM that Q L be zip 2 we just list the files and then uh I'll make that a shell command and substitute for it and do an ls- LF on that so this will give me a detailed listing and then I'll pipe it into less and these are actual files that are in the package in a little bit more detail like their length and what type of files you'll notice for instance B unzip 2 and bzip 2 are really the same file it's just a symbolic link and the system knows what to do or I should say the application knows what to do whether to zip or unzip depending on how it's called now let's see what happens if I try to remove the package so I I would should be a root to do that so do an Su do and then I'll do RPM d e for erase and then just to be extra careful I'll use the dash dash test which means it won't actually do anything with this option it'll just see if it could do it bzip 2 so I try to remove it and it's telling me that I can't do that because it's need by those following three packages as well as the file roller program uh which is an archiving program present on basically all Linux distributions and then I can get a little more information in a different way with RPM dq-- what provides BZ zip 2 and you'll see it's the bzip 2 package and if I do what requires I get the same information about the three packages that would like that need to have bzip 2 installed for them to behave properly and not crash or anything a little bit later we're going to discuss yum and zipper and also dnf which are higher level programs that can handle dependencies in robust fashion RPM is really designed for individual packages which are listed on the command line or groups of packages listed on the command line let's get some practice using dnf from the command line on a recent Fedora system so in order to do that first we'll have to bring up the command line so I'll do that with activities and I'll click on the terminal icon at the bottom and I got a nice command line terminal and I'll make it a little bit bigger because the the fonts bigger that is because uh it's hard to see with the smaller fonts and then first let's get a list of all packages that have the string bzip 2 in their name so I'll do that with dnf list and the first packages that will come up will be the ones that are already installed so let me scroll up a little because there's a really long list here so there I have the actual program bc2 a development package in case I want to write code that uses bzip 2 in internally and then uh bzip 2 lives would be used by programs that have bzip 2 in already built into them the two I'm going to be interested in installing here are the lb zip2 packages bzip 2 is a parallel version of bzip 2 that can separate the amount of work into a number of pieces that can be done simultaneously so for instance if you had four processors or cores you could split the work up into four pieces and do them all at the same time and then merge them at the end and in theory it could run almost four times as quickly so let's try to install the utilities package I'll do su do dnf install Live bzip 2 yeah I guess it's lb zip2 bzip 2 utils and you'll see yes it's happy to do that but it also needs the lb zip 2 package which it depends on so I say yes I'll just type Y and it will install the two packages um I probably have a program now called lb zip 2 but let's check if that's the case with which and yes I do so I could go ahead and use it now if I wanted if I don't really want these install and I want to clean up with them I could do um something like Su do dnf remove lb zip 2 and you notice it's happy to remove it but it's telling me that because lb zip 2 utils depends on lb zip 2 if I remove lb zip 2 I better remove them both otherwise I'll have an unsatisfied dependency so I'll just say yes so that's just a really simple uh example of using dnf in the command line unfortunately recent redhead based systems do not have a really good graphical package management utility pedora has something called dnf Dragon but it can be rather slow to load and a little bit buggy and there's nothing at all for Red Hat 8 or Centos S8 so experienced developers will just always tend to do things from the command line let's demonstrate some basic package management functions on an open Su system using the zipper utility so first first let's look for all packages with zipper search that have the string new clot in them and we see a number of packages let's concentrate on the documentation package so suppose I try to install that and for that I have to be a super user for an installation so I do su do zipper install new plot Dot and you notice it's telling me I not only have to install new plot. do I would have to install new plot which is the actual program that new plot. do-to uh documents so I'll say sure yes and it's been done successfully if I want to get some information about the package I can do RPM dqi new plot dto and for this once again I do not have to be root and it's telling me the name the version the size all sorts of things and under the purpose it's telling me it concludes the man and the info Pages for this rather useful plotting program now suppose I want to remove this package I can do zipper remove G new plot let's say I try to remove gplot not not new plot. th and it's telling me that if I remove new plot I also have to remove new plot. do- do because otherwise there would be unmet dependency so say yes for sure and now both of them are gone so that's basic steps you would take to look for package install it get some information about it and remove it using zipper so let's do some basic package Management on an auntu system using Debian packaging we're going to use the high level utilities which understand dependencies app cash and appg so first let's look for all packages that contain the string W get 2 so we do that with app cash search W get2 and it comes up with WG 2 and W get2 Dev this is uh an enhancement to the standard W get utility which is used for recursive downloading of the content of a website or some other kinds of uh resources so let's just try and install so I do su do get install W get2 ddev and it's telling me it also needs to install W live W get 0 and W get 2 it shouldn't be that surprising that you need to install the base packages on which the development packag is built on and it will download 264 kilobytes of archives but once everything's installed it will expand out to 805 kilobytes so let's just say yes I'll type Y and it quickly goes ahead and does all that now suppose I want remove W get to Dev well more interesting let's try to remove W get uh itself so what does it doing oh I shouldn't have removed W get I meant W get two w get I do not want to remove so I'll type it again with the two and you see it wants to remove W get to Dev as well because without W get W get2 Dev isn't have much meaning okay and we no longer need live W get zero um it's sort of offened out but we'll leave it there for now so I'll just say yes and I have removed things from my system so that's the most basic operations you would need to do on an Ubuntu system using Debbie and packaging you have completed chapter 7 let's summarize the key Concepts we covered virtual terminals or VT and Linux are consoles or commandline terminals that use the connected Monitor and keyboard different Linux distributions start and stop the graphical desktop in different ways a terminal emulator program on the graphical desktop works by emulating a terminal within a window on the desktop the Linux system allows you to either log in via text terminal or remotely via the console when typing your password nothing is printed to the terminal not even a generic symbol to indicate that you typed the preferred method to shut down or reboot the system is to use the shutdown command there are two types of path names absolute and relative an absolute path name begins with the root directory and follows the tree branch by Branch until it reaches the desired directory or file a relative path name starts with the present working directory using hard and soft symbolic links is extremely useful in Linux CD remembers where you were last and lets you get back there with CD Dash locate performs a database search to find all file names that match a given pattern find locates files recursively from a given directory or set of directories find is able to run commands on the files that it lists when used with the DX exec options touch is used to set the access change and edit time to files as well as to create empty files the advanced package tool packaging tool AP this package management system is used to manage installed software on dbm based such systems you can use the dnf command line package development utility for the RPM based Red Hat Family Linux distributions the zipper package management system is based on RPM and used for open Susi by the end of this chapter you should be able to use different sources of documentation use the Man pages access the new info system use the help command and the d-el option use other documentation sources whether you are an inexperienced user or a veteran you'll not always know or remember the proper use of various Linux programs and utilities what is the command to type what options does it take Etc you'll need to consult help documentation regularly because Linux based systems draw from from a large variety of sources there are numerous reservoirs of documentation and ways of getting help Distributors consolidate this material and present it in a comprehensive and easy to use manner important Linux documentation sources include the Man pages short for manual pages new info the help command and Das Das help option other documentation sources like the ginu handbook The Man pages are the most often used source of Linux documentation they provide in-depth documentation about many programs and utilities as well as other topics including configuration files and programming apis for system calls library library routines and the kernel they are present on all Linux distributions and are always at your fingertips the M Pages infrastructure was first introduced in the early Unix versions in the beginning of the 1970s the name man is just an abbreviation for manual typing man with a topic name as an argument retrieves the information stored in the Topic's Man pages the man program searches formats and displays the information contained in the man page system because many topics have copious amounts of relevant information output is piped through a pager program such as less to be viewed one page at a time at the same time the information is formatted for a good visual display a given topic may have multiple Man pages associated with it and there is a default order determining which one is displayed when no options or section number is specified to list all pages on the topic use the- f option to list all pages that discuss a specific topic even if the specified topic is not present in the name use the d-k option let's use the Manu ility to get some information about sockets on our system if I just type man socket I get chapter two of the Linux programmers manual I get the page in there in chapter two that has to do with sockets and this is a pretty General page that tells me a lot of information about sockets and different protocols that they can use if I want to get a list of all the pages that are called socket I do man- focket you'll see there's actually five of them in different chapters that by the way is exactly the same as saying what is Socket so man DF and apropo are the same if I want to see a particular page say chapter 7 I can do man 7 socket and I'm getting the man page in chapter 7 which is rather detailed if I want to see them all at once I can see man- a socket for all I guess and I can space my way through through this one if I hit Q it's telling me if I hit return I'll see the next one 3p so let's do that I'll hit Q again you see if I want to get out rather than going through the rest of them the next one would be seven I can hit contrl Ctrl D would just skip the next one if I want to see all Man pages that have the word socket in their Des basic description I do that with man- K and it's a rather list because sockets are pretty basic and involve all sorts of things on your system man- K is exactly the same just type it appropo socket and I get the exact same thing so that's just some basic day-to-day functioning of using man to get information you should play around with different Man pages and look at the real contents in them and see how they differ from page to page the next source of Linux documentation is the new info system this is the new project standard documentation format which it prefers as an alternative to man the info system is basically free form and supports linked subsections functionally info resembles man in many ways however topics are connected using links even though its design predates the worldwide web information can be viewed through either a command line interface a graphical help utility printed or viewed online typing info with no arguments in a terminal window displays an index of available topics you can browse through the topic list using the regular movement Keys arrows page up and page down you can view help for a particular topic by typing info topic name the system then searches for the topic in all available info files some useful keys are Q to quit a for help and enter to select a menu item the topic which you view in an info page is called a node this table lists the basic keystrokes for moving between nodes nodes are essentially sections and subsections in the documentation you can move between nodes or view each node sequentially each node may contain menus and links subtopics or items items function like browser links and are identified by an aster at the beginning of the item name named items side menu are identified with double colons at the end of the item name items can refer to other nodes within the file or to other files let's gain some experience using the info command for documentation so suppose I type info make I will get information about the make utility used by all programmers and this takes me to the top of the info page or the head node if I want to look for a particular topic I can hit slash and you'll see at the bottom it's prompting me for search so I'll say example and it brought me down here to rule example if I just hit return I get that page now at the top you'll notice it says the not is root example the next one is Rule syntax so if I hit an N I get the rule syntax it says the next one is prere quisite types if I hit n again I get prerequisite types if I hit P I will go back to the previous one so I hit beat rule syntax if I want to look again for example I can just hit the slash again and it it's prompting me for the same string so I'll just hit return and I'm finding a later example about wild card examples and if I hit return I find out above that if I want to go all the way up I can hit a u it takes me to the top of section 4.4 I hit you again I'm at chapter 4 I hit youu again I'm at the very top of everything if I want to get information on the various key stroke bindings I can hit an H for help and you'll see in the bottom window where the focus is shifted to it lists all the possible key strokes and what they can do so that's basically how I would use info if I hit Q I am out of it and the rest you can learn by navigating within the info page of any topic that interests you another important source of Linux documentation is the use of the --el option most commands have an available short description which can be viewed using the --el or the DH option along with the command or application for example to learn more about the man command you can type man- dhel the d-el option is useful as a quick reference and it displays information faster than the man or info pages when running within a bash command shell some popular commands such as Echo and CD actually run especially built-in bash versions of the commands rather than the usual binaries found on the file system it's more efficient to do so as execution is faster because as fewer resources are used one should note that there can be some usually small differences in the two versions of the command to view a synopsis of these built-in commands you can simply type help as shown in this screenshot for these built-in commands help performs the same basic function as the DH and --el arguments perform for Standalone programs in addition to the Man pages the new info system and the help command there are other sources of Linux documentation some of some examples of which include desktop help system package documentation and online resources you have completed chapter 8 let's summarize the key Concepts covered the main sources of Linux documentation are the Man pages new info and the help option and commands and a rich variety of online documentation sources the man utility searches formats and displays Man pages The Man pages provide in-depth documentation about programs and other topics about the system including configuration files system calls Library routines and the kernel the new info system was created by the new project as a as its standard documentation it's robust and it's accessible via command line web and graphical tools short descriptions for commands are usually displayed with the -8 or d-el argument you can type help at the command line to display a synopsis of built-in commands there are many other help resources both on your system and on the Internet by the end of this chapter you should be able to describe what a process is and distinguish between types of processes enumerate process attributes manage processes using PS and top understand the use of load averages and other process metrics manipulate processes by putting them in background and restoring them to foreground use at cron and sleep to schedule processes in the future or pause them a process is simply an instant of one or more related tasks threads executing on your computer it's not the same as a program or a command a single command may actually start several processes simultaneously some processes are independent of each other and others are related a failure of one process may or may not affect the others running on the on the system processes use many system resources such as memory CPU cycles and peripheral devices such as network cards hard drives printers and displays the operating system especially the kernel is responsible for allocating a proper share of these resources to each process and ensuring overall optimized system utilization a terminal window one kind of command shell is a process that runs as long as needed it allows users to execute programs and access resources in an interactive environment you can also run programs in the background which means they become detached from the shell processes can be of different types according to the task being performed here are some different process types along with their descript descriptions and examples a critical kernel function called the scheduler consistently shifts processes on and off the CPU sharing time according to the relative priority how much time is needed and how much has already been granted to a task when a process is in a so-called running state it means it's either currently executing instructions on a CPU or it's waiting to be granted a share of time a Time slice so it can execute all processes in this state reside on what is called a run que and on a computer with multiple CPUs or cores the there's a run que on each CPU or core however sometimes processes go into what is called a sleep State generally when they're waiting for something to happen before they can resume perhaps for the user to type something in this condition a process is said to be sitting in a weight queue there are some other less frequent process States especially when a process is terminating sometimes a child process completes but its parent process has not asked about its state amusingly such a process is said to be called a said to be in a zombie State it's not really alive but still shows up in the systems's list of processes at any given time there are always multiple processes being executed the operating system keeps track of them by assigning each of each a unique process ID or p number the p is used to track process State CPU usage me memory use precisely where resource are located in memory and other characteristics new PS are usually assigned in ascending order as processes are born thus P1 denotes the init process and and su su succeeding processes are gradually assigned higher numbers the table explains the P ID types and their descriptions at some point one of your applications may stop working properly how do you eliminate it to terminate a process you can type kill Das Sig kill P ID or K-9 PID note however you can only kill your own processes those belonging to another user are off limits unless you're root many users can access a system simultaneously and each user can run multiple processes the operating system identifies the user who starts the process by the real user ID or the ru ID assigned to the user the user who determines the access rights for the users is identified by the effective uid the euid the euid may or may not be the same as the ruid users can be categorized into various groups each group is identified by the real group ID or the RG ID the access rights of the group are determined by the effective group ID the EG ID each user can be a member of one or more groups most of the time we ignore these details and just talk about the user ID the U ID and the group ID GID at any given time many processes are running on the system however a CPU can actually accommodate only one task at a time just like a car can have only one driver at a time some processes are more important than others so Linux allows you to set and manipulate process priority higher priority processes get preferential access to the CPU the priority for a process can be set by specifying a nice value or niceness for the process for the the lower the nice value the higher the priority low values are assigned to important processes while high values are assigned to processes that can wait longer a process with a high nice value simply allows other processes to be executed first in Linux a nice value of -20 represents the highest priority and positive 19 represents the lowest while this may sound backwards this convention goes back to the earliest days of Unix you can also assign a so-called realtime priority to time sensitive tasks such as controlling machines through a computer or collecting incoming data this is just a very high priority and is not to be confused with what is called hard real time which is conceptually different and has more to do with making sure a job gets completed within a very well- defined time window so now let's show how to see what the niceness or priority of a process is and how you can change it with the rice command or how you can do it actually from a graphical user interface so let's look at the uh processes and current screen with the PS command which we will discuss in detail later and we see this current bash shell is 3077 to see the priority I can run PS with the options LF and there you see 3077 here is is uh here is the bash command and the niceness is zero so let's try to change the niess I can do rece um + 5 3077 and you see it did change the priority to five which I can see once again with the PS command it has made it five here notice that the child process I ran off there the command pslf also has a niess of five is there anything else I create in this shell will have that new niceness so this is a lower priority remember in inreasing the NCIS lowers the priority so now suppose I try to increase the priority by decreasing the NCIS to Minus 5 you notice it says I can't do that that's because only the super user or root is allowed to increase the priority of a process but if I type the same command over again with Su it work just fine and I can verify that once again with pslf and there you see it's set up to be minus5 now as well as the new um the new uh PS command that I issued now if I want to do this from a graphical utility I can run gnome system monitor I'll start from the command line here though I could get it uh from a menu and uh this is on the first possible screen here on processes so if I hear that was process 30 uh that was process is 3077 it's right here and you notice it says priority High I could rightclick on there and I can go to change priority and I can just say low and now you see that it's low and if I get out of the graphical utility and I look at the niess again you see now the priority has come up to five I not the the niess of five so that means it's low priority again so that's how you can manipulate the priority of a process from the command line or from a graphical utility the load average is the average of the load number for a given period of time it takes into account processes that are actively running on a CPU considered runnable but waiting for a CPU to become available or sleeping I.E waiting for some kind of resource to become available the load average can be viewed by running W top or uptime the load average is displayed using three numbers such as 0.45 0.17 and 0.12 in this screenshot assuming our system is a single CPU system the three load average numbers are interpreted as follows 0.45 means for the last minute the system has been 45% utilized on average .17 means for the last 5 minutes utilization has been 17% and 12 is for the last 15 minutes utilization has been 12% if we saw a value of 1 in the second position that would imply the single CPU system was 100% utilized on average over the past 5 minutes this is good if we want to fully use a system value over one for a single CPU system implies that the system was over utilized there were more processes needing CPU than CPU was available if we had more than one CPU say a quad CP CPU system we would divide the load average numbers by the number of CPUs in this case for example seeing a 1 minute load average of 4.0 implies that the system as a whole was 100% 4id by 4 utilized during the last minute short-term increases are usually not a problem a high peak you see is likely a burst of activity not a new level for example at start up many processes start and then act and then activity settles down the high peak is seen in the five and 15 minute load averages it may be caused for concern Lin supports background and foreground job processing a job in this context is just a command launched from a terminal window foreground jobs run directly from the shell and when one foreground job is running other jobs need to wait for Shell access at least in that terminal window if using the the guey until it's completed this is fine when when jobs complete quickly but this can have an adverse effect if the current job is going to take a long time even several hours to complete in such cases you can run the job in the background and free the shell for other tasks the background job will be executed at lower priority which in turn will allow smooth execution of the interactive tasks and you can type other commands in the terminal window while the background job is running by default all jobs are executed in the foreground you can put a job in the background by suffixing and or the Amper sand to the command for example update DB Amper sand you can either use contrl Z to suspend a foreground job or contrl C to terminate a foreground job and you can always use the BG and FG commands to run a process in the background and foreground respectively the job utility displays all jobs running in the background the display shows the job ID State and command name as shown here jobs- L provides the same information as jobs and adds the P ID of the background jobs the background jobs are connected to the terminal window so if you log off the job utility will not show the one started from that window PS provides information about currently running processes keyed by P ID if you want a repetitive update of this status you can use top or other commonly installed variants such as htop or aop from the command line or invoke your distributions graphical system monitor application PS has many options for specifying exactly which tasks to examine what information to display about them and precisely what output format should be used without options PS will display all processes running under the current shell you can use the dasu option to display information of processes for a specified username the command ps- EF displays all the processes in the system in full detail the command ps- EF goes one step further and displays one line of information for every thread remember a process can contain multiple threads PS has another style of option specification which stems from the BSD variety of Unix where options are specified without proceeding dashes for example the command PS Au displays all processes of all users the command PS axo allows you to specify which attributes you want to view this screenshot shows a stample output of PS with the aux and axo qualifiers the PS utility is used very often at the command line to gather information about what is running on on the system about the various processes and tasks which were running what resource they were using what relationship they have to each other Etc if I just type PS without any arguments I get the processes which have been launched underneath this particular terminal window and uh in order to make it more interesting I have a background processes running I have a cat a aulus which is the file manager and Evin which is the PDF viewer I can get more information if I type ps- f which you see now also tells me the parent process ID so you notice bash has a process ID of 2942 and that's the parent process for both the cat and the Nautilus which I launched directly out of the shell as well as the PS command itself uh the evince command is actually has something else as a pair for complicated reasons having to do with how the gnome shell runs if I want to get a different piece of information I can do ps- L and now uh I am also seeing information in these two columns about the priority and the niceness which on most Linux systems is just a a a numerical shift okay from uh a neutral niess of zero means the default priority of 80 which is what all normal processes start out with okay now I can do more than this if I want to give additional arguments so I do ps- EF uh this will tell me about all processes on a system and let me type it into less so it doesn't go too quickly so you can see this is everything which is actually running on my system you'll notice that the first bunch processes uh in this rather long list all have these square brackets around them that means they were not started by a user program they're running inside the kernel to do various kinds of uh background tasks that run in the kernel all the time handle moving things from one CPU to another for instance and all kinds of other things uh and you see they have different priorities uh they minus 20 here uh minus 20 there that means they're higher priorities okay it's kind of backwards the lower the priority number here the higher the priorities is if I page down to the bottom I will eventually get to tests which are not running inside the kernel which are uh running for instance uh under my name here Coupe and so you see these are the actual user processes and uh they they're quite a bit different now one reason the PS command can be a little confusing is that there are different kinds of options those which have a dash and which those which do not so for instance ps- e is different than PS space e uh one commonly set of options is PS aux without a dot dash and there you see uh one nice additional piece of information is the percentage of CPU being used and of course uh there isn't much going on in the system right now so that tends to be zero so you can customize what the output of the PS command is uh if you look at the man page for PS you'll see there's ways to have it print out only the columns that you want if you want to produce some customized reports Etc but a standard Linux system administrator probably uses PS every day for one thing or another PS3 displays the processes running on the system in the form of a tree diagram showing the relationship between a process and its parent process and any other processes that it created repeated entries of a process are not displayed and threads are displayed in curly braces while a static view of what the system is doing is useful monitoring the system performance live over time is also valuable one of option would be to run PS at regular intervals say every few seconds a better alternative is to use top to get constant realtime updates until you exit by typing q. toop this clearly highlights which processes are consuming the most CPU cycles and memory using appropriate commands from within top the first line of the top output displays a quick summary of what is happening in the system including how long the system has been up how many users are logged on and what is the load average the load average determines how busy the system is load average of 1.0 per CPU indicates a fully subscribed but not overloaded system if the load average goes above the value it indicates that the processes are competing for CPU time if the load average is very high it might indicate that the system is having a problem such as a runaway process a process in a nonresponding state the second line of the top output displays the total number of processes the number of running sleeping stopped and zombie processes comparing the number of running processes with the load average helps determine if the system has reached its capacity or perhaps a particular user is running too many processes the stopped processes should be examined to see if everything is running correctly the third line of the top output indic indicates how the CPU time is being divided between the users and the kernel by displaying the percentage of CPU time used for each the percentage of user jobs running at a lower priority niceness dni is then listed idle mode or ID should be low if the load average is high and vice versa the percentage of jobs waiting wa for Io is listed interrupts include the percentage of Hardware or hi vers software interrupts SI steel time St is generally used with virtual machines which has some of its idle CPU time taken for other uses the fourth and fifth lines of the top output indicate memory usage which is divided in two categories physical memory or Ram displayed on line 4 and swap space displayed on line five both categories display total memory used memory and free space you need to monitor memory usage very carefully to ensure good system performance once the physical memory is exhausted the system starts using swap space or temporary storage space on the hard drive as an extended memory pool and since accessing disk is much slower than access accessing memory this will negatively affect the system performance if the system starts using swap often you can add more swap space however adding more physical memory should also be considered each line in the process list of the top output displays information about a process by default processes are ordered by highest CPU usage the following information about each process is displayed process identification number P ID process owner the user priority PR and nice values ni virtual physical and shared memory status s a percentage of CPU and memory used execution time the time plus and command besides reporting information top can be utilized interactively for monitoring and controlling processes while top is running in a terminal window you can enter single letter commands to change its behavior for example you can view the top ranked processes based on CPU or memory usage if needed you can alter the priorities of running processes or you can stop or kill a process this table lists what happens when pressing various Keys when running top the top utility is used to interactively monitor what processes and tests are doing on your system to start it up all you have to do is type top and it will refresh itself at some interval of I think by default two or 3 seconds it's easily changed uh it shows you standard information about each process similar to what you get with the PS command such as the process ID the user the priority and niceness some information about how the memory is being used by the process U the state as being meaning sleeping for instance and by default it is sorted by CPU time and then there's also memory the total time and what the actual command is the lines at the top are are have been designed over the years to convey a lot of information so in the first one you see how long the system has been up how many users there are the load average or uh or rolling averages of how much time has been spent in the last I believe 1 minute 5 minutes Etc there are currently 295 tasks running on the system but really only one is is running the others are sleeping um and this shows you the CPU time percentages used by the user processes by the system by so-called nice processes um and then uh idle and uh how many would be waiting how many are high priority and and and some other details like that then you have basic information about the memory such how much is being used how much swap there is available being used how much is in cash Etc if I type the letter one I get statistics for each CPU instead of uh just The Amalgamated total and that can be rather useful one will take it back again if I hit H I get a listing of what the possible keys I can hit are and what they do uh I wouldn't make sense to try to run through much of that here but I highly recommend that you run top and play with these different keys and try to understand what kind of information you can extract well top is how you can do it from the command line and if you hit q that will kill the program you can get similar information by going to your menus and finding system monitor and then uh let me drag that over to this screen uh the processes paint on here is pretty much the same as tops got the same information it's easier to do things that could Resort because I could just click on memory and get it sorted by how much memory is used by clicking again I'll get it in descending order uh priorities CPU Etc you can also once again change the priority of processes you can kill them Etc so uh you can do a lot and if you want to see the graph just click on resources you can see what's going with a constantly redrawn graph and with file systems you can see um how much of your file systems on the computer are actually full uh where they're mounted Etc so that's a brief explanation of top and some related issues suppose you need to perform a task on a specific day sometime in the future however you know you will be away from the machine on that day how will you perform the task you can use the at utility program to execute any non-interactive command at a specified time as Illustrated in this screenshot Kon is a time-based scheduling utility program it can launch routine background jobs at specific times and or days on an ongoing basis KRON is driven by a configuration file called the cron table which contains the various shell commands that need to be run at the properly scheduled times there are both systemwide cron tab files and individual user-based ones each line of the Chron tab file represents a job and is composed of a so-called Chron expression followed by a shell command to execute typing Chron t-e will open the Chron tab Editor to edit existing jobs or to create new jobs each line of the cron tab file will contain six fields and here are some examples sometimes a command or job must be delayed or suspended suppose for example an application has read the and process the contents of a data file and then needs to save a report on a backup system if the backup system is currently busy or not available the application can be made to sleep or wait until it can complete its work such a delay might might be to mount the backup device and prepare it for writing sleep suspends execution for at least the specified period of time which can be given as the number of seconds the default minutes hours or days after that time has passed or an interrupting signal has been received execution will resume the syntax is sleep and the number and then the suffix where the suffix may be S for seconds the default m for minutes H for hours or D for days sleep and at or at are quite different sleep delays execution for a specific period while at starts execution at a later time youve completed chapter nine let's summarize the key Concepts covered processes are used to perform various tasks on the system processes can be single-threaded or multi-threaded processes can be of different types such as interactive and non-interactive every process has a unique identifier the PID to enable the operating system to keep track of it the nice value or niess can be used to set priority PS provides information about the currently running processes you can use top to get constant real time updates about overall system performance as well as information about the processes running on the system load average indicates the amount of utilization the system is under at particular times Linux supports background and foreground processing for a job at executes any non-interactive command at a specified time KRON is used to schedule tasks that need to be performed at regular intervals by the end of this chapter you should be able to explore explore the file system and its hierarchy explain the file system architecture compare files and identify different file types and backup and compress data in Linux and all Unix like operating systems it is often said everything is a file or at least at least it's treated as such this means whenever you are dealing with normal data files and documents or with devices such as sound card cards and printers you interact with them through the same kind of input output operations this simplifies things you open a file and perform normal operations like reading the file and writing on it which is one reason why text editors which you will learn about in in an upcoming section are so important on many systems including Linux the file system is structured like a tree the tree is usually portrayed as inverted and starts at what is most often called the root directory which marks the beginning of the hierarchial file system and is also sometimes referred to as the trunk or simply denoted by a slash the root directory is not the same as the root user the hierarchial file system also contains other elements in the path or directory names which are separated by forward slashes as in user Spinx where the last element is the actual file name in this section you will learn about some basic concepts including the file system hierarchy as well as about disk partitions Linux supports a number of native file system types expressly created by Linux developers such as ext3 ext4 uh squash fs and btrfs it also offers implementations of file systems used on other alien operating systems such as those from Windows SGI IBM or Mac OS many older Legacy file systems such as fat are also supported each file system on a Linux system occupies a disk partition partitions help to organize the contents of diss according to the kind and use of the data contained for example important programs required to run the system are often kept on a separate partition known as root or slash this is a separate partition than the one that contains files owned by regular users of the system in slome in addition temporary files created and destroyed during the normal operation of Linux may be located on dedicated partitions one advantage of this kind of isolation by type and variability is that when all available space on a particular partition is exhausted the system may still operate normally this picture shows the use of the G parted utility which displays the partition layout on a system which has four operating systems on it R eight8 C os7 Ubuntu and Windows before you can start using a file system you need to mount it on the file system tree at the mount point this is simply a directory which may or may not be empty where the file system is to be grafted on sometimes you may need to create the directory if if it does not already exist but keep in mind this warning if you mount a file system on a non-empty directory the former contents of that directory are covered up and not accessible until the file system is unmounted thus Mount points are usually empty directories the mount command is used to attach a file system which can be local to the computer or on a network somewhere within the file system tree the basic arguments are the device node and the mount point for example studo Mount or /dev sda5 slome will attach the file system contained in the dis partition associated with the /dev sda5 device node into the file system tree at the /home mount point there are other ways to specify the partition other than the device node such as using the dis label or The UU ID to unmount the partition the command would be pseudo umount slome note the command is umount not unmount only a root user has the privilege to run these commands unless the system has been otherwise configured if you want it to be automatically available every time the system starts up you need to edit the /c/ fstab accordingly looking at this file will show you the configuration of all preconfigured file systems man fstab will display how this file is used and how to configure it executing Mount without any arguments will show all presently mounted file system systems the command df- th dis free will display information about mounted file systems including the file system type and usage statistics about currently used and available space it's often necessary to share data across physical systems which may be either in the same location or anywhere that can be reached by the internet a network or distributed file system may have all data on one machine or have it spread out out on more than one network node a variety of different file systems can be used locally on the individual machines a network file system can be thought of as a grouping of lower level file systems of varying types many system administrators Mount remote users home directories on a server in order to give them access to the same files and configuration files across multiple client systems this allows the users to log into different computers you still have access to the same files and resources the most common such file systems is named simply NFS the network file system it has a very long history and was first developed by Sun Microsystems another common implementation is cifs also termed Samba which has Microsoft roots in this section you will learn to identify and differentiate between the most important directories found in Linux we start with ordinary users home directory space each user has a home directory usually placed under the slome the/ root directory on Modern Linux systems is no more than the home directory of the root user or super user or system administrator account on multi-user systems the slome directory infrastructure is often mounted as a separate file system on its own partition or even exported remotely on a network through NFS sometimes you may group users based on their department or function you can then create subdirectories under the slome directory for each of these groups for example a school May organized slome with something like the following slome facty slome staff slome students the /bin and SL sbin directory the /bin directory contains executable binaries essential commands used to boot the system and essential commands required by all system users such as cat CP LS MV PS and RM likewise the/ sbin directory is intended for essential binaries related to system administration such as FSS and IP to view of list of these programs you can type lsbs spin commands that are not essential for the system to boot or operate in single user mode are placed in the/ user bin and/ userin directories historically this was done so/ user could be mounted as a separate file system that could be mounted at a later stage of system startup or even over a network however nowadays most find this distinction is obsolete in fact many distributions have been discovered to be unable to boot with this separation as this modality had not been used or tested for a long time thus on some of the newest Linux distributions sluser spin and/ spin are actually just symbolically linked together as are/ userin and/ spin certain file systems like the one mounted at slpr are called pseudo file systems because they have no permanent presence anywhere on the disk the slpr file system contains virtual files files that only exist in memory that permit viewing constantly changing kernel data slpr contains files and directories that mimic kernel structures and configuration information it does not contain real files but onetime system information IG system memory devices mounted Hardware configuration Etc some important entries in SL proc are the following slpr has subdirectories as well including the following the first example shows there is a directory for every process running on a system which contains Vital Information about it the second example shows a virtual directory that contains a lot of information about the entire system in particular its hardware and configuration the slpr file system is very useful because the information it reports is gathered only as needed and never needs storage on the dis the /dev directory contains device nodes a type of pseudo file used by most hardware and software devices except for network devices this directory is empty on the dis partition when it's not mounted and also contains entries which are created by the UDF system which creates and manages device nodes on Linux creating them dynamically when devices are found the /dev directory contains items such as /dev sda1 the first partition on the first hard disk /d lp1 the second printer SL da random a source of random numbers the SL ofar directory contains files that are expected to change in size and content as the system is running VAR stands for a variable such as the entries in the following directories system log files /ar log and packages and database files like slf farli print cues /ar SLS poool and temporary files /var TMP the /var directory may be put on its own file system so that growth of the files can be accommodated and any exploding file sizes do not fatally affect the system network service directories such asfar FP the FTP Service inar www the HTTP web service are also found under SLB bar the SLC directory is the home for system config configuration files it contains no binary programs although there are some executable scripts for example /c/ resolve. conf tells the system where to go on the network to obtain host to IP address mappings DNS files like password Shadow and group for managing user accounts are found in the SLC directory well some distributions have historically had their own extensive infrastructure under SLC with the Adent of system MD there's much more uniformity among distributions today note that/ Etc is for systemwide configuration files and only the super user can modify files there user specific configuration files are always found under their home directory the SL boot directory contains the few essential files needed to boot the system for every alternative kernel installed on the system there are these four files VM Li nuz which is the compressed Linux kernel required for booting in it Ram FS which is the initial Ram file system required for booting sometimes called init Rd not init Ram fs and then config the kernel configuration file only used for debugging and bookkeeping and finally system.map which is the kernel symbol table only used for debugging each of these files has a kernel version appended to its name the grub files such as boot SLG grub grub.com orboot grub2 grub2 CFG are also found under the/ boot directory this screenshot shows an example listing of the/ boot directory taken from the real system that has multiple installed kernels including both distribution supplied and custom compiled ones names will vary and things will tend to look somewhat different on a different distribution SL Li contains libraries which is which are common code shared by applications and needed for them to run it contains libraries for essential programs in SLB and slin these Library file names either start with LD or lib here's an example most of these are what is known as dynamically loaded libraries also known as shared libraries or shared objects on some Linux distributions there exist a SL lib64 directory containing 64-bit libraries while SL lib contains 32-bit versions on re recent Linux distributions you can find this just like for /bin and/ sbin the directories just point to the those under SL user kernel modules or colel code often device drivers that can be loaded and unloaded without restarting the system are located in/ li/ modules SL and then the kernel version number one often uses removable media such as USB driv CDs and DVDs to make the material accessible through the regular file system it has to be mounted at a convenient location most Linux systems are configured so any removable media are automatically mounted when the system notices something has been plugged in while historically this was done under the/ media directory modern Linux distributions place these Mount points under the/ run directory for example a USB pin drive with a label my USB drive for a usern named student will be mounted atrun media studenty USB drive the SL Mount directory has been used since the early days of Unix for temporarily mounting file systems these can be those on removal able media but more often they might be Network file systems which are not normally mounted or these can be temporary partitions or so-called loop back file systems which are files which pretend to be partitions here are some additional directories to be found under the root directory the SL user directory tree contains theoretically non-essential programs and scripts in the sense that they should not be needed to initially boot the system and has at least the following subdirectories shown here now that you know about the file system and its structure let's learn how to manage files and directories diff is used to compare files and directories this often used utility program has many useful options including the ones you see here to compare two files at the command prompt type diff and options file name one file name two diff is meant to be used for text files for binary files one can use CMP in this section you will learn additional methods for comparing files and how to apply patches to files you can compare three files at once using diff 3 which uses one file as the reference basis for the other two for example suppose you and a coworker both have made modifications to the same file working at the same time independently diff 3 can show the differences based on the common file you both started with here's the Syntax for diff 3 this graphic shows the use of diff 3 many modifications to source code and configuration files are distributed utilizing patches which are applied not surprisingly with the patch program a patch file contains the Deltas or changes required to update an older version of a file to the new one the patch files are actually produced by running diff with the correct options as in this command Distributing just the patch is more concise and efficient than Distributing the entire file for example if only one line needs to change in a file that contains 1,000 lines the patch file will be just a few a few lines long to apply a patch you can just do either of these two methods the first usage is more common as it's often used to apply changes to an entire directory tree rather than just one file as in the second example to understand the use of the- P1 option and many others see the man page for patch in Linux a file's extension often does not categorize it the way it might in other operating system systems one cannot assume that a file name file.txt is a text file and not an executable program in Linux a file name is generally more meaningful to the user of the system than the system itself in fact most applications directly examine a file's contents to see what kind of app object it is rather than relying on an extension this is very different from the way Windows handles file names where a file name ending in. exe for example represents an executable binary file the real nature nature of a file can be determined by using the file utility for the file names given as arguments it examines the contents and certain characteristics to determine whether the files are plain text shared libraries executable programs scripts or something else there are many ways you can back up data or even your entire system basic ways to do so include the use of simple coping with CP and use of the more robust rsync both can be used to synchronize entire directory trees however our sync is more efficient because it checks if the file being copied already exists if the file exists and there is no change in size or modification time our sync will avoid an unnecessary copy and save time furthermore because R sync copies only the parts of the file that have actually changed it can be very fast CP can only copy files two and from destinations on the local machine but rsync can also be used to copy files from one machine to another locations are designated in the Target colon path form where Target can be the form of someone at host and the someone at part is optional and used if the remote user is different from the local user our sync is very efficient when recursively copying One Directory tree to another because only the differences are transmitted over the network one often synchronizes the destination directory tree with with the origin using the dasr option to recursively walk down the directory tree copying all files and directories below the one listed as the source our sync is a very powerful utility for example a very useful way to back up a project directory might be to use this command note that rsync can be very destructive accidental misuse can do a lot of harm to data and programs by inadvertently copying changes to where they are not wanted take care to specify the correct options and paths it's highly recommended that you first test your rsync command using the dash dry-run option to ensure that it provides the results that you want to use rsync at the command prompt type rsync source file destination file where either file can be on the local machine or on a network machine the contents of source file will be copied to destination file a good combination of options is shown here the file data is often compressed to save dis space and reduce the time it takes to transmit files over networks Linux uses a number of methods to perform this compression including these these techniques vary in the efficiency of the compression or how much space is saved and how long they take to compress generally the more efficient techniques take longer decompression time does not vary as much across different methods you have completed chapter 10 let's summarize the key Concepts covered the file system tree of starts at what is often called the root directory or trunk or slash the file system hierarchial standard FHS provides Linux developers and system administrators a standard directory structure for the the file system partitions help to segregate files according to usage ownership and type file systems can be mounted anywhere on the main file system tree at a mount Point automatic file systems mounting can be set up by editing Etc FST tab NFS or network file system is a useful method for sharing files and data through the network systems file systems like slpr are called studo file systems because they exist only in memory SL root is the home directory for the root user /var may be put in its own file system so that growth can be contained and not fatally affect the system/ boot contains the basic files needed to boot the system patch is a very useful tool in Linux many modifications to source code and configuration files are distributed with patch files as they contain the Deltas or changes to go from an old version of a file to the new version of a file file extensions in Linux do not necessarily mean that a file is of a certain type CP is used to copy files on the local machine while rsync can be all can be used to copy files from one machine to another as well as synchronized contents by the end of this chapter you should be familiar with how to create and edit files using the available Linux text editors Nano a simple text based editor gedit a simple graphical editor VI and emac two Advanced editors with both text based and graphical interfaces at some point you will need to manually edit text files you might be composing an email offline writing a script to be used for bash or other command interpreters altering a system or application configuration file or developing source code for a programming language such as C python or Java Linux administrators May sidestep using a text editor instead employing graphical utilities for creating and modifying system configuration files however this can be more laborous than directly using a text editor and be more limited in capability note that word processing applications including those that are part of common Office application Suites are not really basic text editors they add a lot of extra usually invisible formatting information that will probably render system administration configuration files unusable for their intended purpose so knowing how to confidently use one or more text editors is really an essential skill to have for Linux by now you have certainly realized Linux is packed with choices when it comes to text editors there are many choices ranging from quite simple to very complex including Nano gedit VI or emac in this section we learn first about the Nano and gedit editors which are relatively simple and easy to learn and then later the more complicated choices VI and emac before we start let's take a look at some cases where an editor is not needed sometimes you may want to create a short file and don't want to bother invoking a full text editor in addition doing so can be quite useful when used from within scripts even when creating longer files you'll no doubt find yourself using this method when you start on the later chapters that cover shell skip scripting if you want to create a file without using an editor there are two standard ways to create one from the command Lin and fill it with content the first one is to use Echo repeatedly like shown here note that while a single greater than sign will send the output of a command to a file two of them will appin the new out output to an existing file the second way is to use cat combined with redirection uh as in this example here both techniques produce a file with the following lines in it line one line two line three and are extremely useful when employed by scripts there are some text editors that are pretty obvious they require no particular experience to learn and are actually quite capable even robust particularly easy to use one is the text terminal based editor Nano just invoke Nano by giving a file name as an argument all the help you need is displayed at the bottom of the screen and you should be able to proceed without any problem as a graphical editor gedit is part of the gnome desktop system kri is associated with KDE the gedit and kri editors are very easy to use and are extremely capable they're also very configured they look a lot like notepad and windows other variants such as Kate are also supported by KDE Nano is easy to use and requires very little effort to learn to open a file type Nano and then the file name and press enter if the file does not exist it will be created Nano provides a two-line shortcut at the bottom of the screen that lists the available commands some of these commands are contrl G display the help screen crl o WR to a file contrl X ex exit a file contrl R insert contents from another file to the current buffer or contrl C show the cursor position zedit is a simpl to ous graphical editor that can only be run within a graphical desktop environment it is visually quite similar to the notepad text editor in Windows but it's actually far more capable and very configurable and has a wealth of plugins available to extend its capabilities further to open a new file find the program in your desktop's menu system or from the command line type gedit and then the file name if the file does not exist it will be created using gedit is pretty straightforward and does not require much training it's interface is composed of quite familiar elements developers and administrators experienced in working on Unix like systems almost always use one of the two vable editing options VI and emac both are present or easily available on all distributions and are completely compatible with the versions available on other operating systems both VI and emac have a basic purely text-based form that can run in a non-graphical environment they also have one or more graphical interface forms with extended capabilities these may be friendlier for a less experienced user while VI and Emil Max can have significantly steep learning curves for new users they're extremely efficient when when one has learned how to use them usually the actual program installed on your system is vim which stands for Vi improved and is Alias to the name VI even if you don't want to use VI it's good to gain some familiarity with it it's a standard tool installed on virtually all Linux distributions and Mac OS indeed there may be times when there is no other editor available on the system and remember VI and them are going to be very similar gome extends VI with a graphical interface known as gvm and KDE offers km either of these may be easier to use at first when using VI all commands are entered through the keyboard you don't need to keep moving your hands to use a pointer device such as a mouse or touchpad unless you want to do so when using one of the graphical versions of the editor typing Vim tutor launches a short but very comprehensive tutorial for those who want to learn their first VI commands even though it provides only an introduction and just seven lessons it has enough material to make you a very proficient VI user because it covers a large number of commands after learning these basic ones you can look up new tricks to incorporate into your list of VI commands because there are always more optimal ways to do things in VI with less typing VI provides three modes as described in this table here here it's vital to not lose track of which mode you're in many keystrokes and commands have quite different behave quite differently in different modes this table describes the most important commands used to start exit read and write files in VI the enter key needs to be pressed after all of these commands and this table describes the most important keystrokes used when changing cursor positions in VI line mode commands those following a colon require the enter key to be pressed after the command is typed let's get started on using modes and cursor movements in VI open VI by typing VI followed by the file name VI opens in command mode type I to enter insert mode VI's insert mode is displayed type the following sentences the quick brown fox jumped over the lazy dog nobody expects the Spanish Inquisition to exit insert mode and switch to command mode press escape to exit VI and save the file type colon WQ and press enter open the recently saved file and place the cursor on the letter k in the word quick in the first sentence to move the cursor four characters to the left type h four times the cursor is moved to letter Q of the word quick to move the cursor to the next line type J to move the cursor to the beginning of the next word type w the cursor is moved to the beginning of the word expects to move the cursor to the end type the dollar sign the cursor is moved to the end of the second sentence type I to enter insert mode VI insert mode is displayed to insert text at the end of the second sentence type A and type history the word history is displayed to the end of the sentence to exit insert mode and switch to command mode press escape to exit VI and save the file type colon WQ and press enter here you can see the most important commands used when searching for text in VI the enter key should be pressed after typing the search pattern this table describes the most important keystrokes used when searching for text in VI and this table describes the most important keystrokes used when changing adding and deleting text in VI typing the sh command opens an external command shell when you exit the shell you will resume your editing session typing exclamation point executes a command from within VI the command follows the exclamation point this technique is best suited for non-interactive commands such as exclamation point WC percentage typing this will run the word count command on the file the character the percentage represents the file currently being edited let's get started on using external commands saving and closing in Vim editor open VI editor by typing VI followed by the file name VI opens in command mode type I to enter insert mode VI's insert mode is displayed type the following sentences nobody expects the Spanish Inquisition nobody expects the 2020 Revolution to exit insert mode and switch to command mode press escape to write and quit the file type colon WQ the file is updated with the changes and closed open VI by typing VI followed by the file name to count the words in the current file type colon exclamation WC percent the word count is displayed press enter to continue editing to quit if no edits were made in the file type colon Q the file is closed open VI by typing VI followed by file name to quit without saving the file type colon Q exclamation the file is closed without saving the changes the emac editor is a popular competitor for Vi unlike VI it does not work with modes emac is highly customizable and includes a large number of features it was initially designed for use on a console but was soon adopted to work with a guy as well emac has many other capabilities other than simple text Ting for example it can be used for email debugging and many other things rather than having different modes for command and insert like VI emac uses the control and meta or alt or Escape keys for special commands here you can see some of the most important key combinations that are used when starting exiting reading and writing files in emac but emac tutorial is a good place to start learning basic commands it's available anytime when in emac by simply typing control h for help and then the letter t for tutorial we will now demonstrate some of the operations you can do with emac in your daily work so first let's get a file to edit so working in the TMP directory let's get a copy of Etc password and bring it over here and then in order to work on it I just have to say emac pass and the name of the file Now the default font here is a little small so I'll play a trick and hit control and the middle button of the mouse to control the size of the font and then I'll make the window a little bigger Okay so we've done that now suppose I want to look for a certain string let's say FTP I would hit contrl s and type in the very bottom window the very bottom line here FTP so you can see down here and you'll see it brought me to FTP I'll go back to the beginning of the line by hitting control a and then let's say I want to change all occurrences of the string FTP to something else I hit Escape percent Mark and then I'll say FTP again on the bottom line and then let's just do it backwards in capitals PTF and you see I hit space it does the first one space it does the second one space it does the third one if I had hit an exclamation point it would have done all of them in the entire file suppose I want to remove a a line I can just hit contrl K and it's gone contrl K is gone again suppose I want to remove a range of lines I hit control space and then I go down a few lines uh with either the arrow key or crln I hit contrl w and they're gone if I want to move them further on in the file I go down a few lines and I hit control y for yank and they're back in there one nice thing I can do with emac is open up multiple windows at the same time so let me hit crl X2 and now I've got two windows and I can switch to the bottom window by hitting crl XO for other and then I hitr XF I can put a different file in that buffer so let's say I put in ETC group okay and once again I'll make the font a little bigger by hitting control in the middle button on the mouse okay and you'll notice the bottom line is actually uh right protected so I can't really delete anything because it belongs to root if I try to delete this line it won't let me do it it says buffer is read only but in general I if I had two files with the same permissions I could cut and paste and go from one to the other to get back to just one I can do control X1 and I have only this but if I really wanted the other window I could can hit control XB and I'm back in the password file if I want to rewrite it uh I can hit control xw contr X control W and that would let me write it as a different name so I'll say p WD revised and it's there if I want to terminate the program I sayr XS to make sure things have been saved and then controll XC and I'm done so you can see we used the control key quite a bit in neac the position most keyboards put it in these days is a little unnatural all the way at the bottom left or right so veteran emac users tend to remap the keyboard so that the caps lock key also works as control so that's some of the basic operations you would do in day-to-day use of emac you have completed chapter 11 let's summarize the key Concepts covered text editors rather than word processing programs are used quite often in Linux for tasks such as creating or modifying system configuration files writing scripts developing sour code and more Nano is an easyto use text based editor that utilizes onscreen prompts gedit is a graphical editor very similar to notepad and windows the vi editor is available on all Linux systems and is very widely used graphical extension versions of VI are widely available as well emac is available on all Linux systems as a popular alternative to VI emac can support both a graphical user interface and a text mode interface to access the vi tutorial typee Vim tutor at a command line window to access the emac tutorial typ contrl H in then T from within emac VI has three modes command insert and line emac has only one but requires use of special keys such as control and Escape both editors use various combinations of key strokes to accomplish tasks the learning curve to master these can be long but once mastered using either editor is extremely efficient by the end of this chapter you should be able to use and configure user accounts and user groups use and set environment variables use the previous shell command history use keyboard shortcuts use and Define aliases use and set file permissions and ownership as you know Linux is a multi-user operating system meaning more than one user can log on at the same time to identify the current user type who am I to list the currently logged on users type who giving who the- a option will give more detailed information in Linux the command shell program generally bash uses one or more startup files to configure the user environment files in the /c directory define global settings for all users while initialization files in the user's home directory can include and or override the global settings the startup files can do anything the user would like to do in every command shell such as customizing The Prompt defining command line shortcuts and aliases setting the default text editor setting the path for where to find executable Pro or setting the path for where to find executable programs the standard prescription is that when you first log into Linux /c/ profile is read and evaluated after which the following files are searched if they exist in this order bash profile bash loginprofile where the squiggly line/ do denotes the user's home directory the Linux login shell evaluates whatever startup file that it comes across first and ignores the rest this means that if it finds bash profile it ignores bash login and profile different distributions may use different startup files however every time you create a new shell or terminal window you do not have to perform a full system login only a file name bashrc file is read and evaluated although this file is not read in evaluated along with the login shell most distributions and or users include the bashrc file from within one of the three user owned startup files most commonly users only fiddle with the bash RC as it is it is invoked every time a new command line shell initiates or another program is launched from a terminal window while the other files are read and executed only when the user first logs on to the system recent distributions sometimes do not even have bash profile and or bash login and some just do little more than include bash RC you can create customized commands or modify the behavior of already existing ones by creating aliases most often these aliases are placed in your bash RC file so they're available to any command shell you create on Alias removes an alias typ tying Alias with no argument will list currently defined aliases please note that there should not be any spaces on either side of the equal sign and the Alias definition needs to be placed within either single or double quotes if it contains any spaces all Linux users are assigned a unique user ID uid which is just an integer normal users start with a uid of 1,000 or greater Linux uses groups for organizing users groups are collections of accounts with certain shared permissions control of group membership is administered through the slcg group file which shows a list of groups and their members by default every user belongs to a default or primary group when a user logs in the group membership is set for their primary group and all the members enjoy the same level of access and privilege permissions on various files and directories can be modified as the group level users also have one or more group IDs GID including a default one which is the same as the user ID these numbers are associated with names through the files SLC password and slcg group groups are used to establish a set of users who have common interests for the purpose of access rights Privileges and security considerations access rights to files and devices are granted on the basis of the user and the group they belong to distributions have straightforward graphical interfaces for creating and removing users and groups and manipulating group membership however it's often useful to do it from the command line or from within shell scripts only the root user can add and remove users and groups adding a new user is done with user ad and removing an existing user is done with user Dell and the simplest form and account for the new user BJ moose would be done with pseudo user ad BJ moose which by default sets the home directory to slome BJ moose populates it with some basic files copied from SLC skll and adds a line to the SLC password such as this and sets the default shell to /bin/bash removing a user account is as easy as typing user Dell BJ moose however this will leave slh home/ BJ moous directory intact this might be useful if it's a temporary inactivation to remove the home directory while removing the account one needs to use the- R option to user Dell typing ID with no arguments gives gives information about the current user as in this ID if given the name of another user as an argument ID will report information about that other user let's get some experience with creating modifying and removing a new user account we will do this on Ubuntu 1704 there are some variations between distributions about what exactly is created when a new account is is created and exactly which files are there Etc this is mostly controlled by a file under Etc default user ad appropriately named so you can see for example in here here the default shell is set to be Shell bsh B bsh now on some distributions such as red hat this file is rather short and not very well documented on auntu it's rather long so let's create the account so Su do uh user ad and I'll say- M to make sure it creates a home directory some uh some distributions do not do that by default two does not for instance and neither does open Su I'll give the full name to be Eric dolphy I'll specify the default shell to be bin bash with the S option and here's the name e d o l p y e DOI now I still have to pass a specify a password so I'll do that with s do pass wde e d o l py and then I type something and now the accounts exists and I can verify that by making sure entries were made uh in the ETC password file and Etc group and there we go notice it is now user 1001 remember normal user start at 1,000 and student is user 1000 and so that's appropriate and also the other information I specified is there such as the full username and the shell bin bash and the group is set to be 101 which is the same ID as the user all users are created with at least one group that has the same number as their username now let's actually try to log into that account and I'll do that with SSH and e d o l py at Local Host and I'll give the password and I succeeded just fine so let's see what's actually in that directory and you'll see there isn't much but these are files that all new users get um and let me log out now and that's controlled by whatever is in the ETC skel directory anything you put in there let me uh do the a option anything you put in there will show up in any new users uh account so let's just clean up and I'll do that with user d-r uh e doy and the r is necessary to make sure removes the home directory you know I get a warning message about uh not having created a m spool file that's harmless and if we do LSL on home now we see the account is gone so we're all cleaned up adding a new group is done with group AD so you can use pseudo usergroup add a new group the group can be removed with studo userin group Dell a new group adding a user to an already existing group is done with user mod for example when you would first look at what groups the user already belongs to and then add the new group pseudo userin user- a-g a new group rjs squirrel RJ squirrel and then groups RJ squirrel will show the new group these utilities update the /c/ group as necessary make sure you use the- a option for aend so as to avoid removing r existing groups group mod can be used to change group properties such as the group ID with the dasg option or name with the with the dash in option removing a user from the group is somewhat trickier the dasg option to user mod must give a complete list of groups thus if you do pseudo user sbin ususer mod DG RJ squirrel RJ squirrel and then do groups RJ squirrel you'll see that only the RJ squirrel group will be left the root account is very powerful and has full access to the system other operating systems often call this the administrator account in Linux it's often called the super user account you must be extremely cautious before granting full rot access to a user it's rarely if ever Justified external attacks often consists of tricks used to elevate the root account however you can use pseudo to assign more limited privileges to user accounts but only do it on a temporary basis and only for a specific subset of commands when assigning elevated privileges you can use the command Su the switch or substitute user to launch a new shelf running as another user you must type the password of the user you are becoming most often this user is root and the new shell allows the use of elevated privileges until it's until it is exited it's almost always a bad practice to use S Su to become root resulting errors can include deletion of vital files from the system and security breaches granting privileges using pseudo is less dangerous and is preferred by default studo must be enabled on a per user basis however some distributions such as BTU enable it by default for at least one main user or give this as an installation option to temporarily become the super user for a series of commands you can type Su and then be prompted for the root password to execute just one command with root privileges type pseudo and then the command when the command is complete you will return to being a normal un privileged user pseudo configuration files are stored in the /c/ pseudo file and in the SLC sudoers DOD directory by default the pseudo s.d directory is empty and whenever you talk about pseudo in a course or article you're basically required to show this web comic by XKCD and environment variables are quantities that have specific values which may be utilized by the command shell such as bash or other utilities and applications some environment variables are given preset values by the system which can usually be overridden While others are set directly by the user either at the command line or within startup and other scripts an environment variable is actually just a character string that contains information used by one or more applications there are a number of ways to view the values of currently set environment variables one can type set EMV or export depending on the state of your system set May print out many more lines than the other two methods by default variables created within a script are only available to the current shell child processes subshells will not have access to values that have been set or modified allowing child processes to see the values requires use of the export command you can also set environment variables to be fed as a one shot to a command as in the following this feeds the values of the S dur and kroot environment variables to the command make modules install home is an environment variable that represents the home or login directory of the user CD without arguments will change the current working directory to the value of Home note the ti character is often used as an abbreviation for home thus CD home and CD with utility are completely equivalent statements path is an ordered list of directories the path which is scanned when a command is given to find the appropriate program or script to run each directory in the path is separated by colons a null or empty directory name or slash indicates the current directory at any given time so in this example there is a null directory before the first call similarly for this there is a null directory between path 1 and path 2 to prefix a private bin directory to to your path you can use this command the environment variable shell points to the user's default command shell the program that is handling whatever you type in a command window usually bash and it contains the Full path name to the Shell prompt statement or Ps is used to customize your prompt string in your terminal Windows to display the information you want PS1 is the primary prompt variable which controls what your command line prompt looks like the following special characters can be included in PS1 they must be surrounded in in single quotes when they are used as in this example bash keeps track of previously entered commands and statements in a history buffer you can recall previously used commands simply by using the up and down cursor keys to view the list of previously executed commands you can just type history at the command line this list of commands is displayed with the most recent command appearing last in the list this information is stored in the sl- bash history if you have multiple terminals open the commands typed in each session are not saved until the session terminates several Associated environment variables can be used to get information about the history pile his file is the location of the history file his file size is the maximum number of lines in the history file default 500 his size is the maximum number of commands in the history file hist control is how commands are stored hist ignore is which which command lines can be unsaved for a complete description of the the use of these environment variables see the man page and Bash there are specific keys to per perform various tasks if you want to recall a command in the history list but do not want to press the arrow key repeatedly you can press controlr to do a reverse intelligent search as you start typing the search goes back in reverse order to the First Command that matches the letters you have typed by typing more successive letters you make the match more and more specific you can use keyboard shortcuts to perform different tasks quick quickly this table lists some of these keyboard shortcuts and their uses note the case of the hot key does not matter meaning doing control a is the same as doing control capital A in Linux and other Unix Bas operating systems every file is associated with a user who is the owner every file is also associated with a group a subset of all users which has an interest in the file and certain rights or permissions read write and execute the following utility programs involve user and group ownership and permission settings files have three kinds of permissions read write and execute these are generally represented as rwx these permissions affect the three groups of owners owner user owner group and others as a result you have the following three groups of three permissions there are a number of different ways to use CH mod for instance to give the owner and others execute permission and remove the group write permission you can do this where the U stands for user or owner o stands for other world and G stands for group this kind of syntax can be difficult to type and remember so what often uses a short hand which lets you set all the permissions in one step this is done with a simple algorithm and a single digit suffices to specify all three permission bits for each entity this digit is the sum of four if read permission is desired two if write permission is desired one if execute permission is is desired so seven means read write execute six means read write five means read execute when you apply this to the the chod command you have to give three digits for each degree of Freedom such as chod 755 Su file now let's see an example of changing file ownership using CH own as shown in this screenshot first we create two empty files using touch notice it requires pseudo to change the owner of file 2 to rout the second CH own command changes both owner and group at the same time finally only the super user can remove the files now let's see an example of changing the group ownership using chgrp you have completed chapter 12 let's summarize the key Concepts covered Linux is a multi user system to find the currently logged on users you can use the who command to find the current user ID you can use the who am I command the root account has full access to the system it's never sensible to Grant full root access to a user you can assign root privileges to regular user accounts on a temporary basis using the pseudo command the shell program or bash uses multiple startup files to create the user environment each file affects the interactive environment in a different way /c/ profile provides the global settings advantages of startup files include that they customize the user's prompt set the user's terminal type set the command line shortcuts and aliases and set the default text editor an environment variable is a character string that contains data used by one or more applications the built-in shell variables can be customized to suit your requirements the history command recalls a list of previous commands which can be edited and recycled in Linux various keyboard shortcuts can be used at the command prompt instead of long actual commands you can customize commands by creating aliases adding an alias to the sl. bashrc file will make it available for other shells file permissions can be changed by typing chod permission in the file name file ownership is changed by typing CH own then the owner and the file name file group ownership is changed by typing chgrp then the group then the file name by the end of this chapter you should be able to display and append to file contents using cat and Echo edit and print file content contents using SED and awk search for patterns using GP use multiple other utilities for file and text manipulation irrespective of the role you play with Linux such as system administrator developer or user you often need to browse through and parse text files Andor extract data from them these are file manipulation operations thus it's essential for the Linux user to become Adept at performing certain operations on files most of the time such file manipulation is done at the command line which allows users to perform tasks more efficiently than while using a guey furthermore the command line is more suitable for automating often executed tasks indeed experienced system administrators write customized scripts to accomplish such repetitive tasks standardized for each particular environment we'll discuss such scripting later in much detail in this section we'll concentrate on command line file and text manipulation related U utilities cat is short for concatenate and is one of the most frequently used Linux command line utilities it's often used to read and print files as well as for simply viewing file contents to view a file use the following command cat and then the file name for example cat readme.txt will display the contents of readme.txt on the terminal however the main purpose of cat is often to combine or concatenate multiple files together you can perform the actions listed in this table using cat the TCH command or cat spelled backwards prints the lines of a file in reverse order each line Remains the Same but the order of lines is inverted the syntax of TAC is exactly the same as for cat as in the following cat can be used to read from standard input such as the terminal window if no files are specified you can use the greater than operator to create and add new lines to the file and the double greater than operator to append lines or files to an existing file to create a new file at the command prompt type cat greater than file name and press the enter key this command creates a new file and waits for the user to edit or enter the text after you finish typing the required text press contrl D at the beginning of the next line to save and exit the editing let's demonstrate some of the basic operations you can performed with the cat utility where the word cat stands for concatenate it's typically used to copy files combine them Etc so first we will need a couple of simple text files to play with let's create one using a text editor let's say Nano so Nano file one. text and I will just type in a couple of lines actually three lines with a PL one at the end I hit contr X for exit I say yes I want to save the modified buffer and I keep the name so now I can look at the the file created with cat so do cat file what. text perfect now let's create another one interactively using cat itself as we talked about earlier so I can say cat in Direction with eof and I'll put it into file 2. text and here is a second file with a few lines and then I just type eof on a line and that closes the input phase and I can say c for l2. text it's there if I want to see them both together I can say C file one. text file 2. text I see it combined or I could send it into a third file file 3. text and then clear the screen I can say cat file 3. text and I see they combined two files in a third file so this is how we use CAD it's an everyday operation you rarely do anything that much more complicated with it system administrators need to work with configuration files text files documentation files and log files some of these files may be larger or become quite large as they accumulate data with time these files will require both viewing and administrative updating in this section you will learn how to manage such large files for example a banking system might maintain one simple large log file to record details of all of One day's ATM transactions due to a security attack or a malfunction the administrator might be forced to check for some data by navigating within the file in such cases directly opening the file in an editor will cause issues due to high memory utilization as an editor will usually try to read the whole file into memory first however one can use less to view the contents of such a large file scrolling up and down Page by Page without the system having to place the entire file in memory before starting this is much faster than using a text editor viewing some file can be done by typing either of the two following commands less sum file or cat Su file pipe less by default Man pages are sent through the less command you may have encountered the older more utility which has some basic functionality but fewer capabilities I.E less is more head reads the first few lines of each named file Tim by default and displays it on standard output you can give a different number of lines in an option for example if you want to print the first five lines from Etc default scrub we can use this command head- in and then Etc deault scrub you can also just do this head- 5 Etc deault scrub tail prints the last few lines of each named file and displays it on standard output by default it's it displays the last 10 lines you can give a different number of lines as an option tail is especially useful when you are troubleshooting any issue using log files as you probably want to see the most recent lines of output for example to display the last 15 lines of some file. log we can use this command tail DN 15 some file that log you can also just do this tail -15 some file. log to continually monitor new output in a growing log file we can do tail-f su file. log this command will continuously display any new lines of output in some file. log as soon as they appear thus it enables you to monitor any current activity that is being reported and recorded it's very common to create and then repeatedly edit and or extract contents from a file let's learn how to use S and awk to easily perform such operations note that many Linux users and administrators will write scripts using comprehensive scripting languages such as Python and pearl rather than use S and awk and some of other utilities we'll discuss later using such utilities is certainly fine in most circumstances once should always feel free to use the tools one is experienced with however the utilities that are described here are much lighter I.E they use fewer system resources and execute faster there are situations such as during booting the system where a lot of time would be wasted using the more complicated tools and the system may not even be able to run them so the simpler tools will always be needed SD is a powerful text processing tool and is one of the oldest earliest and most powerful Unix utilities it's used to modify the contents of a file or input stream usually placing the contents into a new file or output stream its name is is an abbreviation for stream editor said s can filter text as well as perform substitutions in data streams data from an input source or file is taken and moved to a working space the entire list of operations or modifications is applied over the data in the working space and then final contents are moved to the standard output space or stream you can invoke set or SED using commands like those listed in this table the- e option allows you to specify multiple editing commands simultaneously at the command line it's unnecessary if you only have one operation invoked now that you know that you can perform multiple editing and filtering operations with said let's explain some of them in more detail the table explains some basic operations where pattern is the current string and replace uncore string is the new string let's demonstrate some of the most Elementary operations you can perform with SCD on a fedora system so I have taken the Liberty to prepare a simple text file uh before we start which looks like this cat INF file. text it just says three lines indicating their presence suppose I do sd- e slash and then uh let's say is to r on the file and the output will go right on standard out and you see it changed only the first instance on every line so I even have the instead of this um I can make a slight modification to the command if I put a g at the end of it and you see this time it caught every instance I could also do something like this uh 1 comma 2s and it only did it on the first and the second line but it left the third line alone you notice that I don't have to use a forward slash I can use many other characters so here I'll use a colon and it makes no difference what I use now there is an option for S to change character streams in place on the original file but it's a pretty dangerous operation to do since you destroy the original file so generally it's better to send the output into another file so I'll do I'll call that one out file. text oh I forgot to say INF file. text for input so it hung so now I can look at out file. text you see and that's the output and if I want to use the diff command to see the difference I can do something like this diff INF file. text L file. text and it shows me the two lines that have changed now you can do some pretty complicated things with SD when you're trying to deal with special characters including spaces and question marks and stars life being get pretty complicated it it is it respects everything in the world about what are called regular Expressions uh which can look rather strange but it's a daily tool that system min administrators do to make Elementary substitutions and files so that's a little bit about s awk a is used to extract and then print specific contents of a file is often used to construct reports it was created at Babs in the 1970s and derived its name from the last names of its authors o has the following features it's a powerful utility and interpreted programming language it's used to manipulate data fil and for retrieving and processing text it works well with Fields containing a single piece of data essentially a column and Records a collection of fields essentially a line in a file a is invoked as shown in this example as was said short o commands can be specified directly at the command line but a more complex script can be saved in a file that you can specify using the- F option the this table explains the basic tasks that can be performed using a the input file is read one line at a time and for each line o matches the given pattern in the given order and performs the requested action the- F option allows you to specify a particular field separator character for example the /c/ password file uses a colon to separate the fields so the- F colon option is used with the SLC password file the command or action in a needs to be surrounded with apostrophes or single quotes o can be used like the following like in this example in managing your files you may need to perform tasks such as sorting data and copying data from one location to another Linux provides numerous file manipulation utilities that you can use while working with text files in this section you will learn about the following file manipulation programs sort unique paste join and split you also learn about regular expressions and search patterns sort is used to rearrange the lines of a text file in either ascending or descending order according to a sort key you can also sort with respect to particular fields or columns in a file the default sort key is the order of the asky characters I.E essentially alphabetically sort can be used like this when used with the dasu option sort checks for Unique values after sorting the records or lines it's basically equivalent to running unique on the output of sort unique removes duplicate consecutive lines in a text file and it's useful for simplifying the text display because unique requires that the duplicate entries must be consecutive one often runs sort for first and then pipes output into unique if sort is used with the dasu option it can do all this in one step to remove duplicate entries from multiple files at once use this command or you can use do this one to count the number of duplicate entries use this command suppose you have a file that contains the full name of all employees and another file that list their phone numbers and employee IDs you want to create a new file that contains all the data listed in three columns name employee ID and phone number how can you do this effectively without investing too much time Paste can be used to create a single file containing all three columns the different columns are identified based on delimiters which is spacing used to separate two fields for example delimiters can be BL a blank space a tab or an enter in this image a single space is used as a delimiter in all files paste accepts the following options- D for the delimiters which specify a list of delimeters to be used instead of tabs for separating consecutive values on a single line each delimiter is used in turn when the list has been exhausted Pace begins again at the first delimiter d s which causes Pace to appin the data in series rather than in parallel that is in a horizontal rather than vertical fashion Pace can be used to combine Fields such as name or phone number from different files as well as combin lines from multiple files for example line one from file one can be combined with line one of file two and line two from file one can be combined with line two of file two and so on to paste contents from two files one can do this and here's the syntax to use a different delimiter common delimiters are space Tab and comma suppose you have two files with with similar columns you have saved employees phone numbers in two files one with the first name and the other with their last name you want to combine the files without repeating the data of common columns how do you achieve this this task can be achieved using join which is essentially an enhanced version of paste it first checks whether the files share common fields such as names or phone numbers and then joins the lines into files based on a common field to combine two files on a common field at the common prompt type join file one file two and press the enter key for example the common field I.E it contains the same values among the phone book and cities files is the phone number and the result of joining these two files is shown here split is used to break up or split a file into equal siiz segments for easier viewing and manipulation and it's generally used only on relatively large files by default split breaks up a file into 1,000 line segments the original file remains unchanged and a set of new files with the same name plus added prefix is created by default the X prefix is added to split a file into segments use the command split in file to split a file into segments using a different prefix use the command split in file and then the prefix we will apply split to an American English dictionary file of over 999,000 lines and in this example we've used WC which stands for word count that we'll discuss shortly to report on the number of lines in the file and then you just type this this will split the American English file into 100 equal siiz segments named dictionary XX the last one will of course be somewhat smaller regular expressions are text strings used for matching a specific pattern or to search for a specific location such as the start or end of a line or a word regular Expressions can contain both normal characters or so-called medic characters such as an aster or and then and a dollar sign many text editors and utilities such as VI said o find and grep work extensively with regular Expressions this table lists the search patterns and their usage for example consider the following sentence the quick brown fox jumped over the lazy dog some of the patterns that can be applied to the sentence are shown here GP is extensively used as a primary text searching tool it scans files for specified patterns and it can be used with regular Expressions as as well as simple strings as shown in this table strings is used to extract all printable character strings found in a file or files given as arguments it's useful in locating human readable content embedded in binary files for text files one can just use GP for example to search for the string mycore string in a spreadsheet you can use this command and this screenshot shows a search of a number of programs to see which ones have GPL licenses of various versions in this section you will learn about some additional text utilities that you can use for performing various actions on your Linux files such as changing the case of letters or determining the count of words lines and characters in a file the TR utility ised used to translate specified characters into other characters or to delete them the general syntax is as follows TR options set one and set two the items in the square brackets are optional TR requires at least one argument and accepts a maximum of two the first designated set one in this example list the characters in the text to be replaced or removed the second set two list the characters that are to be substituted for the characters listed in the first argument sometimes these sets need to be surrounded by apostrophes or single quotes in order to have the shell ignore that they mean something special to the Shell it's usually safe and may be required to use the single quotes around each of the sets as you'll see in these examples uh for example suppose you have a file named City containing several lines of a text in mixed case to translate all lowercase characters to uppercase at the command prompt type cat City pipe TR A- Z A-Z and press enter key T takes the output from any command and while sending to the standard output it also saves it in a file in other words it T's the output stream from the command one stream is displayed on the standard output and the other is saved to a file for example to list the contents of a directory on the screen and save the output to a file at the command prompt type ls- lpip T new file and press enter key typing cat new file will then display the output of ls-- L WC or word count counts the number of lines words and characters in a file or a list of files opt are given in this table by default all three of these options are active cut is used for manipulating column based files and is designed to extract specific columns the default column separator is the tab character different Eliminator can be given as a command option for example to display the third column eliminated by a blank space at the command prompt Type ls- S pipe cut d d double quot space double quote then- F3 and then you press the enter key you have completed chapter 13 let's summarize the key Concepts covered the command line often allows the users to perform tasks more efficiently than the guey cat short for concatenate is used to read print and combined files Echo displays a line of text either on standard output or to place in a file said is a popular stream editor often used to filter and perform substitutions on files and Text data streams o is an interpretive programming language typically used as a data extraction and reporting tool sort is used to sort text files and output streams in either ascending or descending order unique eliminates duplicate entries in a text file paste combines fields from different files it can also extract and combine line from multiple sources join combines lines from two files based on a common field it works only if files share a common field split breaks up a large file into equal siiz segments regular expressions are text strings used for pattern matching the pattern can be used to search for a specific location such as the start or end of a line or a word grep searches the text files and data streams for patterns and can be used with regular Expressions TR translates characters copy standard input to standard output and handles special characters T saves a copy of standard output to a file while still displaying at the terminal WC for word count displays the number of lines words and characters in a file or group of files cut extracts columns from a file less views files a page at a time and allows scrolling in both directions head displays the first few few lines of a file or data stream or standard standard output by default it displays 10 lines pil displays the last few lines of a file or data stream on standard output by default it displays 10 lines strings extracts printable character strings from binary files by the end of this chapter you should be able to explain basic networking Concepts including types of networks and addressing issues configure Network interace faes and us and use basic networking utilities such as if config IP ping route and trace route use graphical and non-graphical browsers such as links w3m Firefox Chrome and Epiphany transfer files to and from clients and servers using both graphical and text mode applications such as filezilla FTP SFTP curl and wget a network is a group of computers and Computing devices connected together through communication channels such as cables or wireless media the computers connected over a network may be located in the same geographical area or spread across the world a network is used to allow the connected devices to communicate with each other enable multiple users to share devices over the network such as music and video servers printers and scanners share and manage information AC cross computers easily most organizations have both an internal Network and an internet connection for users to communicate with machines and people outside the organization the internet is the largest Network in the world and can be called the network of networks devices attached to a network must have at least one unique Network address identifier known as the IP or Internet Protocol address the address is essential for routing packets of information through the network exchanging information across the network requires using streams of small packets Each of which contains a piece of the information going from one machine to another these packets contain data buffers together with headers which contain information about where the packet is going to and coming from and where it fits in the sequence of packets that constitute the Stream Network Protocols are and software are rather complicated due to the diversity of machines and operating systems they must deal with as well as the fact that even very old standards must be supported there are two different types of IP addresses available IP V4 version 4 and IPv6 version 6 ipv4 is older and by far the most widely used while IPv6 is newer and is designed to get past limitations inherent in the older standard and furnish many more possible addresses ip4 uses 32 bits for addresses there are only 4.3 billion unique addresses available furthermore many addresses are allotted in resered but not actually used ipv4 is considered inadequate for meeting future needs because the number of devices available on the global network has increased enormously in recent years IPv6 uses 128 bits for addresses this allows for 3.4 time 10 to the power of 38 unique addresses if you have a larger network of computers and want to add more you may want to move to IPv6 because it provides more unique addresses however it can be complex to migrate to IPv6 the two protocols do not always interoperate well thus moving equipment and addresses to IPv6 require significant effort and has not been quite as fast as was originally intended we'll discuss ipv V4 more than IPv6 as you're more likely to deal with it one reason ipv4 has not disappeared is there are ways to effectively make many more addresses available by methods such as natat the network address translation natat enables sharing one IP address among many locally connected computers Each of which has a unique address only seen on the local network while this is used in organizational settings it's also used in simple home networks for example if you have a router hooked up to your internet provider such as a cable system it gives you one externally visible address but issues each device in your home an individual local address a 32-bit ipv4 address is divided into four 8bit sections called octets so here's an example note that octet is just another word for bite Network addresses are divided into five classes a b c d and e classes a B and C are classified into two parts Network addresses net ID and host address host ID the net ID is used to identify the network while the host ID is used to identify a host in the network class D is used for special multicast applications information is broadcast to multiple computers simultaneously and Class E is reserved for future use in this section you will learn about classes a b and c Class A addresses use the first octet of an IP address as their net ID and use the other three octets as their host ID the first bit of the first octet is always set to zero so you can only use seven bits for Unique Network numbers as a result there are a maximum of 126 Class A networks available not surprisingly this was only feasible when there were very few unique networks with large numbers of hosts as the use of the internet expanded classes B and C were added in order to accommodate the growing the growing demand for independent networks each class a network can have up to 16.7 million unique hosts on its Network the range of host addresses is from 1.0.0 point0 to 12725 5. 255.255 class B addresses use the first two octets of their IP address as their net ID and the last two octets as their host ID the first two bits of the first octet are always set to Binary 10 so there are a maximum of 16,384 Class B networks the first octet of a Class B address has values from 128 to 191 the introduction of Class B networks expanded the number of networks but but it soon became clear that a further level would be needed each class B Network can support a maximum of 65,536 unique hosts on its Network the range of host addresses is from 128.0 z.0 to 19125 255.255 Class C addresses use the first three octets of the IP address as their net ID in the last OCTA as their host ID the first three bits of the first OCTA are set to Binary 110 so so almost 2.1 million Class C networks are available the first OCTA of a Class C address has values from 19 192 to 223 these are most common for smaller networks which don't have many unique hosts each class seed Network can support up to 256 unique hosts the range of host addresses is from n2.0 z.0 to 223 typically a range of IP addresses are requested from your internet service provider your ISP by your organization's network administrator often your choice of which class of IP address you are given depends on the size of your network and expected growth needs if natat is an operation such as in a home network you only get one externally visible address you can assign IP addresses to computers over a network either manually or dynamically manual assignment adds static or never-changing addresses to the network dynamically assigned addresses can change every time you reboot or even more often the dynamic host C configuration protocol DHCP is used to assign IP addresses name resolution is used to convert numerical IP address values into a human readable format known as the host name for example 104.9 58515 is the numerical IP address that refers to the host name white house.gov host names are much easier to remember given an IP address you can obtain its corresponding host name accessing the machine over the network becomes easier when you can type the host name instead of the IP address you can view your system's host name simply by typing host name with no argument the special host name Local Host is associated with the address 127.0.0.1 and describes the machine you are currently on which normally has additional Network related IP addresses let's get a feel for how the domain name server works on a recent Ubuntu system so first we need to log in and when you log in we'll open up a command line terminal because uh we're going to do all our operations from the command line so I have done that by right clicking on the desktop and then let me make a bigger font I might as well go full screen while I'm at it so there are a couple of important files on your system one is called Etc resolve. now on older Linux systems you didn't have all this information at the top you just had an important thing here name server 127 0.053 you more likely to find your name server is not a 1271 which all 127 addresses are on the actual machine but 1 192168 that1 that1 for instance would be a common thing um might point to your your wireless modem which is attached to your internet service provider for instance uh recent systems use a system D service called system D resolve d which works in a more complicated way it makes a DNS server on the local machine uh which caches the results of previous searches uh so we're not going to get into the details of that but uh that's a recent development that you'll find on newer machines another important file is ETC hosts this file is consulted before the domain name server is consulted so you'll see for instance here at the bottom we've got two machines on the local network we give their IP addresses and a name that we can use to get it them and you'll notice you can have more than one name tied to an IP address so for instance I could do ping Theodore and that's going to take me to 200 or I could do ping uh Beaver takes me to the same machine now if I want to look at something which isn't specified in in that file or in fact I can do that host uh Theodore and I will go look at the file but if I want to get something out on the internet I could do L Linux foundation.org and I'll get the both the ip4 and the ip6 addresses here of the Linux foundation and also information about the mail services provided by the Linux Foundation I can do uh another utility for similar information is nslookup so I'll do that nslookup foundation.org links foundation.org and you see I got the same basic information a little more compactly I got here's the ip4 address and then the two ip6 addresses another utility I can use is dig so let's do dig Linux foundation.org and you'll see I once again got the information about the IP address and then a lot more information about the search to find that server so that's just a little bit of what you can do with DNS and some of the files that are associated with it network configuration files are essential to ensure that interfaces function correctly they're located in the /etc directory tree however the exact files used have historically been dependent on the particular Linux distribution ution and version being used for dbn family configurations the basic network configuration files could be found under slcn Network while for red hat and Susi family systems one needed to inspect /c/ CYS config Network modern systems emphasize the use of network manager which we briefly discuss when we considered graphical system administration rather than keep up with all the files in/ Etc while the graphical versions of network manager do look somewhat different in different distributions the nmtui utility shown here varies almost not at all as does even more sparse NM CLI or command line interface utility if you are proficient in the use of goys by all means use them if you're working on a variety of systems the lower level utilities may make life easier network interfaces are a connection Channel between a device and a network physically network interfaces can proceed through a network interface card or it can be more abstractly implemented as software you can have multiple network interfaces operating at once specific interfaces can be brought up or activated or brought down deactivated at any time information about a particular network interface or all network interfaces can be reported by the IP and if config utilities which you may have to run as the super user or at least give the full path name I.E SLS spin if config IP is newer than if config and has far more capabilities but its output is uglier to the human eye some new Linux distributions do not install the older net tools package to which if config belongs and so you would have to install it if you want to use it to view the IP address you can do this SLS spin I address show to view the routing information slin I rout show IP is a very powerful program that can do many things older and more specific utilities such as if config and Route are often used to accomplish similar tasks a look at the relevant Man pages can tell you much more about these utilities ping is used to check whether or not a machine attached to the network can receive and send data I.E it confirms that the remote host is online and is responding to check the status of the remote host at the command prompt type ping and then the host name ping is frequently used for Network testing and management however its usage can increase Network load unacceptably hence you can abort the execution of ping by typing control C or by using the- C option which limits the number of packets that ping will send before it quits when when an execution stops a summary is displayed a network requires the connection of many nodes data moves from source to destination by passing through a series of routers and potentially across multiple networks servers maintain routing tables containing the addresses of each node in the network the IP routing protocols enable routers to build up a forwarding table that correlates final destinations with the next hop addresses one can use the route utility or the newer IP route command to view or change IP routing table to add delete or modify specific static routes to specific hosts or networks this table explains some commands that can be used to manage IP routing trace route is used to inspect the route which the data package it takes to reach the destination host which makes it quite useful for troubleshooting Network delays and errors by using trace route you can isolate connectivity issues between hops which helps resolve them faster to print the route taken by the packet to reach the network host at the command prompt type trace route and then the address now let's learn about some additional networking tools networking tool tools are very useful for monitoring and debugging network problems such as network connectivity and network traffic let's get started on using more networking tools to use more networking tools open the command prompt to query network interface connected to eth2 type pseudo eth tool eth0 and press enter to display all active connections and routing tables type netstat - R and press enter all active connections and routing tables are displayed to scan open ports on a network type pseudo nmap DSP 10.0.2 do15 sl24 and press enter the open ports on a network are displayed browsers are used to retrieve transmit and explore information resources usually on the worldwide web Linux users commonly use both graphical and non-graphical browser applications the common graphical browsers used in Linux are Firefox Google Chrome chromium coner and Opera sometimes you either do not have a graphical environment to work in or have reason not to use it but still need to access web resources in such a case you can use non-graphical browsers such as these sometimes you need to download files and information but a browser is not the best choice either because you want to download multiple files or you want to perform the action from a command line or a script WG is a command line utility that can capably handle the following types of downloads large file downloads recursive downloads where a web page refers to other web pages and all are downloaded at once password required downloads and multiple file downloads to download a web page you simply type WG and then the URL and then you can read the downloaded page as a local file using a graphical or non-graphical browser besides downloading you may want to obtain information about a URL such as the source code being used curl can be used from the command line or a script to read such information curl also allows you to save the contents of a web page to a file as does wget you can read a URL using curl URL for example if you want to read freecodecamp.org type curl HTP freecodecamp.org it to get the contents of a web page and store it to a file type curl SL o save HTML and then the website address the contents of the main index file at the website will be saved in save. HTML secure shell SSH is a cryptographic network protocol used for secure data communication it's also used for remote services and other secure Services between two devices on the network and is very useful for administering systems which are not easily available to physically work on but to which you have remote access to log in a remote system using your same username you can just type SSH some system and press enter SSH then prompts you for the remote password you can also configure SSH to securely allow your remote access without typing a password each time if you want to run as another user you can do either s-l someone some system or SSH someone at some system to run a command on a remote system via SSH at the command primed you type SSH some system my command we can also move file securely using secure copy SCP between two networked hosts SCP uses the SSH protocol for transferring data to copy a local file to a remote system at the command prompt type STP then the local file and then the user at the remote system cl/ hom user and then you press enter you will receive a prompt for the remote password you can also configure SCP so that it does not prompt for a password for each transfer let's do a simple demonstration of using secure shell and secure copy between two virtual machines uh Ubuntu machine and a cnos machine so first from the Ubuntu machine let's try to log into the Centos machine well first I need to know the IP address of both machines so I can do that with IP and I'll say brief to get a condensed output um addr for address show and I can see my address on this machine is 17216 249 133 I'll do the same command on this Centos machine and you see the address is the same except for the last bite or octed which is 129 so first let's log into the C West machine from obuntu I do SSH student at 17216 24929 and it's the first time I'm doing this so it wants to make sure that I'm authentic so I say yes and now I have to give the password and it's fine I'm on the Centos machine as you can see from The Prompt now in that command I really didn't have to give student that because we're using student count on both machines but never hurts to do that so let me exit now let's do from the SOS machine Let's copy over directory using SCP over to the iunu machine so let me do SCP R for recursive to get the whole directory and everything underneath it uh and this time uh I won't see home student I'll copy the home student directory I won't bother saying student ad I'll just give the address 17216 24913 3 and I'll put it in the temp directory once again it wants to make sure that it's authentic so I'll say yes and once again I have to give the password and it's copied over and if I go over to the Ubuntu machine and I look in the temp directory oh see the account is now there the directory is now there so that's all there is to do a pretty simple demonstration of using secure shell and secure copy you have completed chapter 14 let's summarize the key Concepts covered the IP or Internet Protocol address is a unique logical Network address that is assigned to a device on a network ipv4 uses 32 bits for addresses and IPv6 uses 128 bits for addresses every IP address contains both a network and a host address field there are five classes of network addresses available a b c d and e DNS domain name system is used for converting Internet domain and host names to IP addresses the if config program is used to display current Active network interfaces the commands IP addr show and IP route show can be used to view IP addresses and routing information you can use ping to check if the remote host is alive and responding you can use the route utility program to manage IP routing you can monitor and debug networking problems using networking tools Firefox Google Chrome chromium and Epiphany are the main graphical browsers used in Linux non-graphical or text browsers used in Linux are links links and w3m you can use WG to download web pages you can use Curl to obtain information about URLs you can use SSH to run commands on remote systems we've reached the end of the course you should now have a good working knowledge of Linux from both a graphical and command line perspective I mentioned at the beginning of the course that there is a text based version of this course Linked In the video's description that version also has sections about the bass shell and scripting Printing and local security principles those won't be relevant to everybody but feel free to check that out if you want to learn about those topics so good luck as you use and administer Linuxwelcome to this introduction to Linux course I'm Bo K and I will be teaching this course this course is designed for computer users who have limited or no previous exposure to Linux whether they're working in an individual or Enterprise environment this course explores the various tools and techniques commonly used by Linux system administrators and endusers to achieve their day-to-day work in a Linux environment you will gain a good working knowledge of Linux and how to navigate through major Linux distributions system configurations and graphical interfaces of L Linux basic command line operations common applications of Linux and more upon completion of this training you should have a good working knowledge of Linux from both a graphical and command line perspective allowing you to easily navigate through any of the major Linux distributions the content of this course was developed by the Linux Foundation Who provided a Grant to make this course possible I've taken their primarily text based course and turned it into a video-based course throughout the course you will see some video segments that were developed by the Linux Foundation also you should know that sometimes throughout this course I put Linux commands on the screen like this the dollar sign at the beginning is not part of the command that just indicates the command should be typed into the system shell or terminal so if you're following along type everything after the dollar sign in the description of this video I've linked to a text based version of this course okay let's get started by the end of this chapter you should be able to describe the software environment required for this course and describe the three major Linux distribution families in order to fully benefit from this course you will need to have at least one link Linux distribution installed if you're not already familiar with the term distribution as it relates to Linux you soon will be you are about to learn some more details about the many available Linux distributions because there are literally hundreds of distributions I'm not covering them all in this course instead I'll focus on the three major distribution families the families in representative distributions this course will focus on are red hat family system sys including C OS and Fedora Susi family systems including open Susi and Debian family systems including Ubuntu and Linux Mint I'm about to tell you more about red hat Susi and Debian well this course focuses on these three major Linux distribution families as long as there are talented contributors the families of distributions and the distributions within these families will continue to change and grow people see a need and develop special configurations and utilities to respond to the need sometimes that effort creates a whole new distribution of Linux sometimes that e effort will leverage an existing distribution to expand the members of an existing family Red Hat Enterprise Linux or Rel heads the family that includes cnos cnos stream fedora and Oracle Linux Fedora has a close relationship with re and contains significantly more software than Red Hats Enterprise version one reason for this is that a diverse Community is involved in building Fedora with many contributors who do not work for Red Hat furthermore it's used as a testing platform for future real releases in this course we'll mainly use syn OS stream from the Red Hat Family the basic version of CN OS is also virtually identical to Rel the most popular Linux distribution in Enterprise environments however cnos 8 has no more scheduled updates the replacement is cnos 8 stream some of the key facts about the red hat distribution family are Fedora serves as an upstream testing platform for real cnos is a close clone of real while Oracle Linux is mostly a copy with some changes it supports Hardware platforms such as Intel x86 arm itanium power PC and IBM system Z it uses the Yum and dnf RPM based yum package managers uh to install update and remove packages in the system re is widely used by Enterprise which hosts their own systems the Susi family and their the relationship between Susi and open Susi is similar to the one described between real cnos Idora we use open Susi as the reference distribution for the Susi family as it's available to end users at no cost because the two products are extremely similar the material that covers open Susi can typically be applied to SLE with few problems some of the key facts about the Susi family are the Susi Linux Enterprise server or SLE is Upstream from open Susi it uses the RPM based zipper package manager which we'll cover later to install update and remove packages in the system it includes the yast or yet another setup tool application for system administration purposes slas is widely used in retail and many other sectors the Debian distribution is Upstream for several other distributions including auntu in turn a Von 2 is Upstream for Linux Mint and a number of other distributions it's commonly used on both servers and desktop computers Debian is a Pure open- Source Community project which is not owned by any Corporation and has a strong focus on stability and dbm provides by far the largest and most complete software repository to its users of any Linux distribution Ubuntu aims to at providing a good compromise between long-term stability and ease of use since autu gets most of its packages from Debian stable Branch it also has access to a very large software repository for those reasons we will use auntu LTS or long-term support as the reference to the dbm family distributions for this course some key facts about the dbm family are the dbm family is Upstream for Ubuntu and yuntu is Upstream for Linux Mint and others it uses the dpkg based AP package manager which we'll cover later in detail to install update and remove packages in the system Ubuntu has been widely used for cloud deployments while and while Ubuntu is built on top of Debian and is gnome based under the hood it differs visually from the interface on standard Debian as well as other distributions so in conclusion there are three m Major Distribution families within Linux Red Hat Susi and Debian in this course we'll work with Representative members of all of these families throughout by the end of this chapter you should be able to define the common terms associated with Linux and discuss the components of a Linux distribution in order for you to get the most out of this course we recommend that you have Linux installed on a machine that you can use throughout this course you can use this brief installation guide preparing your computer for Linux training it will help you to select a Linux distribution to install decide on whether you want to do a standalone pure Linux machine or a dual boot one whether to do a physical or virtual install and more and then it guides you through the steps I'll also cover installation soon well we have not covered everything in great detail but keep in mind that most of the documentation in Linux is actually already on your system in the form of band Pages which we'll discuss in great detail later whenever you do not understand something or want to know more about a command program topic or utility you can just type man and then the topic at the command line so I'll just assume you're thinking this way so I won't constantly repeat for more information look at the man page for this topic on a related note throughout the course we'll use a shorthand that is common in the open-source Community when referring to cases where the user has to make a choice of what to enter like a name of a program or file we use the shorthand Fu to represent the to basically represent insert file name here so we're not actually suggesting that you manipulate files or install Services called Foo the best way to learn Linux is by doing it so make sure to try things out yourself as you follow along you'll need to have a Linux system up and running that can either be a native Linux system on your Hardware running through a live USB stick or CD or a virtual machine running through a hypervisor we'll show you all these methods so let's get going before you begin using Linux you need to be aware of some basic terms such as kernel distribution boot loader service file system X Windows system desktop environment and command line these are very commonly used by the Linux Community the kernel is considered the brain of the Linux operating system it controls the hardware and makes the hardware interact with the applications an example of a kernel is the Linux kernel the most recent Linux kernel along with past Linux kernels can be found at the kernel.org website a distribution also known as dros is a collection of programs combined with the Linux kernel to make up a linux-based operating system some common examples of a distribution are red hat Enterprise Linux Fedora Ubuntu and gentu the boot loader as the name implies is a program that Boots the operating system two examples of a boot loader are grub and isol Linux a service is a program that runs as a background process some examples of the service are a httpd nfsd ntpd ftpd and name d a file system is a method for storing and organizing files in Linux some examples of file systems are ext3 ext4 fat xfs and butter FS the X Windows system provides the standard toolkit and protocol to build graphical user interfaces on nearly all Linux systems the desktop environment is a graphical user interface on top of the operating system gome KDE xfce and fluxbox are some examples of the desktop environment the command line is an interface for typing commands on top of the operating system the shell is the command line interpreter that interprets the command line input and instructs the operating system to perform any necessary test tasks and commands for example bash TC shell and zshell suppose you've been assigned to a project building a product for a Linux platform project requirements include making sure that project works properly on the most widely used Linux distributions to accomplish this you need to learn about the different components services and configurations associated with each distribution we're about to look at how you would go about doing exactly that so what is a Linux distribution and how does it relate to the Linux kernel the Linux kernel is the core of the operating system a full Linux distribution consists of the kernel plus a number of other software tools for file related operations user management and software package management each of these tools provides a part of the complete system each tool is often its own separate project with its own developers working to perfect that piece of the system while the most recent Linux kernel and earlier versions can always be found in the Linux kernel archives Linux distributions may be based on different kernel versions for example the very popular real 8 distribution is based on the 4.18 Kernel which is not new but is extremely stable other distributions may move move more quickly in adopting the latest kernel releases it's important to note that the kernel is not an All or Nothing proposition for example re and C OS have Incorporated many of the most the more recent kernel improvements into their older versions as have auntu op sui SL and more examples of other essential tools and and ingredients provided by distributions include the C and C++ and claim compilers the GDB de debugger the core system libraries applications need to to link with in order to run the low-level interface for drawing graphics on the screen as well as the higher level desktop environment and the system for installing and updating the various components including the C the kernel itself in all distributions come with a rather complete Suite of applications already installed the vast variety of Linux distributions are designed to cater to many different audiences and or organizations according to their specific needs and tastes however large organizations such as companies and governmental institutions and other entities tend to choose the major commercially supported distributions from Red Hat Susi and canle which is iunu SOS and C OS stream are popular free alternatives to Red Hat Enterprise Linux real and are often used by organizations that are comfortable operating without paid techn technical support huntu and pedora are widely used by developers and are also popular in the educational realm scientific Linux is favored by the scientific research Community for its compatibility with scientific and mathematical software packages both cnos variants are binary compatible with real which means in most cases binary software packages will install properly across the distributions many commercial Distributors including Red Hat Ubuntu Susi and or Le provide long-term fee based support for their distributions as well as hardware and software certification all major distributions provide update services for keeping your system primed with the latest security and Bug fixes and performance enhancements as well as provide online support resources you have completed chapter 2 let's summarize the key Concepts covered Linux borrows heavily from the Unix operating system with which its creators were well-versed Linux accesses many features and services through files and filik objects Linux is a fully multitasking multi-user operating system with built-in networking and service processes known as dam some of the more common terms used in Linux are kernel distribution bootloader service file system X window system desktop environment and command line and a full Linux distribution consists of the kernel plus a number of other software tools for file related operations user management and software package management by the end of this chapter you should be able to identify Linux file systems identify the differences between partitions and file systems describe the boot process and install Linux on a computer the Linux boot process is the procedure for for initializing the system it consists of everything that happens from when the computer is first switched on until the user interface is fully operational having a good understanding of the steps in the boot process may help you with troubleshooting problems as well as with tailoring the computer's performance to your needs on the other hand the boot process can be rather Technical and you can start using Linux without knowing all the details starting an x86 based Linux system involves a number of steps when the computer's powered on the basic input output system or bios in initializes the hardware including the screen and keyboard and tests the main memory this process is also called post power on self test the bio software is stored on a ROM chip on the motherboard after this the remainder of the boot process is controlled by the operating system once the post is completed the system control passes from the BIOS to the bootloader the boot loader is usually stored on one of the hard diss in the system either in the boot sector for traditional bios or MBR systems or the EFI partition for more recent or unified extensible firmware interfaces or EFI ufi systems up to this stage the machine does not access any mass storage media there after information on date time and the most important peripherals are loaded from the seos values after technology used for the battery powered memory store which allows the system to keep track of the date and time when even when it's powered off a number of boot loaders exist for Linux the most common ones are grub for Grand unified boot loader isol Linux for booting from removable media and dos uboot for booting on embedded devices appliances most Linux boot loaders can present a user interface for choosing alternative options for booting Linux and even other op operating systems that might be installed when booting Linux the boot loader is responsible for loading the kernel image and the initial Ram disc or file system into memory the boot loader has two distinct stages for systems using the BIOS MBR method the bootloader resides at the first sector of the hard disk also known as the master boot record the size of the MBR is just 512 bytes in this stage the bootloader examines the partition table and finds a bootable partition once it finds a bootable partition it then searches for the second stage boot loader for example grub and loads it into RAM for systems using the EFI slfi method UEFI firmware reads its boot manager data to determine which UEFI application is to be launched and from where the firmware then launches the UEFI application for example grub as defined in the boot entry in the firmware boot manager the second stage boot loader resides under slash boot a splash screen is displayed which allows us to choose which operating system to boot after choosing the OS the boot lead boot the boot loader loads the Kel of the selected operating system into RAM and passes control to it kernels are almost always compressed so its first job is to uncompress itself after this it will check and analyze the system hardware and initialize any hardware device drivers built into the kernel the init Ram FS file system image contains programs and binary files that perform all actions needed to mount the proper root file system like providing kernel functionality for the needed file system and device drivers for mass storage controllers with a facility called udev for user device which is responsible for figuring out which devices are present locating the device drivers they need to operate properly and loading them after the root file system has been found it's checked for errors and mounted the mount program instructs the operating system that a file system is ready for use and Associates it with a particular point in the overall hierarchy of the file system the mount point if this is successful the the init Ram FS is is cleared from RAM and the init program from the root file system is executed init handles the mounting and pivoting over to the final real root file system if special Hardware drivers are needed before the mass storage can be accessed they must be in the init ramfs image near the end of the boot process init starts a number of text mode login prompts these enable you to type your username followed by your password and to eventually get a command shell however if you're running a system with a graphical login interface you'll not see these at first usually the default command shell is Bash but there are a number of other Advanced command shells available the shell prints a text prompt indicating it is ready to accept commands after the user types the command and presses enter the command is executed and another prompt is displayed after the command is done the boot loader loads the kernel and an initial Ram based file system into memory so it can be used directly by the kernel when the kernel is loaded in Ram it immediately initializes and configures the computer's memory it also configures all the hardware attached to the system this includes all processors IO subsystems storage devices and more the kernel also loads some necess are user space applications once the kernel has set up all its hardware and mounted the root file system the kernel runs the sbin init this then becomes the initial process which then starts other processes to get the system running most other processes on the system Trace their origin ultimately to init exceptions include the so-called kernel processes these are started by the kernel directly and their job is to manage internal operating system details besides starting the system init is responsible for keeping the system running and for shutting it down cleanly one of it one of its responsibilities is to act when necessary as a manager for all non-el processes it cleans up after them upon completion and restarts user login Services as needed when users log in and out and does the same for other background system services traditionally this process startup was done using conventions that date back to the 1980s and the system V variety of Unix this serial process had the system passing through a sequence of run levels containing collections of scripts that start and stop Services each run level supported a different mode of running the system with within each run level Individual Services could be set to run or to be shut down if running however all major distribu s have moved away from this sequential runlevel method of system initialization although they usually emulate many system V utilities for compatibility purposes next we'll discuss the new methods of which system MD has become dominant systems with system D start up faster than those with earlier init methods this is largely because it replaces a serialized set of steps with aggressive pitalization techniques which permits multiple services to be initiated simultaneously it has been adapted by all major distributions and so we'll not discuss the older system V method or upstart which has become a dead end complicated Startup shell scripts are replaced with simpler configuration files which enumerate what has to be done before a service is started how to execute service startup and what conditions the service should indicate have been accom accomplished when startup is finished one thing to note is that s spinit now just points to lib system d/ systemd so system D takes over the init process one system D command system control is used for most basic tasks while we have not yet talked about working at the command line here's a brief listing of its use think of a refrigerator that has multiple shelves that can be used for storing various items these shelves help you organize the grocery items by shape size type Etc the same concept applies to a file system which is the embodiment of a method of storing and organizing arbitrary collections of data in a human usable form different types of file systems supported by Linux include conventional disk file systems flash storage file systems database file systems and special purpose file systems this section will describe the standard file system layout shared by most Linux distributions a partition is a physically contigous section of a dis or what appears to be so in some Advanced setups a file system is a method of storing or finding files on a hard disk usually in a partition one can think of a partition as a container in which a file system resides although in some circumstances a file system can span more than one partition if one uses symbolic links which we'll discuss much later a comparison between file systems in Windows and Linux is shown in this table Linux systems store their important files according to a standard layout called the file system hierarchy standard which has long been maintained by the Linux Foundation having a standard is designed to ensure that users administrators and developers can move between distributions without having to relearn how the system is organized Linux uses the slash care to separate paths unlike Windows which uses the backslash and it does not have multiple Drive letters multiple drives and or partitions are mounted as directories in the single file system removable media such as USB drives and CDs and DVDs will show up as mounted at run/ media your username slis Lael for recent Linux systems or under SL media for older distributions for example if your username is student a USB pin Drive labeled Fedora might end up being found at run/ media student Fedora and a file readme.txt on that dis would be at run/ media student Fedora readme.txt all Linux file systems are case sensitive so these different ways of spelling boot represent three different directories or folders many distributions distinguish between core utilities needed for proper system operation and other programs and place the ladder in directories under SL USR or user now let's learn about viewing the file system hierarchy from the graphical interface in yuntu Click the file manager icon on the left panel by default it explores your home directory to see all directories under root directory click computer on the left places pane inside this window doubleclick the Etsy directory to open it double click aahi and press control L to see the current location the current path appears at the top of the window the path for this is Etsy aah now let's learn about viewing the file system hierarchy from the graphical user interface in open Susi click activities on the top left corner of the screen Corner click the file manager your icon on the left panel by default it explores your home directory click computer on the left places pane inside this window you can see all directories under the root directory doubleclick the Etsy directory to open it to see the current location doubleclick the avahi folder and press control L the current path appears at the top of the window the path for this is Etsy aahi suppose you intend to buy a new car what factors do you need to consider to make a proper Choice requirements which need to be taken into account include the size needed to fit your family in the vehicle the type of engine and gas economy your expected budget and available financing options reliability record and after Sal Services Etc similarly determining which distribution to deploy also requires planning here you can see some but not all choices note that many embedded Linux systems use custom crafted contents rather than Android or yako some questions worth thinking about before deciding on a distribution include what is the main function of the system what types of packages are important to the organization for example web server word process processing Etc how much hard disk space is required and how much is available for example when installing Linux on an embedded device space is usually constrained how often are packages updated how long is the support cycle for each release for example LTS releases have long-term support do you need kernel customization from a vendor or a third party what Hardware are you running on for example it might be x86 arm or PPC do you need long-term stability can you accept or need a more volatile Cutting Edge system running the latest software the partition layout needs to be decided at the time of installation it can be difficult to change later while Linux systems handle multiple partitions by mounting them at specific points in the file system and you can always modify the design later it's always easier to try to get it right to begin with nearly all installers provide a reasonable default layout with either all space dedicated to normal files on one big partition and a smaller swap partition or with separate partitions for some space sensitive areas like home and VAR you may need to override the defaults and do something different if you have special needs or if you want to use more than one dis all installations include the bare minimum software for running a Linux distribution most installers also provide options for adding categories of software common applications such as the Firefox web browser and Libra office office suite developer tools like the V and emex text editors which we'll explore later and other popular services such as the Apache web server tools or mySQL database are usually included in addition for any system with a graphical desktop a chosen desktop such as nomer KDE is installed by default all installers set up some initial security features on the new system one basic step includes setting the password for the super user rout and setting up an initial user in some cases only an initial user set up direct root login is not configured and root access requires logging in first as a normal user and then using PSE sudo as we'll describe later some distributions will also install more advanced security Frameworks such as SE Linux or app armor for example all red hat based systems including Fedora and CN OS always use SE Linux by default and yuntu comes with app armor up and running like other operating systems Linux distributions are provided on removable media such as USB drives and CDs or D DVDs most Linux distributions also support booting a small image and downloading the rest of the system over the network these small images are usable on Media or as Network boot images in which case it is possible to perform and install without using any local media many installers can do an installation completely automatically using a configuration file to specify installation options this file is called a Kickstart file for Red Hat based systems and Auto yes profile for Susi based systems and a preed file for Debian based systems each distribution provides its own documentation and tools for creating and managing these files the actual installation process is pretty similar for all distributions after booting from the installation media the installer starts and asks questions about how this system should be set up these questions are skipped if an automatic installation file is provided then the installation is performed finally the computer reboots into the newly installed system on some distributions additional questions are asked after the system reboots most installers have the option of downloading and installing updates as part of the installation process this requires internet access otherwise the system uses its normal update mechanism to retrieve retrieve those updates after the installation is done the demonstrations we see show how to install Linux directly on your machine erasing everything that was there while the demonstrations will not alter your computer following these procedures in real life will erase all current data there are also alternate methods to install Linux where you won't lose any data so some of those methods include repartition your hard disk to free up enough room to permit dual boot or side by-side installation of Linux along with your present operating system or using a host machine hypervisor program such as vmware's products or Oracle virtual box to install a client Linux virtual machine and finally booting off of and using a live CD or USB disc and not riding to the hard disk at all the first method is sometimes complicated and should be done when your confidence is high and you understand the steps involved the second and third methods are quite safe and make it difficult to damage your system here are the steps to install yuntu now going to do an install of Ubuntu 1804 as a virtual machine under the VMware hypervisor using a redhead 7 host system running VMware Player so first thing we need to do is to create a new virtual machine and for that I already have the uh Ubuntu install disc mounted uh in the virtual CD drive and we'll give it a name for the user as LF student with a username of student and we have to give a password which I've done and then for the name let's just call it Ubuntu and then on the host machine I want to have a certain place I want to put it uh rather than my home directory I want it in a on a disc that has a lot of space and then let's allocate 30 gigabyt of space and I prefer to have it as one big file rather than multiple files or slices I find that clutters my system less and really that's all you have to do to start setting up the install but it's better to click on customize hardware and increase the amount of memory from 1 Gigabyte to four in my case and I might as well take advantage of having multiple processors so I'll let it use all four processors on this host machine and then I'll just click on finish and uh it will start the install after a couple of harmless messages about how the virtual machine graphics driver doesn't permit accelerated graphics performance now the beautiful thing about the Ubuntu install on this recent version is that I am done there are no more choices to make I don't have any more parameters to specify Etc if I hadn't been installing in a virtual machine it would have asked me information like username and password at this stage but it was able to pick that up because of the intelligent way that VMware can handle UB to so I'm doing this in real time if you can read the messages you see it just created the the main file system on the system and now it's going to the stage of copying all the files over to the hard disk or I should say the simulated hard disk now this takes a little bit of time so I'll pause the recording for a few seconds so you don't have to watch not much happening I skipped about a minute or so and now it says it's almost finished copying files it's showing a bunch of different blurbs for various features in this bionic Beaver or Ubuntu 18.04 release the status bar has reached all the way to the right so it should be almost done and now it's doing the actual install of the system so it's copied all the files it needs over to the hard disk and it's doing the actual configuration so once again I believe I'll pause for a little while so you don't have to sit here and watch not much happening paused for about a minute now it says it's configuring Hardware so it's finding all the hardware devices in the system making sure it has the right device drivers for it Etc it's now configuring the boot loader the grub and now it's doing cleanup it's getting rid of packages which were only needed during the install and of course that's rolling by far too fast to be readable and so it's doing a little bit more package installation I think I'll pause again for a little while so it reached the end of the status bar and now it's doing the reboot and shortly I should be getting a login prompt if you notice it's installing open VM tools that's a package of special drivers and configuration stuff that's used when you're running it as a guest under VMware hypervisor and we've reached the login screen running under the greeter so I'll just log in as student and oops I typed in the wrong password I suppose yep and now the system's running there's a few introductory uh messages here and I'll just click through them to get to a fully up system and then just to see what really happened here if I right click I can open up a terminal and then I'm going to run the command DF for dis free- T to show me what type of file systems I have in h to print out the results in megabytes and gigabytes and I see that in the main file system I have 30 GB of space of which I'm using 5.3 and it's an ext4 file system when we install Centos we need to actually specify the type of file system the size of the partition Etc but auntu made choices that it thought were best likewise uh we won't talk about this now but if I look at Swap files you'll see that there is a swap file of about 1 and a 12 Gab created uh instead of a swap partition usually distributions create swap partitions so that's all there is to install the latest uh version of Ubuntu uh absolutely nothing to do during the install it makes what it thinks as sensible decisions for everything and after the system is up and running you could then go into the package manager and put in exactly what you need and configure the system in other ways if you need a more flexible installation to begin with you can make such choices uh when you start but we we took the easy path here here are the steps to install syn OS we are now going to do a fresh install of Centos 8.1 the latest version of Centos at the time of this installation we have already allocated hard disk space for this install ation to make a virtual machine under VMware and we have inserted the install dis image and we're ready to begin so we will uh not take the step of testing the media and installing it because uh that takes some time so we'll just go directly to an install so I'll just move to the first element here and hit return and uh we'll try to do this install as as quickly as possible so we'll choose mostly the uh default choices and we're going to do a workstation install rather than a server install uh because this is what is desired for this course um to have an to have a user based uh install Okay so the first choice is to pick the language we'll pick English and then uh we can go really through any order we want through these different choices uh to begin with but let's just go in order so we've already picked an English keyboard with the US uh layout and also language support is set up for English for United States you can click on these to make those changes for the time and date uh it's actually better to to make sure the network is installed first so here I'm going I clicked on network and I'm going to turn on the network it found the network card and it's kind of ready to go probably should configure uh but I think the default choices will be fine if I go to General uh it says all users May connect and then if I go to ipv vce settings you'll see it's automatic DHCP uh so that's generally what you want rather than having to give it a fixed address so we'll just say okay for all this and uh um I guess we should say connect automatically with priority zero that means it'll always connect when you start up the machine and we can say done the reason it's good to do that before we set the time and date is we can now have Network time on which means it will automatically find a time uh I'm currently doing this installation from Central Time Zone in the United States so you can try to do that with the mouse and I got it right it's set for Chicago which is Central Time so I'll say done and then uh the installation source is uh rather important but that's local media I already have the DVD set as you see at Centos 8-11 1911 that's the uh latest version of Centos for the software selection uh let's just keep the workstation I could make it a server with a graphical interface or just a server if I really wanted to be quick I could do a minimal install and then bring everything up later that I need uh but within the workstation I should pick a few things so I'll pick gnome applications internet applications uh you'll probably want to pick the office suite and productivity but I'd like this to go quickly so I won't do that right now uh I'll pick development Tools in case I want to compile anything um and that's probably the main things I need right now but you can always change everything in detail once the system's up so it's it's good to do a a relatively quick install the trickiest part here is to do the installation um partitioning setup so I'll pick I've already got picked here the virtual 30 gigabyte disc and if I wanted to take things really fast I would do automatic storage configuration uh and let it decide what kind of partitions I should have how big they should be Etc and you may want to at least look at that but I let me just do custom because it fits in better with my needs and then I can say done okay and then I get to pick what kind of installation I want to do a standard partition and not an lvm which is logical volume management uh I just want a simple standard partition so I'll do that and then I actually have to create the partitions I need so I hit the plus sign and I'll have one big partition for everything so it's mounted at slash and let's give it 29 gabes and I'll add that this is a 30 G abte dis and then I'll add one more okay and that won't be mounted that'll be for Swap and if I don't give it desired capacity it should take it all uh which it actually decided it should have three gigabytes I'll let the system go with what it wants it's it's doing that based on how much uh memory I have okay um and it says I have only like one megabyte left I the total 30 gabt the one other thing I get to do for the first Mount Point here is pick what kind of file system and you notice the default on red hat now is or C is xfs let me make it ext4 um which is which is easier to mount from other other machines Etc than xfs but you can just take the the uh default if you prefer and then I'd say done and and should be done it's telling me do I really want to do this cuz it's going to wipe out everything that's on that dis I'll say sure accept the changes so uh I'm pretty much done uh K dump is a system you can set up so that if the system crashes you produce what's called a cord dump file so I'll just you know you probably won't need to use that it'll be a little faster to boot uh when you have a new kernel so I'll just not enable that but if you're doing a develop machine you probably want that we already configured the network and under security policy uh we won't do any specialization we'll just leave it alone for now you can always change it later and then you just say begin installation now it'll already take a head start on trying to load some packages and files while you have some more information to put in uh first have to pick a password for the root account and so I'll do that and it's actually LF train for uh Mach virtual machines we use for the classes which is a pretty simple password and uh it's it's hard to read here but it it should be saying it's too simple I can't see that oh it says weak here but it says press done again to use the password anyway so I'll do that this is a away machine and then I have to create a user I'll make the full name of the user LF student and by choice by default it wants to make the username of the account L student but we'll just make it student um it will require a password to use this account if we said make this user administrator it would be like Ubuntu systems where there's just one password and uh you have to do su to do anything privileged but let's keep a standard Unix type set up with separate accounts and passwords for the student user and the root user so we're going to give a very simple password again just the word student and once you get it oh it says it does not match I must have typed things wrong let's try again St ENT St ENT yeah so now it says the password contains the username and some form you will have to pass done twice to confirm it it's also considered very weak but we'll accept it once again it's a throwaway machine in real life you shouldn't do this and so I say done and now uh we just have to wait for the install you'll see it has installed F 500 some odd packages out of 1481 we could keep watching while this happens but it takes some time so I'm going to pause the recording and come back when it's almost done so it has finished and it's configuring the kernel now uh that takes a little bit of time it installed I think, 1481 packages so now it's doing the actual configuration of the kernel it is doing a few other configuration steps you'll notice it is is installing the boot loader it configured the editors is generating What's called the init Ram FS which is uh needed to boot it contains the initial file system which is stored in memory for just for the system booting which we talk about in detail in this course and this is probably the last thing it really has to do before it's done uh depending on the complexity of things it can take away while is now complete so now we can simply reboot so let's do that and we should have a running system and you see it's wants to boot there into the default kernel 4.8.0 and I didn't do anything it will automatically boot on its own and then there's a few things that happen when you start up the first time I it wants me to accept the uh and user license which is pretty simple for uh open source product uh and then finish configuration it has a few other things to set up and we're ready to do our first login as student so I clicked on that I type in the password and we have an up and running system and uh it's going to ask us to confirm again our choice of language and uh we could check to make sure the keyboard is okay but uh we're fine with English us and uh I'm going to turn off location services that's a that's a choice you can make and if you want you can connect to various online accounts so we're going to skip all that and we're ready to go so now we have a fully functional system it brings up so a tutorial screen if you want to get some more information we'll just skip that and here we are it's a fully functional system if I want to uh get a little information let me drop to a command line so I clicked on activities I'll say terminal and and here we are so for instance if I do df- you'll see uh I've used 5.2 GB uh and there's plenty of space available uh if I wanted to change the size of the screen depending on your hypervisor sometimes you can just kind of drag it out or something but uh here let me go to display settings and it's set for 1280 time 78 768 and I obviously can go bigger so just to show you for instance let's say I take 19 20 by 1220 and I'm filling up the whole screen now it's actually bigger than my whole screen so I'll revert the settings but you can do all sorts of other adjustments and we've done a complete install of centos8 it's all set and ready to use and customize to your heart's content here are the steps to install open Susi we are now going to do a fresh install of open Su as a virtual machine under a VMware hypervisor on a red hat 7 system we have already inserted the installed DVD and we are about to begin notice that in our initial screen we can do an installation and upgrade or if we scroll down to more we see that we can also use the install DVD as a rescue system uh uh we can check memory and do various things but we're going to do an install so I'll just pick on install and then it will cook for a while before it asks me to do anything uh so now it's finding all the hardware deciding what drivers to use Etc and getting started this is open Su leap version 42.3 and this is a typical gnome graphical booting screen while it's getting itself ready it should take a few more seconds I'll pause so we don't have to watch the whole thing okay it has moved on and it's about ready to bring up a graphical screen and there we go so it's initializing the hardware on the system okay now it's asking whether we want to accept English as a language and also the license agreement so we'll just say sure click on the next button it's doing more probing of the system deciding what to do and it says in a very small font initializing the installation now it would like to take a default partition scheme which we will override um so let me say edit proposed settings and I will take a partition-based proposal I will choose for my root partition ext4 I won't have any separate home partition or other partitions to keep things simple and that's all I have to choose so it's pretty simple and it says here it's going to create a swap partition of 2 gabt and then a root partition for everything else 28 gigabytes um and so I'm happy enough with that so I'll just say next and first thing is just to pick the time zone so I'll pick central time where I am currently sitting and I could do some other settings that unless I don't want to take automatic time setting so I just say next and here I have a choice for what kind of desktop let me pick the gome desktop I could pick the KDE or as a server pure text mode no graphical or I could do custom to do something a little more complicated or different and then it wants me to give a a full name name for uh the main user I'll say LF student and for username I'll pick student and I'll give a password and then I will not pick use this password for system administrator that would be like what auntu does and I will not pick automatic log and it's generally not a good idea to let your system log in without having to give a password so I'll say next it doesn't like my password because it's too simple but I'll say okay do it and now I have to give a root password and you might want to test your keyboard layout to make sure you have the right language I'll say next and once again it's going to complain my password is too simple and then I just say install and that's all the choices that I actually have to make uh so really nothing except specifying username password and what kind of desktop I want we can do further adjustments once the system is fully installed now while it's installing which should take about 10 minutes uh the default screen here is a slide show giving you brochures and information if I click on details it's a little more fun to look at so you can see the overall progress as it goes this first bar here is for each package as it is being installed and on the bottom you can see I'm already about 15% installed so I'm going to pause the recording cuz it's kind of boring to watch it install all 1500 packages and I'll wait until it's asking me to do something again before resuming okay that took about less than 10 minutes and now it's telling me the system is going to reboot and it did um and so we'll just see our normal booting uh of the new open Su system and uh it should quickly bring up the login screen just a few more seconds and there's our usual greeter screen I'll just type in the password for the student account and we have a fully operational open Su system now the first thing I would do from here is update the system because there's always new updates to various packages since the DVD install disc was released so that's important for both security and performance and it's even prompting me to go go ahead and do that and then I'd probably do some minor customizations about what kind of menus I see how Windows behave the keyboard Etc but I'll leave that for people to do as an exercise you have completed chapter 3 Let's summarize the key Concepts covered a partition is a logical part of the dis a file system is a method of storing or finding files on a hard disk by dividing the hard disk into partitions data can be grouped and separated as needed when a failure or a mistake occurs only the data in the effective partition will be damaged while data on the other partitions will likely survive the boot process has multiple steps starting with the BIOS which triggers the boot loader to start up the Linux kernel from there the init Ram FS file system is invoked which triggers the anet program to complete the startup process and determining the appropriate distribution to deploy requires that you match your specific system needs to the capabilities of the different distributions by the end of this chapter you should be able to manage graphical interface sessions perform basic operations using the graphical interface change the graphical desktop to suit your needs needs you can use either a command line interface or a graphical user interface when using Linux to work at the CLI you have to remember which programs and commands are used to perform tasks on the other hand using the guey is often quick and easy it allows you to interact with your system through graphical icons and screens for repetitive tasks the CLI is often more efficient while the guei is easier to navigate if you don't remember all the details or do something only rarely we'll learn how to manage sessions using the guey for the three Linux distribution families that we cover the most in this course which are red hat including C and Fedora Susi open Susi and deian Ubuntu and mint in subsequent sections of this course we'll concentrate in great detail on the command line interface which is pretty much the same on all distributions generally in a Linux desktop system the x windows system is loaded as one of the final steps in the boot process it's often just called x a service called the display manager keeps track of the displays being provided and loads the X server so-called because it provides graphical services to Applications sometimes called X clients the display manager also handles graphical logins and starts the appropriate desktop environment after a user logs in X is rather old software it dates back to the mid1 1980s and as such it has certain def deficiencies on Modern systems for example with security and it's been stretched rather far from its original purpose a newer system known as Wayland is gradually superseding it and is the default display system for Fedora real 8 and other recent distributions for the most part it looks just like x to the user although under the hood it's quite different a desktop environment consists of a session manager which starts and maintains the components of the graphical session and the window manager which controls the placement and movement of Windows the window title bars and controls although these can be mixed generally a set of utilities session manager and Window Manager are used together as a unit and together they provide a seamless desktop environment if the display manager is not started by default in the default run level you can start the graphical desktop in different in a different way after logging into a text mode console by running start X from the command line when you install a desktop environment the X display manager starts at the end of the boot process it's responsible for starting the graphics system logging in the user and starting the user's desktop environment you can often select from a choice of desktop environment when logging into the system gnome is a popular desktop environment with an easyto usee graphical user interface it's bundles as the default desktop environment for most Linux distributions including Red Hat Enterprise Linux re Fedora Centos Susi Linux Enterprise auntu and deian gome has menu based navigation and is sometimes an easy transition to accomplish for Windows users however as you'll see the look and feel can be quite different across distributions even if they're all using gnome another common desktop environment very important in the history of Linux and also widely used is KD e which has often been used in conjunction with Susi and open Susi as previously mentioned most desktop environments follow a similar structure to gnome and we'll restrict ourselves mostly to it to keep things less complex let's demonstrate how we log in and log out of a system which has already been booted on all recent distributions this looks pretty much the same here we're showing an instance of Centos stream which has three users on the system and I can log in in any one of them by selecting so let's go with the second one BJ moose and you'll notice that when I log in if I click on the gear item I have a choice of different desktops okay here's the default on couette stream which is a whan but I can pick a couple different kinds of x11s if I want I'll type in the password and I log in I depending on what's going on it may see a little bit of information um and that's all involved in logging in I probably won't see a hell of a lot uh this is a new user without much going on if I click on activities for instance I'll see some favorite applications uh if I click on Terminal here I can bring up a terminal if I want to do command line activity to log out all I have to do is go in the upper right corner and I can click on my name and then I can say either switch user or log out I would do switch user if I want to keep more than one session active at a time for different people which is something you probably won't want to do very often but it would mean if I came back into this user session I would see the whatever applications I had open but I'll just pick on log out and then I click here log out and I'm back to my greeter or my login screen where I can pick the users again so I can log in on any one of them so that's a simple demonstration of how one logs in and out of a system each Linux distribution comes with its own set of desktop backgrounds you can change the default by choosing a new wallpaper or selecting a custom picture to be set as the desktop background if you don't want to use an image as the background you can select a color to be displayed on the desktop instead in addition you can also change the desktop theme which changes the look feel of the Linux system the theme also defines the appearance of application windows so let's see how to change the desktop background and theme we are going to demonstrate how to change the background wallpaper on a red hat 7 system all recent Linux distributions have exactly the same method so this will suffice to show for all so all we have to do is click on the background with a right click and change background click on background again and then we have a choice between wallpapers that the system knows already and it's possible to load up other ones so let's say we pick this one here and you see now the background has been changed or I could pick for instance a picture stored on my machine in my pictures directory under my home directory so I'll pick this one and you see it's been changed so that's all we have to do to change the background on any recent Linux system most common settings both personal and systemwide are to be found by clicking in the upper right hand corner on either a gear or other obvious icon depending on your Linux distribution however there are many settings which many users would like to modify which are not accessible in that way the default settings utility is unfortunately rather Limited in modern gnome based distributions unfortunately the Quest for Simplicity has actually made it difficult to adapt your system to your tastes and needs fortunately there is a standard utility gnome tweaks which exposes many more setting options it also perits you to easily install extensions by external parties not all Linux distributions install this tool by default but it's always available you may have to run it by hitting alt F2 and then typing in the name you may want to add it to your favorites list as we shall discuss in this screenshot the keyboard mapping is being adjusted so the useless cap loot key can be used as an additional control key this saves users who use control a lot such as emac efficient autos from getting physically damaged by pinky strain the visual appearance of applications the buttons scroll bars widgets and other graphical components are controlled by a theme gnome comes with a set of different themes which can change the way your applications look the exact method for changing your theme may depend on your distribution for older gnome based distributions you can simply run gnome tweaks as shown in this screenshot from Ubuntu however now you'll be able to see a demonstration for logging in and out on the major Linux distribution families we'll concentrate on in this course note that Evolution has brought us to a stage where little it matters little which distribution you choose as they're all rather similar recent Linux distribution which use the gnome desktop look remarkably the same when it comes to the process of starting up and shutting down so we will demonstrate that here by using a VMware hypervisor on a red hat Enterprise Linux host and we'll demonstrate three recent distributions and how they boot so we've already teed them up so here I will start Centos stream here I will start Ubuntu 2004 and here I will start open Su leap 15.3 so you'll see a little bit different messages on each as they boot uh according to how grub is configured and what the possible kernel choices are it will take longer to boot than they were normally would if I was only doing one at a time simply because uh the host machine's a little bit overloaded running three virtual Machin machines it really doesn't have a ton of memory uh in this case I have allotted 3 GB of memory to each out of a total of 16 gab on the machine so it's a little bit memory stressed uh so we'll just wait till they start and reach their greeter screen which you see we've already done that on auntu we've already done that on open Su leap and it's taking somewhat longer on s uh H stream so let's log into these guys while we wait for SOS stream to get ready so I'll log in the student password here on the uh Ubuntu machine I'll do the same thing on the open Su machine and now we're just waiting for the Cent 8 machine finally ready and then I'll log in there as well and you notice they have different background pictures just because we have selected different background pictures over time but they all arrive to pretty much the same appearance with an activities and an applications menu and then uh Ubuntu still likes to have this uh sidebar on the left with major applications um I can easily bring that up on the other ones for instance if I type activities here activities on open Su I will see the same thing there and then the process of shutting down is also quite similar all I need to do is click in the upper right hand corner and I find the power icon and I just say power off I'll do the same thing with the Buu I get power off going to go power off and I can do the same thing with open SU power off and power off so it's remarkably the same from distribution to distribution these days it's often a good idea to lock your screen to prevent other people from accessing your session while you're away from your computer note this does not suspend the computer all your applications and processes continue to run while the screen is locked let's show how to lock and unlock your screen on any recent gnome distribution so the simplest way is to go to the upper right corner and click and find the lock button and simply and simply click on that and then you can unlock it by clicking on the display on the time there and just typing in the password again very simple another way to do it is through combination of keys uh depending on your machine this will generally be the Super Key plus l or the Super Key plus the Escape where the super key is also known as the Windows key uh so let me do that here and once again I brought up the lock window and I can simply unlock it again so that's all that's involved it's very simple Linux is a true multi-user operating system which allows more than one user to be simultaneously logged in if more than one person uses the system it's best for each person to have their own user account and password this allows for individualize settings home directories and other files users can take turns using the machine while keeping everyone's sessions alive or even be logged in simultaneously through the network let us demonstrate how to switch users on an Ubuntu machine with several accounts so first I will choose the Linux Foundation student as the account to log into type my password and sign in and then if I look in the upper right hand corner and click there I will see LF student and I can click on either log out or switch user notice if I log out I really log out but if I switch user I will just lock the user account and then when I start up I will preserve all of my sessions and open Windows Etc when I restart on some distributions you may actually see a list of users at this screen but not on Ubuntu so I'll say switch user I'm back to the greeter screen and let me pick the second one Theodor Cleaver and log in as that other user and there we go and now if I look up here again I can do the same thing so let me click on the name and I'll say switch user and if I pick student again you notice here it says unlock and not restart that means that if I were to log in now I will have preserved all the open windows and running applications from before this will look the same essentially on all Linux distributions of recent vintage so it's very easy to switch users and not lose any information from what you're already doing besides normal daily starting and stopping of the computer a system restart may be required as part of certain major system updates generally only those involving installing a new Linux kernel initiating the shutdown process from the graphical desktop is rather trivial on most current Linux distributions with very little variation we'll discuss later how to do this from the command line using the shutdown command in all cases you click on either a settings or gear or a power icon and follow the prompts to shut down the computer on any recent gnome based Linux distribution perform the following steps uh first click the power or the gear icon in the upper right hand corner of the screen second click on click on the power off restart or cancel if you do nothing the system will shut down in 60 Seconds shutdown reboot and logout operations will ask for confirmation before going ahead this is because many applications will not save their data their data properly when terminated this way always save your documents and data before restarting shutting down or logging out all modern Computers support suspend or sleep mode when you want to stop using your computer for a while suspend mode saves the current system state and allows you to resume your session more quickly while remaining on but uses very little power in the sleeping state it works by keeping your systems applications desktop and so on in system Ram but turning off all the other Hardware this shortens the the time for a full system startup as well as conserves battery power once you note that modern Linux distributions actually boot so fast that the amount of time saved is often minor even experienced users can forget the precise command that launches an application or exactly what options and arguments it requires fortunately Linux allows you to quickly open applications using the graphical interface applications are found at different places in Linux and within gnome they can be found from the applications menu in the upper leftand corner or from the activities menu in the upper left hand corner also in some Ubuntu versions from the dash button in the upper leftand corner for KDE and some other environments applications can be opened from the button in the lower leftand corner in the upcoming sections you will learn how to perform basic Linux operations using the graphical interface unlike other operating systems the initial install of Linux usually comes with a wide range of applications and software archives that contain thousands of programs that enable you to accomplish a wide variety of tasks with your computer for most key tasks a default application is usually already installed however you can always install more applications and try different options for example Firefox is popular as the default browser in many Linux distributions while Epiphany codor and chromium the open source uh of Google Chrome are usually available for install from software repositories proprietary web browsers such as Opera and chrome are also available locating applications from The Gnome and KDE menus is easy as they're neatly organized in functional submenus multiple applications are available to accomplish various tasks and to open a file type a file of a given type for example you can click on a web address while reading an email and launch a browser such as fir fox or Chrome to set the default applications enter the settings menu on all recent Linux distributions and then click on either default applications or details default applications let's now demonstrate how to set default applications on a red hat system we go to the upper right hand corner click on the top bar then scroll down to the gears icon for settings go down to the bottom for d details and then I can click on default applications so you see under web or browser there are three choices on this system I have Google Chrome Firefox or Opera we'll leave it at Google Chrome for video the default choic is videos which is actually a program called totem but let's switch it to the VC media player and for the image viewer I have the built-in image viewer or I could switch to the new image manipulation program better known as so on all recent distributions with a gnome desktop the procedure is identical and absolutely the same and it's very simple to change your default applications each distribution implements the naist or file manager utility which is used to navigate the file system it can locate files and when a file is clicked upon either it will run if it's a program or an associate application will be launched using the file as data this behavior is completely familiar to anyone who has used other operating systems to start the file manager you will have to click on its icon a file cabinet which is easily found usually under favorites or accessories it will have the name files this will open a window with your home directory displayed the left panel of the file manager window holds a list of commonly used directories such as desktop documents downloads and pictures the file manager let you access different locations on your computer and the network including the home directory the desktop uh documents pictures and other other locations every user with an account on on the system will have a home directory usually created under home slome and usually named according to the user such as slome SL student by default files the user saves will be placed in a directory Stree starting there account creation whether during system installation or at a later time when a new user is added also induces default directories to be created under the user's home directory such as documents desktop and and downloads the file manager allows you to view files and directories in more than one way you can switch between the icons and list formats either by clicking The Familiar icons in the top bar or you can press control1 or control2 respectively in addition you can also arrange the files and directories by name size type or modification date for future sorting to do so click View and select arrange items another useful option is to show hidden files sometimes I'm precisely called system files which are usually configuration files that are hidden by default and whose name starts with a DOT to show hidden files select show hidden files from the menu or press controll h the file browser provides multiple ways to customize your window view to facilitate easy drag and drop file operations you can also alter the size of the icons by selecting zoom in and zoom out under the view menu the file manager includes a great Search tool inside the file browser window one click search in the toolbar to bring up a text box then enter the keyword in this text box this causes the system to perform a recursive search from the current directory for any file or directory which contains a part of this keyword you can refine your search beyond the initial keyword by providing drop-down menus to further filter the search deleting a file in Nautilus will automatically move the deleted file to the lo/ share tr/ files directory uh basically a trash can under the user's home directory there are several ways to delete files and directories under Nautilus one you can select all you select all the files and directories that you want to delete then press control delete on your keyboard or right click the file then select move to trash note that you may have a delete permanently option which bypasses the trash folder and this option may be visible all the time or only in list rather than icon mode to permanently delete a file on the left panel inside a nautilus file browser window rightclick on the trash the the on the trash directory select empty trash and that's all alternatively select the file or directory you want to permanently delete and press shift delete let's see how to locate the Firefox application in locate Firefox click activities on the top left corner of your desktop on the left panel click the show applications icon click the Firefox icon close Firefox by clicking close in the top right corner of the Firefox window next let's explore the home directory using the file manager try to View files in list mode create a new empty document save it and remove it click activities in the upper left corner of your desktop in the left panel click the file manager icon this will by default open the home directory to View files in list mode click the list icon in the upper right of the file manager window doubleclick the document directory to open it click activities in the top left corner of your desktop to launch gedit type gedit in the search box click the gedit icon to open it type your name and click close in the top right corner of the gedit window to create and close a file click save as to save the created file select documents from the left panel of the save as window type test to save the file by that name click save to save the file and close gedit this brings you back to the document directory rightclick the test file in the document window select move to trash to remove the file you have completed chapter 4 let's summarize the key Concepts covered gome is a popular desktop environment and graphical user interface that runs on top of the Linux operating system the default display manager for Gnome is called gdm the gdm display manager presents the user with the login screen which prompt for the user the login username and password loging out through the desktop environment kills all processes in your current X session and returns to the display manager login screen Linux enables users to switch between logged in sessions suspending puts the computer into sleep mode for each key task there is generally a default application installed every user created in the system will have a home directory the places menu contains entries that allow you to access different parts of the computer and the network Nautilus gives three formats to View files each each Linux distribution comes with its own set of desktop backgrounds gnome comes with a set of different themes which can change the way your applications look by the end of this chapter you should be able to apply system display and date and time settings using the system settings panel track the network settings and manage connections using the network manager in Linux install an update soft Ware Linux from a graphical interface note that we'll revisit all these tasks later when we discuss how to accomplish them from the command line the system settings panel allows you to control most of the basic configuration options and desktop settings such as specifying the screen resolution managing network connections or changing the date and time of the system for The Gnome desktop manager one clicks on the upper right hand corner and then selects the tools image the screwdriver crossed with a rinse or a gear uh depending on your distribution you may find other ways to get into the settings configurations as well you'll also find variations in the menu layout between Linux distributions and versions so you may have to hunt for the settings you need or to examine or modify to get deeper into configuration one can click on the devices on the previous menu in order to configure items like the display the keyboard the printers Etc one can also click on the users icon which may be under details to set values for system users such as their login picture password Etc a lot of personalized configuration settings do not appear on the settings menu instead you have to launch a tool called either gnome tweaks or gnome tweak tool we have not really discussed working at the command line yet but you can always launch a program such as this by doing alt F2 and typing in the command some distributions have a link to the tweaks menu in the settings but for some mysterious reason many obscure this Tool's existence and it becomes hard to discover how to modify even rather basic desk type attributes and behaviors important things you can do with this tool include selecting a theme configuring extensions which you can get from your distribution or download from the internet you can control fonts mod modify the keyboard layout and set which program start when you log in the most recent gnome versions have removed a lot of the functionality of gnome tweaks extensions now have to be configured using a new a new app called gnome extensions app the reasoning for this is obscure here you can see a screenshot from a red hat system with quite a few extensions installed but not all being used clicking on settings displays or settings devices displays will expose the most common settings for changing the desktop appearance these settings function independently of the specific display drivers you're running the exact appearance will depend enormously on how many monitors you have and other factors such as Linux distribution and particular vers if your system uses a proprietary video card driver usually from Nvidia or AMD you'll probably have a separate configuration program for that driver this program may give more configuration options but may also be more complicated and might require admin root access if possible you should configure the settings in the displays panel rather than with the proprietary program the X server which actually provid Ides the the guey uses SLC x1x org.com as its configuration file if it exists in modern Linux distributions this file is usually present only in unusual circumstances such as when certain less common graphic drivers are in use changing this configuration file directly is usually for more advanced users while your system will usually figure out the the best resolution for your screen automatically it may get this wrong in some cases or you might want to change the resolution to meet your needs you can accomplish this using the displays panel the switch the switch to the new resolution will be effective when you click apply and then confirm that the resolution is working in case the selected resolution fails to work or you're just not happy with the appearance the system will switch back to the original resolution after a short timeout once again the exact appearance of the configuration screen will vary a lot between distributions and versions but usually it's rather intuitive and easy Once you find the configuration menus in most cases the configuration for multiple displays is set up automatically as one big screen spanning all monitors using a reasonable guess for screen layout if the screen layout is not as desired a checkbox can turn on mirrored mode where the same display is seen on all monitors clicking on a particular monitor image lets you configure the resolution of each one and whether they make one big screen or mirror the same video configuring display settings such as resolution is almost identical on all major distributions so we'll demonstrate that running virtual machines under VMware on a red hat 8 host so let's begin with showing what it looks like on auntu so I go up in the upper right hand corner and I find the settings button and then uh in the main uh panel here we have displays so we've already clicked on that and you see uh the easiest thing to do here is I can change the resolution to be any one of these numbers now you can continuously vary the display size usually on a virtual machine um and by dragging and dropping the corners you see now it's changed to another number but that's all that's involved in Ubuntu for instance if I want to go to open well let's try Centos Centos uh H stream actually I find the settings once again and then here you have to scroll down to devices and then displays is in there and we have the identical setup except for this NightLight uh option which is for looking in a darker situation a which we also had in the auntu was just located in a different place on open Su you'll see it's virtually identical as well I just click on the uh settings gear button here and uh once again I have to go to devices like I did on the red hat system and I have the identical situation you couldn't tell what operating system you were on if you just looked at this now the these are all virtual machines with one terminal if I look on the host which actually has three different monitors hooked up to it you'll see then I get something like this where I can see all three of my monitors uh I can figure any one of them here it's doing the the smaller one the 18inch one but I could switch to the 27 or the 24 and I can control uh their different resolutions if I move these around here I can change the way the three of them are laid out from left to right I don't particularly want to do that uh because it gets kind of messy but this is how you can control which one's in the middle which is on the right or left Etc so these days configuring the display resolution and some other basic things is really very simple very intuitive the hardest thing is just to find the the um settings icon to click on by default Linux always uses coordinated universal time for its own internal timee keeping displayed or stored time values rely on the system time zone setting to get the proper time UTC is similar to but more accurate than green witch meantime if you click on the time displayed on the top panel you can adjust the format with which the date and time is shown on some distributions you can also alter the values the more detailed date and time settings can be selected from the date and time window in the system settings menu the automatic settings are referring to the use of network time protocol which we'll discuss next the network time protocol is the most popular and reliable protocol for setting the local time by Consulting established internet servers l distributions always come with a working ntp setup which refers to a specific time servers run or relied on by the distribution this means that no setup Beyond on or off is generally required for Network time synchronization all Linux distributions have network configuration files but file formats and locations can differ from one distribution to another hand editing of these files can handle quite complicated set but it's not very dynamic or easy to learn and use network manager was developed to make things easier and more uniform across distributions it can list all available networks both wired and wireless allow the choice of a wired Wireless or mobile broadband Network handle passwords and set up virtual private networks except for unusual situations it's generally best to let network manager establish your connections and keep track of your settings in this section you'll learn how to manage network connections including wired and wireless connections and mobile broadband and VPN connections wired connections usually do not require complicated or manual configuration the hardware interface and Signal presence are automatically detected and then network manager sets the actual network settings via Dynamic host configuration protocol or DHCP for static configurations that do not use DHCP manual setup can also be done easily through network manager you can also change the Ethernet Mac address or media Access Control address if your Hardware supports it the MAC address is a unique hexadecimal number of your network card wireless networks are usually not connected by default you can view the list of available wireless networks and see which one if any you're currently connected to by using network manager you can then add edit or remove known wireless networks and also specify which one which ones you want connected by default when present to configure a wireless network in any recent gnome based distribution click on the upper right corner of the top panel which brings up a settings and or Network window while the exactic appearance will depend on Linux distribution inv verion it will always be possible to click on a Wi-Fi submenu as long as the hardware is present here is an example from a real 8 System select the wireless network you wish to connect to if it's a secure network the first time it will request that you enter the appropriate password by default the password will be saved for subsequent connections if you click on Wi-Fi settings you will bring up this if you click on the gear icon for any connection you can configure it in more detail older and other Linux distributions may look quite a bit different in detail but the steps and choices are essentially identical as they're all running network manager with perhaps somewhat different clothing let's demonstrate how to control wired and wireless network connections on a red head system if I click on the upper right hand corner for instance if I want to look at the wired connection I can just scroll down to the wired connection and then wired settings and it asks me for my password the root the root password because it it wants to have a super user only control network connections and you'll see I have a th000 megabit connection if I click on the gear icon I can control the settings on the details first screen it says it connects automatically when the system starts and all users can use it on identity I give what the name of the interface looks like not the name of the system uh in older systems that would have been eth0 eth1 Etc but as we will discuss later newer systems have these more complex names under ipv4 we control the basic Internet Protocol system systems settings most of the time you'll leave it alone at automatic DHCP Dynamic host configuration protocol where the system figures out its address from the server Etc if you understand how the importance of manual settings you can specify an address a net mask a Gateway you can select a particular DNS server and you can specify roots to certain addresses if you understand understand those Concepts this is where you would go to control all that we're not changing anything so I'll just hit cancel now if I want to control Wi-Fi settings I could go back to that upper right corner or I can just click on the Wi-Fi setting here and once again it's asking me for the super user password these are the different wireless networks that have to be that are available at the moment they all have locks next to them means they require a password this is the one that I'm actually on Coupe J the first one and if I click on the settings there once again it's going to ask me for um my P my super user password and I see essentially the exact same settings I had on the wir connection the automatic startup as other people use it the identity and whether I want to use DHCP or set things manually or not so that's all there really is in the graphical interface to control basic network connections it's rather simple and it looks the same at all recent Linux distributions you can set up mobile broadband connection with network manager which will launch a wizard to set up the connection details for each connection once the configuration is done the network is configured automatically each time the broadband network is attached network manager can also manage manage your VPN connections it supports many VPN Technologies such as native IPC Cisco open connect via either the Cisco client or a native open source client Microsoft pptp and openvpn you might get support for VPN as a separate package from your distributor you need to install this package if your preferred VPN is not supported each package in Linux distribution provides one piece of the system such as the Linux kernel the C compiler utilities for manipulating text or configuring the network or for your favorite web browsers and email clients packages often depend on each other for example because your email client communicates using ssltls it will depend on a package which provides the ability to encrypt and decrypt SSL and TLS communication and will not install unless that package is also installed at the same time all systems have a lower level utility which handles the details of unpacking a package and putting the pieces in the right places most of the time you will be working with a higher level utility which knows how to download packages from the internet and can manage dependencies and groups for you in this section you will learn how to install and update software in Linux using the dbn packaging system used by systems such as Ubuntu as well and RPM Packaging Systems which is used by both red hat and the Susi family systems there are these are the main ones in use although there are other ones which work well for other distributions which are less used let's look at the package management for the Debian family system dpkg is the underlying package manager for these systems it can install remove and build packages unlike higher level packages Management Systems it does not automatically download and install packages and satisfy their dependencies for deviant based systems the higher level package management system is the advanced package tool or a system of utilities generally while each distribution with within the devian family uses AP it creates its own user interface on top of it for example AP kit or app kit sympatic uh yuntu software Center Etc although apt repositories are generally compatible with each other the software they contain generally is not therefore most repositories Target a particular distribution like yuntu and often software Distributors ship with multiple repositories to support multiple distributions demonstrations are shown later in this section Red Hat package manager or RPM is the other package management system popular on Linux distributions it was developed by red hat and adopted by a number of other distributions including Susi and open Susi uh C OS Oracle Linux and others the highlevel package manager differs between distributions Red Hat Family distributions historically use re or SOS and fedora uses dnf while retaining good backward compatibility with the older yum program Susi family distribution such as open Susi also use RPM but use the zipper interface the yet another setup tool or yast software manager is similar to other graphical package managers it's an RPM based application you can add remove or update packages using this application very easily to access the yes software manager first click activities then in the search box type yes and click on the yes icon then click software management you can also find yes by clicking on applications other yes which is a strange place to put it uh but open su's yes software management application is similar to The graphical package managers and other distributions uh demonstration of the Yas software manager is seen later in this section we are now going to demonstrate software package management from a graphical interface using the open Su Linux distribution the tool we want to use for doing this is yast yst and there's two different ways I can reach it if I have the gnome shell extension installed which shows the application s menu which doesn't come by default I can go down to systems tools and then go down to yes or I can always go up to the upper right hand corner click on the tool icon and then at the bottom here on the system click on yes it will want the root password CU I'm going to manipulate what's installed on the system and so if I go to software I can go to software management now the first thing that yes has to do is study the system and get a database of every possible package so it you can look at the packages on the system in different ways you can look by what's called RPM groups so here's all the games are grouped under amusements I have applications development and all different kinds of development subcategories tools documentation Etc or RPM groups that is rpm groups okay yeah pack or I can look at package groups which maybe is a little more intuitive so I could click on let's say multimedia and see all the different programs are involved in uh in dealing with multimedia suppose I want to install something or inquire as to where something is installed I can click on search and type something in here I'll type G plot and I bring up quickly all the different G plot uh pro programs there are the main one you see has a check mark in the box that means it's already installed um I will decide to install gup plot do doc which is a small documentation package and then in order to do the install I will click on accept and I we go ahead and do it it's a pretty small package it doesn't take long if you needed some other packages a function it would have installed them at the same time so now I'll say continue and if I can want to remove it because I don't really need it I'll type it that in the search again and then I click on here um until I get an X for removal and then I say accept and it's removing it so that's all I had to do to do some basic package installation and removal under gnome software with open Su pretty simple experienced Linux administrators probably do most of their package management from the command line rather than from a graphical interface however every Linux distribution has at least one graphical interface for installing upgrading removing Etc various software packages so let's take a look at a recent Ubuntu system uh I can go to Applications and then down to system tools and first let's look at the one at the bottom here which just says software this is actually a program progr called gnome software uh you can always install it if it hasn't been installed on your system it looks somewhat like an app store or Play Store from Android and uh it's pretty obvious you can click in any one of these to try to install Etc and at the bottom you'll see things are grouped by category so for instance oh I could click on utilities and then I'll see a bunch of different utilities uh that may or may not be installed on your system already okay or I could search for various things so let me go back to the main page and um if I click on The Hourglass up in the corner here I can search so let's say I search on Terminal and you'll see it'll come up with a number of different things I could install you'll see here this terminal here is the a gome terminal and it says installed in a rather small font here uh and if I wanted to install something else I could just say for instance here I could click on that and I would say install and it could just be installed or if I want something a little more fun let's say I'll look for a program called cheese which let's you use your um webcam to take pictures or or make videos Etc and I can say remove cuz it turns out it's already installed so let me remove it and it's going to want a password to do this which shouldn't be that priz surprising so I type my password and it's removing it and then uh you know if I want to reinstall it which I'll do I'll just say install and give the password again so this is not a very complex program to use uh it's pretty easy to use gome software and you notice at the top you have a list here of explore which is where you are now installed would be all your installed packages and if you do updates it's telling me the system has two sets of updates that I really should install but the save time I'll do that right now so that's one graphical interface there's a much older graphical interface that's available intu called synaptic so let's do that one uh I thought it was it's under system tools there we go synaptic package manager and once again this is going to ask for a password and uh it's an informatory message and this is actually a very simple easy to use and uh it gives you a clear uh vision of exactly where everything came from compared to the more modern graphical interfaces it's pretty straight forward to use um it's organized by either sections here I can do it in other ways I can do searching uh uh Etc so suppose I want to search well I'll do the same search your terminal and it's going to show me all the packages that either have terminal in the name or discuss terminal if I want to restrict it to ones that have only uh in the name I can do that and it's pretty straightforward to use I won't run through this these are already installed because they're in green uh I can install any of these other ones and I can just click on that and then up let's say I want to do QT terminal I would say Mark for installation and it says in order to this to work it has to install these other packages too which it depends on so we won't bother to do that and that's briefly what you can do on a auntu system with a graphical software package installations and removals you have completed Che chapter 5 so let's summarize the key Concepts covered you can control basic configuration options and desktop settings through the system settings panel Linux always uses coordinated universal time or UTC for its own internal timekeeping you can set the date and time settings from the system settings window the network time protocol is the most popular and reliable protocol for setting the local time via internet server the displays panel allows you to change the resolution of your display and configure multiple screens the network manager can present available wireless networks it allows the choice of a wireless or mobile BRB Brad Network handles passwords and sets up vpns the dpkg and RPM are the most popular package Management Systems used on Linux distributions deviant distributions use dpkg and AP based utilities for package management RPM was developed by red hat and adopted by a number of other distributions including open Susi SOS oracal Linux and others by the end of this chapter you should be familiar with common Linux applications including internet applications such as browsers and email programs office productivity Suites such as Le RA office developer tools such as compilers debug debuggers Etc multimedia applications such as those for audio and video graphic editors such as the and other Graphics utilities the internet is a Global Network that allows users around the world to perform multiple tasks such as searching for data communicating through emails and online shopping obviously you need to use Network aware applications to take advantage of the internet these include web browsers email clients streaming media applications Internet relay chats and conferencing software as discussed in the graphical interface chapter Linux offers a wide variety of web browsers both graphical and text space including Firefox Google Chrome chromium epiphany renamed web conquer links links w3m and Opera email applications allow for sending receiving and reading messages over the Internet Linux systems offer a wide number of email clients both graphical and text based in addition many users simply use their browsers to access their email accounts most email clients use the internet message access protocol or IMAP or the older pop post office protocol to access emails stored on a remote mail server most email applications always also display HTML formatted emails that include objects like pictures and hyperlinks Linux support the following types of email applications graphical email clients such as Thunderbird Evolution and Claus mail text mode email clients such as mut and mail all web browser based client cents such as Gmail yah and Office 365 Linux systems provide many other applications for performing internet related tasks these include filezilla pigeon AA and hexchat most day-to-day computer systems have productivity applications sometimes called office suites available or installed each Suite is a a collection of closely coupled programs used to create and edit different types of files such as text spreadsheets presentations graphical objects most Linux distributions offer Libra office an open- source office suite that started in 2010 and is evolved from open Office while other office suites are available as as we have listed Libra office is the most mature and it's most it's also the most widely used and intensely developed in addition Linux users have full access to internet-based office suites such as Google Docs and Microsoft Office 365 the component applications included in Libra office are writer for word processing calc for spreadsheets impress for presentations draw for creating and editing graphics and diagrams the Libra office applications can read and write non-native document formats such as those used by Microsoft Office usually Fidelity is maintained quite well but complicated documents might have some imperfect conversions Linux distributions come with a complete set of applications and tools that are needed by those developing or maintaining both user applications and the kernel itself these tools are tightly integrated and include Advanced editors customized for programmers needs such as V and emac compilers for every computer language that has ever existed including very popular new ones such as go L and rust debuggers such as GDB and various graphical front ends to it and other and many other debugging tools performance measuring and monitoring programs some with easy to ous graphical interfaces others more Arcane and meant to be used only by serious experienced development Engineers complete integrated develop environments or idees such as eclipse and visual studio code that put all these tools together on other operating systems these tools have to be obtained and installed separately often at a high cost while in Linux they are all available at no cost through standard package installation systems multimedia applications are used to listen to music watch videos Etc as well as to present and view text and Graphics Linux systems offer a number of sound player applications including amck audacity and Rhythm box of course Linux systems can also connect with commercial online music streaming services such as Pandora and Spotify through web browsers movie and video players can portray input from many different sources either local to the machine or on the Internet Linux systems offer a number of movie players including VLC imp player Zen Totem Movie editors are used to edit videos or movies link systems offer a number of movie editors including cin paint blender CA and ffmpeg graphic editors allow you to create edit View and organize images of various formats the new image manipulation program or is a feature image retouching and editing tool similar to Adobe Photoshop and it's available on all Linux distributions some features of of are it can handle any image format it has many special purpose plugins and filters it provides extensive information about the image such as layers channels and histograms in addition to there are other Graphics utilities that help perform various imag related tasks including EOG inkscape convert and scribus you have completed chapter six let's summarize the key Concepts covered Linux offers a wide variety of Internet applications such as web browsers email clients online media applications and others web browsers supported by Linux can be either graphic iCal or text based such as Firefox Google Chrome Epiphany w3m links and other others Linux supports graphical email clients such as Thunderbird Evolution and Claus mail and text mode email clients such as mut and mail Linux systems provide many other applications for performing internet related tasks such as filezilla xchat pidgen and others most link distributions offer Libra office to create an different kinds of documents Linux systems offer entire Suites of development applications and tools including compilers and debuggers Linux systems offer a number of sound players including amarok audacity and Rhythm box Linux systems offer a number of movie players including VC M player Zen and totem Linux systems offer a number of movie editors including Kino cin paint blender among others the utility is a featur rich imagery touching and editing tool available on all Linux distributions other Graphics utilities that help perform various image related tasks are EOG inkscape convert and scribus by the end of this chapter you should be able to use the command line to perform operations in Linux search for files create and manage files install and update software Linux system administrators spend a significant amount of their time at a command line prompt they often automate and troubleshoot tasks in this text environment there's a saying graphical user interfaces make easy tasks easier while command line interfaces make difficult tasks possible Linux relies heavily on the abundance of command line tools the command line interface provides the following advantages no gooey overhead is incurred virtually any and every task can be accomplished while sitting at the command line you can Implement scripts for often used or easy to forget tasks and series of procedures you can sign into remote machines anywhere on the internet you can initiate graphical applications directly from the command line instead of hunting through menus while graphical tools may vary among Linux distributions the command line interface does not a terminal emulator program emulates or simulates a standalone terminal within a window on the desktop by this we mean it behaves essentially as if you were logging into the machine at a pure text terminal terminal with no running graphical interface most terminal emulators programs support multiple terminal sessions by opening additional tabs or Windows by default on gnome desktop environments The Gnome terminal application is used to emulate a text mode terminal in window other available terminal programs include xterm console default on KDE and Terminator to open a terminal on any system using a recent gnome desktop click on applications system tools terminals or applications utilities terminal if you do not have the applications menu you will have to install the appropriate gnome shell extension package and turn it on with gnome tweaks on any but some of the most recent gnome based distributions you can always open a terminal by right clicking anywhere on the desktop background and selecting open in terminal if this does not work you will once again need to install and activate the appropriate gnome shell package you can also hit alt F2 and type in either gnome terminal or console whichever is appropriate because distributions have had a history of bearing opening up a command line terminal and the place and menus may vary in the desktop guey it is a good idea to figure out how to pin the terminal icon to the panel which might mean adding it to the favorite grouping on gnome systems there are some basic command line utilities that are used constantly and it would be impossible to proceed further without using some some of them in simple forms before we discuss them in more detail a short list has to include cat used to type out a file or combined files head used to show the first few lines of a file tail used to show the last few lines of a file man used to view documentation this screenshot shows Elementary uses of these programs note the use of the pipe symbol the vertical line you used to have one program take as input the output of another for the most part we will only only use these utilities and screenshots displaying various activities before we discuss them in detail most input lines entered at the Shell prompt have three basic elements the command the options and the arguments the command is the name of the program you are executing it may be followed by one or more options or switches that modify what the command may do options usually start with one or two dashes for example- p or-- print in order to differentiate them from arguments which represent what the command operates on however plenty of commands have no options no arguments or neither in addition other elements such as setting environment variables can also appear on the command line when launching a task all the demonstrations created have a user configured with pseudo capabilities to provide the user with administ rative privileges when required pseudo allows users to run programs using the security privileges of another user generally root the super user on your own systems you may need to set up an enable Pudo to work correctly to do this you need to follow some steps that will not explain much detail now but you will learn about later in this course when running on yuntu and some other recent distributions pseudo is already always set up for you during installation on other Linux distributions you will likely need to set up pseudo to work properly for you after the initial installation next you will learn the steps through setup and run pseudo on your system if your system does not already have pseudo set up in and enabled you need to do the following steps you'll need to make modific ations to the administrative or super user route while pseudo will become the preferred method of doing this we not have to have it set up yet so we you we will use Su which we'll discuss later in detail Instead at the command line prompt type Su and press enter you'll then be prompted for the root password so enter it and press enter you'll notice that nothing is printed this is so so others cannot see the password on the screen you should end up with a different look prompt often ending with a hashmark or a pound sign for example Su and then password uh now you need to create a configuration file to enable your user account to use Pudo typically this file is created in the /c/ Su doers. d/d directory with the name of the file as the same as your username for example for this demo let's say your username is student after doing step one you would then create the configuration file for student by doing this Echo student all equals all all and then the the directory here finally some Linux distributions will complain if you do not also change permissions on the file by doing uh chod 440 and then put the file name uh that should be it for the rest of this course if you use pseudo you should be properly set up when using pseudo by default you will be prompted to give a password you your own user password at least the the first time you do it within a specified time interval it's possible the varant secur to configure pseudo to not require password or change the time window in which the password does not have to be repeated with every pseudo command the customizable nature of Linux allows you to drop the graphical interface temporarily or permanently or to start up after the system has been running most Linux distributions give an option during installation or have more than one version of the install media to choose between desktop with a graphical desktop and server usually without one Linux production servers are usually installed without the guei and even if it is installed usually do not launch it during the system startup removing the graphical interface from a production server can be very helpful in maintaining a lean system which can be easier to support and keep secure VT or virtual terminals are console sessions that use the entire display and keyboard outside of a graphical environment such terminals are considered virtual because although there can be multiple active terminals only one terminal remains visible at a time a VT is not quite the same as a command line terminal window you can have many of those visible at once on a graphical desktop one virtual terminal usually number one or seven is reserved for the graphical environment and text logins are enabled on the unused VTS Ubuntu uses vt7 but s OAS and real and openi use vt1 for the graphical display an example of a situation where using VTS is helpful is when you run into problems with the graphical desktop in this situation you can switch to one of the text VTS and trouble shoot to switch between VTS press control alt function key for for the VT for example press control alt F6 for vt6 actually you only have to press the alt F6 key combination if you are in a VT and want to switch to another VT Linux distributions can start and stop the graphical desktop in various ways the exact method differs from distribution and among distribution versions for the newer system MD based distributions the display manager is run as a service you can stop the guey desktop with the system control utility and most distributions will also work with the uh T init command as in pseudo system control stop gdm or studo telet 3 and restart it after logging into the console with pseudo system control start start gdm Oro pseudo Talent 5 on move to versions before 18.04 LTS substitute light DM for gdm in this section we will discuss how to accomplish basic operations from the command line these include how to log in and log out from the system restart or shut down the system locate applications access directories identify absolute and relative paths and EXP for the file system an available text terminal will prompt for a user name with the string login and password when typing your password nothing is displayed on the terminal not even a an asri to indicate that you typed in something and this is to prevent others from seeing your password after you've logged into the system you can perform basic operations once your session is started either by logging into a text terminal or via a graphical terminal program you can also connect and log into remote systems by using SSH for example by typing SSH student remotes server.com SSH would control would connect securely to the remote machine or remotes server.com and give student that's the user a command line terminal window either using a password as with regular logins or a cryptographic key to sign in without providing a password to a verified the identity the preferred method to shut down or reboot the system is to use the shutdown command this sends a warning message and then prevents further users from logging in the init process will then control shutting down or rebooting the system it's important to always shut down properly failure to do so can result in damage to the system and or loss of data the Halt and power off commands issue shutdown DH to Hal the system reboot issue shutd down- R and causes the machine to reboot instead of just shutting down both rebooting and shutting down from the command line requires super user or root access when administering a multi-user system you have the option of notifying all users prior shutdown as in pseudo shutdown DH uh 10:00 shutting down for scheduled maintenance depending on the specifics of your particular distributions policy programs and software packages can be installed in various directories in general executable programs and scripts should live in the SL bin or SL user bin or/ sbin or/ user sbin directories or somewhere under slop they can also appear in the/ user looc /bin or/ user locsin or in a directory in a user's account space such as slome student /bin one way to locate programs is to employ the witch utility for example to find out exactly where the diff program resides on the file system you can do which diff SL user bin diff if which does not find the program where is is a good alternative because it looks for packages in a broader range of system directories so where is diff when you first log into a system or open a terminal the default directory should be your home directory you can PR you can print the exact path of this by typing Echo home many Linux distributions actually open new graphical terminals in the dollar China home/ desktop the following commands are useful for directory navigation let's get some practice navigating among directories at the command line so suppose I go to the temp directory cdmp I do PWD for print working directory I'm at TMP I could do go to the home directory by doing CD dollar home you see PWD now is home student if I do cd. dot I go up one level to just home another way to navigate is to use the push D and pop D commands so I could do push D temp okay and it show me my previous history I was at Temp and uh I was at home and I go to Temp now if I do pop D it puts me back at the home directory another thing I can do is CD Dash and that takes me to the previous directory just like popd did so that's some basic day-to-day practices of navigating directories that one does all the time on a Linux system there are two ways to identify paths absolute path name which an absolute path name begins with the root directory and follows the tree branch by Branch until it reaches the desired directory or file Absolut paths always start with a slash or the relative PA path name a relative path name starts from the present working directory relative paths never start with a slash multiple slashes between directories and files are allowed but all but one slash between elements in the path name is ignored by the system so if you have a bunch of slashes it's valid but it's just seen as just having a single slash by the system most of the time it's most convenient to use relative paths which require less typing usually you take advantage of the shortcuts provided by use dot for present directory do dot for Parent Directory or the tilty for your home directory for example suppose you're currently working in your home directory and wish to move to the/ user spin directory the following two ways will bring you to the same directory from your home directory there is the absolute path name method and the relative path name method in this case the absolute path name method requires less typing traversing up and down the file system tree can get tedious the tree command is a good way to get a bird's eye view of the file system tree use tree- D just to view just the directories and to suppress listing the names the following commands can help in exploring the file system let's get started with how to explore the file system to access SL USR looc from the/ USR directory using absolute path at command prompt type cd/ USR SL looc SL live and press enter go back to/ USR directory by typing cd/ USR and press enter to access SL USR looc from the/ USR directory using relative path at command prompt type CD local /li and press enter get to the root directory at the command prompt type the cd/ command and press enter to get a list of the files and directory in the present working directory at the command prompt type the ls command and press enter to get a list of hidden files and hidden directories at the command prompt type the ls- a command and press enter to get a tree view of the file system at the command prompt type the tree command and press enter to get a treeview of only directories in the file system at the command prompt type the tree- d/ command and press enter the inutility is used to create hard links and with the- s option soft links also known as symbolic links or Sim links these two kinds of links that are very useful in Unix based operating systems suppose that file one already exists a hard link called file two is created with the with this command note that two files now appear to exist however a closer inspection of the file listing shows that this is not quite true so we'll do ls- Li file one name file two and the- I option to LS prints out in the First Column the inode number which is a unique quantity for each file object this field is the same for both these so what is really going on here is that there's only one file but has more than one name associated with it as indicated by the two that appears in the ls output thus there was already another object linked to file one before the command was executed hard links are very useful and they save space but you have to be careful with their use sometimes in subtle ways for one thing if you remove either file one or file two in the example the inode object and the remaining file name will remain which might be undesirable as it may lead to subtle errors later if you recreate a file of that name if you edit one of the files exactly what happens depends on your editor most editors including V and gedit will retain the link by default but it's possible that modifying one of the names may break the link and result in the creation of two objects soft or symbolic links are created with a-s option as in ln- s file 1 file 3 or ls- Li file one file three notice file three no longer appears to be a regular file and it clearly points to file one and has a different enode number symbolic links take no extra space on the file system unless their names are very long they're extremely convenient as they can easily be modified to point to different places an easy way to create a shortcut from your home home directory to long path names is to create a symbolic link unlike hard links soft links can point to objects even on different file systems partitions and or Diss and other media which may or may not be currently available or even exist in the case where the link does not point to a currently available or existing object you obtain a dangling link the CD command remembers where you were last and let you get back there with CD dash for remembering more than just the last directory visited use push D to change the directory instead of CD this pushes your starting directory onto a list using popd will then send you back to those directories walking in reverse order the most recent directory will be the first one retrieve with popd the list of directories is displayed with the dur command Linux provides many commands that help you with viewing the contents of a file creating a new file or an empty file changing the timestamp of a file and moving removing and renaming a file or directory these commands help you in managing your data and files and and in ensuring that the correct data is available at the correct location in this section you will learn how to manage files let's get a feel for how to look at some of the lines in a given text file on your machine so we have on all our Linux Foundation virtual machines a file called Ready for. sh which I'm using word count to show me it has 5,127 lines if I just want to type the whole file out I could do that with the cat utilities so let me just do that but it went very very fast and in fact if I do cat dasn it shows me the line numbers as it goes and it is indeed 5127 the way to page your way through is to use the less utility so then I would do less ready forsh and then I get one screen at a time if I hit the space bar I see the second screen third screen Etc and I can keep going all the way through the file as fast as I want and by the way I can also do the less- capital in option and then I also get line numbers I did with cat Dash in so similar thing now suppose I just want to look at the first few lines of the file I could do head ready4 Dosh and you see that only gave me I believe 10 lines if I wanted to get 20 lines I could just give that as an argument okay so there we see the first 20 lines likewise with tail by default I get the last 10 lines if I wanted to see the last 20 lines I would do tail -20 and if you want to have some fun you can use the TAC utility where you'll notice that Tac is cat backwards and that just gives do the entire file backwards so these are day-to-day utilities one uses just to look at the contents of text files touch is often used to set or update the access change and modify times of files by default it resets a file's timestamp to match the current time however you can also create an empty file using touch uh like this touch and then the file name this is normally done to create an empty file as a placeholder for a later purpose touch provides several useful options for example the- T option allows you to set the date and timestamp of the file to a specific value as in touch DT and then we put the value uh and then the file name maker is used to create a deck directory such as maker samper it creates the sample directory named samper under the current directory maker user samper will create a sample directory called samper under SL user removing a directory is done with rmd or remove directory the directory must be empty or the command will fail to remove a directory and all of its contents you have to do rm-rf note that MV B does double duty in that it can simply rename a file or move a file to another location while possibly changing its name at the same time if you're not certain about removing files that match a pattern use Supply it's always good to run RM in interactively rm-- I to prompt before every removal rmd IR Works only on empty directories otherwise you get an error so while typing rm-- RF is a fast and easy way to remove a whole file system tree recursively it's extremely dangerous and should be used with the utmost care especially when used by root recall that recursive means drilling down through all subdirectories all the way down a tree the PS1 variable is the character string that is displayed as the prompt on the command line most distributions set PS1 to a known default value which is suitable in most cases however users may want custom information shown on the command line for example some system administrators require the user and the host system name to show up on the command line as in this example this could prove useful if you're working in multiple roles and want to be always reminded of who you are and what machine you are on the prompt above could be implemented by setting the PS1 variable to the following for example you could do that with this command here by convention most systems are set up so that the root user has a pound sign as their prompt let's gain some experience with day-to-day basic fire file operations on a Centos stream system this would be the same on any Linux system so first let's create a couple of files uh they could be empty or they could be small uh one way to do it is to use the echo command and just say Echo and direct actually nothing into file one another way to do it is with the touch command I'll say Touch file two then if I do ls- a file one and file 2 I see two very small files that are both created uh at the same time basically uh if I want to rename one of them I could rename it with the move command like move file one to file one new name and then if I do ls- L star file star I see there it is uh it it it it has the new name now if I want to remove them I can simply say RM File 2 and it just work it's a good idea though to always use the eye option for interactive when doing removal then I would say rm- I file one new name and it'll ask me if I really want to do it uh many distributions will set up the eye option to be the default so that you always have a chance uh to change your mind about removing something before you do it now how would I make a directory I could do make deer uh deer one in fact I can make more than one directory on the same line I can do make deer deer 2 and deer 3 and if I look now I see I have three different directories they're all actually empty so let me put a couple of files in one of the directories so I'll do touch deer 2 to file one and I'll do touch deer to file two so if I do ls- LR just to see everything that's there in the directory files uh so I'll see deer one is empty deer 2 has these two files and deer three uh is also empty now the command for removing directories is RM deer so let's say I just try to remove them all with a RM deer deer star uh you notice it got rid of deer 1 and deer 2 but it couldn't remove deer deer 1 and deer 3 I should say it couldn't get rid of deer 2 because there's files in it to do that instead of using RM deer I would say RM RF deer 2 and then that goes and descends into the directory and gets rid of all the files be very careful with the rm-rf uh command because if you give the bad argument you could even wipe out your whole system but that is the standard way to get rid of a whole directory Tre so that's just some of the very basic commands for renaming files moving them creating directories removing them Etc when commands are executed by default there are three standard file streams or descriptors always open for use standard input standard output and standard error usually standard in input is your keyboard and standard output and standard error are printed on your terminal standard error is often redirected to an error logging file while standard in is supplied by directing input to to come from a file or from the output of a previous command through a pipe standard out is also often redirected into a file since standard error is where error messages are written usually nothing will go there in Linux all open files are represented internally by what are called file descriptors simply put these are represented by numbers starting at zero standard in is file descriptor zero standard out is file descriptor one Standard air is file descriptor 2 typically if other files are opened in addition to these three which are open by default they will start at the file descrip scriptor 3 and increase from there in the next section and in the chapters ahead you'll see examples which alter where a where a running command gets its input where it writes its output or where it prints diagnostic or error messages through the command shell we can redirect the three standard file stream so that we can get input from either a file or another command instead of from our keyboard and we can write output and errors to files or use them to provide input for subsequent commands for example if we have a program called do something that reads from standard in and writes to standard out and standard error we can change its input source by using the less than sign followed by the name of the file to be consumed for input data here's an example if you want to send the output to a file use the greater than sign as in this example because standard error is not the same as standard out air messages will still will still be seen on the terminal windows in the above example if you want to redirect standard error to a separate file you use standard errors file descriptor number two the greater than sign followed by the name of the file you want to hold everything the running command writes to standard error so here's how you would do that a special shorthand notation can send anything written to file descriptor 2 standard erir to the same place as file descriptor one standard out you can do it like this bash perits an easier Syntax for the above which is like so the unix/linux philosophy is to have many simple and short programs or commands cooperate together to produce quite complex results rather than have one complex program with many possible options and modes of operation in order to accomplish this extensive use of pipes is made you can pipe the output of one Commander program into another as its input in order to do this we use the vertical bar pipe symbol between commands as in this example here this represents what we often call a pipeline and allows Linux to combine the actions of several commands into one this is extraordinary efficient because Command 2 and command 3 do not have to wait for the previous pipeline commands to complete before they can begin hacking at the data in their input streams on multiple CPU or core systems the available computing power is much better utilized and things get done quicker furthermore there is no need to save output in temporary files between the stages in the pipeline which saves disk space and reduces reading and writing from disk which is often the slowest bottleneck in getting something done being able to quickly find the files you are looking for will save you time and enhance productivity you can search for files in both your home directory space or in any other directory or system or or location on the system the main tools for doing this are the locate and find utilities we'll also show how to use wild cards and Bash in order to specify any file which matches a given generalized request the locate utility program performs a search taking advantage of a previously constructed database of files and directories on your system matching all entries that contain a specified character string this can sometimes result in a very long list to get a shorter and possibly more relevant list we can use the grep program as a filter grep will print only the lines that contain one or more specified string as in this example which will list all the files and directories with both zip and Bin in their name we'll cover grap in much more detail later notice the use of the pipe or the vertical line to pipe the two commands together locate utilizes a database base created by a related utility update DB most Linux systems run this automatically once a day however you can update it at any time by just running update DB from the command line as the root user let's get some practice with locating and finding files on an Ubuntu system so suppose I want to find all files that have the string lfs 300 in them so I could do locate lfs 300 and it finds indeed just one file that's in the home student directory on the subd directory there and I could also find it by doing find dot meaning the current directory name lfs 300 star and then I'll see it finds it and if I want to find out a little more I can give the ls option which will show me who owns it what group they're in the length of the file the iode the date Etc now if I create another file just by doing Echo into lfs 300 so it creates essentially an empty file the find command will find the new file as well as the old one but the locate command will not because I need to update the database that uh that the locate command uses and I do that by running as roots so I need SU do as you do update DB and that was pretty quick uh and then I say locate it now it finds both files okay and um just to get rid of the file I didn't really need I'll remove it I run update DB again well I need it to be root so I have to say s you do and then once again locate fs300 won find this new file now I can configure update DB and locate to do a bunch of things so if I go to the ETC directory you'll see there's a file called update db. com and it controls where update DB does not look where locate does not look so for instance under prun task it says don't look in these places like the temp directory because they're temporary and you don't want to keep TR of what's there particularly and prun Fs these are file systems really pseudo file systems that are not real file systems that you shouldn't look in because they're also the uh contents change every time you boot let's say uh so for instance you don't look in the proc directory or the CIS FS directory or the dev directory uh well Dev FS directory because these things disappear every time you reboot uh and so that's pretty easy to configure there's some other things you can do which you can learn by looking at the documentation on your system you can search for a file name containing specific characters using wild cards to search for files using the question mark Wild Card replace each unknown character with question mark for example if you know only the first two letters are ba of a three-letter file name without an extension you can type this to search for files using the Wild Card replace the unknown string with the aster for example if you remember only that the extension was out type LS as. out let's get some experience using wild cards on an auntu system so I've gone to the VAR log directory and let me just do an LS to see what's there so for instance uh let me use the DU or dis usage utility which tells me all the bytes that are being used by a given file or subdirectory I could do something like D.S H uh AAR and you'll see these are all the different things under a uh some are directories like app the others are just files if I only wanted to look at ones which have log in the name I could do du s s h a star log star and so only ones that have log and their names if I only wanted to look at the ones that start from the letter P or later in the alphabet I could do du. sh a and then I could say uh square brackets p through Z Star you see it neglected the alternative one uh which would have done that if I just want to look at uh ones which have a certain character in them I could do something like duar do uh one character do star so those are all the ones that have a substring in them with one character uh here it's always a number but it wouldn't have to be um surrounded by periods on both sides now you have to be careful with wild cards that the system doesn't quote glob what you are doing the string that you are putting in so to give you an example uh you'll notice there's a bunch of different files here that start with the name VMware well they're all over in the right column here so suppose I try to do uh uh appg install VMware star and I should make that Su do well it's actually looking for packages with all these names like VMware Network one VM VSC Route 2 that log and there are of course no packages with silly names like that but I could do something like this now let me put the VMware star in quotes and you see it actually uh did find things it found two packages VMware NSX common VMware manager and it wants to install them and it needs these other Utilities in order for them to work uh I'm not going to do this because I don't need these guys so I'll just say no so when you put something in quotes it says don't look in the current directory to like fill out the names to expand what you're doing uh instead looking in this case in the database of packages um so you have to be careful and you'll often see people use quotes even when there's no need for them just to be safe so that's a little bit of demonstration of the use of wild cards find is an extremely useful and often used utility program in the daily life of a Linux system administrator it recurses down the file system tree from any particular directory or set of directories and locates files that match specified conditions the default path name is always the present working directory for example administrators sometimes scan for potentially large core files which contain diagnostic information after a program fails they're more than several weeks old in order to remove them it's also common to remove files that are not essential or that are outdated in the/ TMP directory especially those that have not been accessed recently many Linux distributions use shell scripts that run periodically through cron to perform such house cleaning when no arguments are given find list all files in the current directory and all of its subdirectories commonly used options to shorten the list include - name which only list files with a certain pattern in their name - iame also ignore the case of the file names and dash type which will restrict the results to files of a certain specifi type such as D for directory L for symbolic link or F for a regular file here's how you can search for files and directories named GCC here's how to search only for directories named GCC here's how to search for only for regular files named GCC another good use of find is being able to run commands on the files that match your search criteria the dash EXA option is used for this purpose to find and remove all files that end with s swp you can use this the squiggly brackets are a placeholder that will be filled with all the file names that result from the find expression and the proceeding command will be run on each one individually please note that you have to end the command with either a semicolon including the single quote or a SL semicolon both forms are fine one can also use the- okay option which behaves the same as- exact except that fine will prompt you for permission before executing the command this makes it a good way to test your results before blindly executing any potentially dangerous commands it is sometimes the case that you wish to find files according to attributes such as when they were created last used or based on their size it's easy to perform such searches to find files based on time you can use this here- C time is when the enode metadata or the the file in ownership that permissions last change it's often but not necessarily when the file was first created you can also search files based on when they were accessed or last read or based on when they were modified or last written the number is the number of days and can be expressed in either a number n that means exactly that Value Plus n which means greater than the number or minus n which means less than that number there are similar options for times and minutes as in the- cmen D aen and DM Min to find files based on sizes you can do this note that the size here is in 52 byte blocks by default you can also specify bytes kilobytes megabytes gigabytes Etc as with the time numbers above file sizes can also be exact numbers for details consult the man page to finded for example to find files greater than 10 megabytes in size and running a command on those files you can use this command let's gain some experience using a very powerful find utility on a nobuntu system and I'll work in the VAR log directory so suppose I wanted to see every file here that's uh underneath our log and let me do it as Su do because otherwise it will give me error messages about not having permissions to look at some files so do s you do find Dot and I get a very long list of every single file and directory that's underneath here if I wanted to restrict it just to directories I would do type D and you'll see this just shows me the directories and subdirectories okay cuz like some of them like live vert have multiple directories if I add to that another parameter Max Def One you see it suppressed the subdirectories here I only see live ver now so I only went down a depth of one and actually I could do two three or whatever is necessary though here it doesn't go that deep anyway now you can always add commands um to any fine command so I could do fine DOT type f and then I can say exact grip DH uh log and I put in that parentheses uh pair there and then let's say slash um semicolon you can also do a single Dash semicolon single Dash and it search to every single file that had the word log in it and printed out all the different things that were there or to keep it a little simpler I could have done exec just ls- L and it would give me listings of all these files okay now there actually is a LS option built into find so I didn't really have to do that and it will just show me that kind of information there's other things things I can do like find size zero it's finding all the files I should have done Su do but all the files that have a size of zero and if I want to verify that I'll add the ls option you see these are all files of the name with size zero uh you can also do things like find uh let's say I want to find everything that's newer than this file BM here I could do something like Su do find. uh newer B temp and it show me everything that's been done since then there's a million options to find you can be used on a lot of complicated ways you can negate any parameter you want to put in by saying not uh you can combine uh different search criteria and I recommend heavily that you really read up on mind if you're going to use it CU it's a little hard to describe in a few seconds but there's a million things you can do with it the core parts of a Linux distribution and most of its add-on software are installed via the package management system each package contains the files and other instructions needed to make one software component work well and cooperate with the other components that comprise the entire system system packages can depend on each other for example a package for a web-based application written in PHP can depend on the PHP package there are two broad families of packages package managers those based on Debian and those which use RPM as their low-level package manager the two systems are incompatible but broadly speaking provide the same features and satisfy the same needs there are some other systems used by more specialized Linux distributions in this section you will learn how to install remove or search for packages from the command line using these two package Management Systems both package Management Systems operate on two distinct levels a low-level tool such as dpkg or RPM takes care of the details of unpacking individual packages running scripts getting the software installed correctly while a highle tool such as aptg dnf yum or zipper works with groups of packages downloads packages from the vendor and figures out dependencies most of the time users need to work only with the highlevel tool which will take care of calling the low-level tool as needed dependency resolution is a particularly important feature of the highlevel tool as it handles the details of finding and installing each dependency for you be careful however as installing a single package could result in many dozens or even hundreds of dependent packages being installed the advanced packaging tool apt is the underlying package management system that manages software on Deviant based systems while it forms the back end for graphical package managers such as the yuntu software Center and synaptic its native user interface is at the command line with programs that include apt or appg and apt cach dnf is the op Source command line package management utility for the RPM compatible Linux systems that belongs to the red hat family dnf has both command line and graphical user interfaces Fedora and real 8 replaced the older yum utility with dnf thereby eliminating a lot of historical baggage as well as introducing many nice new cap abilities dnf is pretty much backwards compatible with yum for day-to-day commands zipper is the package management system for the Susi or open Susi family and it's also based on RPM zipper also allows you to manage repositories from the command line zipper is fairly straightforward to use and resembles dnf or yum quite closely to learn the basic package commands take a look at these basic packaging commands let's get some practice with the basic low-level command for the Debian packaging system dpkg or D package so to get a list of all the pack packages on the system I can simply type dpkg d-list and I'll just pipe that into list because it's a long list okay actually if I don't use list for some reason it's more compact okay so there are a lot of different packages on the system now if I want to see some information just about a particular package I could just grap let's say bzip 2 to see what's going on with bzip 2 and that's the information about bzip 2 that tells us the version number the architecture which here is amd64 and it's description as a highquality block sorting file compressor utility so it's a more advanced program with better compression than gzip or the oldfashioned zip program if I want to see what's actually contained in that package I can do DP kg list files and then the name of it and then I'll go slower by putting it into less and you'll see there's the executables in the bin directory and then what's under user is basically documentation under user share doc user sh man Etc if I try to remove the package let's see what happens so do su do dpkg I of course have to have root privilege to remove the package so I'm removing bzip 2 D package remove bzip 2 and it's telling me I cannot do this because I need the develop in package dpkg-dev that would be headers and stuff for programs which use uh this in a library version and firew raller with which is a archive extraor that's common on Linux systems so I would have to remove all three of them we'll see later when we use tools like appg it's easier to deal with these dependencies but now get some practice using the low-level RPM command in order to look at a package try to remove it Etc so we're going to type RPM dqa for query and look at all packages on the system and then then we're going to grip to look for the package bzip 2 okay and you see there's actually two RPM packages which have bzip 2 in there names the actual bzip 2 program and then bzip 2 lives which is libraries that depend on bzip 2 so let's take a look more at information about bzip 2 if I do RPM if I do RP m-q for query I for information and then L for a list of files and that's a lot so I'll pipe it through less oops I forgot to give the name of the package so bzip 2 you see the name is bzip 2 you see it's version 1.06 um we see it's Source RPM here we see when it was released in November 2015 at of sos.org and then a description of what it does it's a freely available patent-free highquality data compressor Etc and then a list of the files that are part of bzip 2 if I want to get a little bit more detailed look at what's in there I could do something a little fancier like RPM that Q L be zip 2 we just list the files and then uh I'll make that a shell command and substitute for it and do an ls- LF on that so this will give me a detailed listing and then I'll pipe it into less and these are actual files that are in the package in a little bit more detail like their length and what type of files you'll notice for instance B unzip 2 and bzip 2 are really the same file it's just a symbolic link and the system knows what to do or I should say the application knows what to do whether to zip or unzip depending on how it's called now let's see what happens if I try to remove the package so I I would should be a root to do that so do an Su do and then I'll do RPM d e for erase and then just to be extra careful I'll use the dash dash test which means it won't actually do anything with this option it'll just see if it could do it bzip 2 so I try to remove it and it's telling me that I can't do that because it's need by those following three packages as well as the file roller program uh which is an archiving program present on basically all Linux distributions and then I can get a little more information in a different way with RPM dq-- what provides BZ zip 2 and you'll see it's the bzip 2 package and if I do what requires I get the same information about the three packages that would like that need to have bzip 2 installed for them to behave properly and not crash or anything a little bit later we're going to discuss yum and zipper and also dnf which are higher level programs that can handle dependencies in robust fashion RPM is really designed for individual packages which are listed on the command line or groups of packages listed on the command line let's get some practice using dnf from the command line on a recent Fedora system so in order to do that first we'll have to bring up the command line so I'll do that with activities and I'll click on the terminal icon at the bottom and I got a nice command line terminal and I'll make it a little bit bigger because the the fonts bigger that is because uh it's hard to see with the smaller fonts and then first let's get a list of all packages that have the string bzip 2 in their name so I'll do that with dnf list and the first packages that will come up will be the ones that are already installed so let me scroll up a little because there's a really long list here so there I have the actual program bc2 a development package in case I want to write code that uses bzip 2 in internally and then uh bzip 2 lives would be used by programs that have bzip 2 in already built into them the two I'm going to be interested in installing here are the lb zip2 packages bzip 2 is a parallel version of bzip 2 that can separate the amount of work into a number of pieces that can be done simultaneously so for instance if you had four processors or cores you could split the work up into four pieces and do them all at the same time and then merge them at the end and in theory it could run almost four times as quickly so let's try to install the utilities package I'll do su do dnf install Live bzip 2 yeah I guess it's lb zip2 bzip 2 utils and you'll see yes it's happy to do that but it also needs the lb zip 2 package which it depends on so I say yes I'll just type Y and it will install the two packages um I probably have a program now called lb zip 2 but let's check if that's the case with which and yes I do so I could go ahead and use it now if I wanted if I don't really want these install and I want to clean up with them I could do um something like Su do dnf remove lb zip 2 and you notice it's happy to remove it but it's telling me that because lb zip 2 utils depends on lb zip 2 if I remove lb zip 2 I better remove them both otherwise I'll have an unsatisfied dependency so I'll just say yes so that's just a really simple uh example of using dnf in the command line unfortunately recent redhead based systems do not have a really good graphical package management utility pedora has something called dnf Dragon but it can be rather slow to load and a little bit buggy and there's nothing at all for Red Hat 8 or Centos S8 so experienced developers will just always tend to do things from the command line let's demonstrate some basic package management functions on an open Su system using the zipper utility so first first let's look for all packages with zipper search that have the string new clot in them and we see a number of packages let's concentrate on the documentation package so suppose I try to install that and for that I have to be a super user for an installation so I do su do zipper install new plot Dot and you notice it's telling me I not only have to install new plot. do I would have to install new plot which is the actual program that new plot. do-to uh documents so I'll say sure yes and it's been done successfully if I want to get some information about the package I can do RPM dqi new plot dto and for this once again I do not have to be root and it's telling me the name the version the size all sorts of things and under the purpose it's telling me it concludes the man and the info Pages for this rather useful plotting program now suppose I want to remove this package I can do zipper remove G new plot let's say I try to remove gplot not not new plot. th and it's telling me that if I remove new plot I also have to remove new plot. do- do because otherwise there would be unmet dependency so say yes for sure and now both of them are gone so that's basic steps you would take to look for package install it get some information about it and remove it using zipper so let's do some basic package Management on an auntu system using Debian packaging we're going to use the high level utilities which understand dependencies app cash and appg so first let's look for all packages that contain the string W get 2 so we do that with app cash search W get2 and it comes up with WG 2 and W get2 Dev this is uh an enhancement to the standard W get utility which is used for recursive downloading of the content of a website or some other kinds of uh resources so let's just try and install so I do su do get install W get2 ddev and it's telling me it also needs to install W live W get 0 and W get 2 it shouldn't be that surprising that you need to install the base packages on which the development packag is built on and it will download 264 kilobytes of archives but once everything's installed it will expand out to 805 kilobytes so let's just say yes I'll type Y and it quickly goes ahead and does all that now suppose I want remove W get to Dev well more interesting let's try to remove W get uh itself so what does it doing oh I shouldn't have removed W get I meant W get two w get I do not want to remove so I'll type it again with the two and you see it wants to remove W get to Dev as well because without W get W get2 Dev isn't have much meaning okay and we no longer need live W get zero um it's sort of offened out but we'll leave it there for now so I'll just say yes and I have removed things from my system so that's the most basic operations you would need to do on an Ubuntu system using Debbie and packaging you have completed chapter 7 let's summarize the key Concepts we covered virtual terminals or VT and Linux are consoles or commandline terminals that use the connected Monitor and keyboard different Linux distributions start and stop the graphical desktop in different ways a terminal emulator program on the graphical desktop works by emulating a terminal within a window on the desktop the Linux system allows you to either log in via text terminal or remotely via the console when typing your password nothing is printed to the terminal not even a generic symbol to indicate that you typed the preferred method to shut down or reboot the system is to use the shutdown command there are two types of path names absolute and relative an absolute path name begins with the root directory and follows the tree branch by Branch until it reaches the desired directory or file a relative path name starts with the present working directory using hard and soft symbolic links is extremely useful in Linux CD remembers where you were last and lets you get back there with CD Dash locate performs a database search to find all file names that match a given pattern find locates files recursively from a given directory or set of directories find is able to run commands on the files that it lists when used with the DX exec options touch is used to set the access change and edit time to files as well as to create empty files the advanced package tool packaging tool AP this package management system is used to manage installed software on dbm based such systems you can use the dnf command line package development utility for the RPM based Red Hat Family Linux distributions the zipper package management system is based on RPM and used for open Susi by the end of this chapter you should be able to use different sources of documentation use the Man pages access the new info system use the help command and the d-el option use other documentation sources whether you are an inexperienced user or a veteran you'll not always know or remember the proper use of various Linux programs and utilities what is the command to type what options does it take Etc you'll need to consult help documentation regularly because Linux based systems draw from from a large variety of sources there are numerous reservoirs of documentation and ways of getting help Distributors consolidate this material and present it in a comprehensive and easy to use manner important Linux documentation sources include the Man pages short for manual pages new info the help command and Das Das help option other documentation sources like the ginu handbook The Man pages are the most often used source of Linux documentation they provide in-depth documentation about many programs and utilities as well as other topics including configuration files and programming apis for system calls library library routines and the kernel they are present on all Linux distributions and are always at your fingertips the M Pages infrastructure was first introduced in the early Unix versions in the beginning of the 1970s the name man is just an abbreviation for manual typing man with a topic name as an argument retrieves the information stored in the Topic's Man pages the man program searches formats and displays the information contained in the man page system because many topics have copious amounts of relevant information output is piped through a pager program such as less to be viewed one page at a time at the same time the information is formatted for a good visual display a given topic may have multiple Man pages associated with it and there is a default order determining which one is displayed when no options or section number is specified to list all pages on the topic use the- f option to list all pages that discuss a specific topic even if the specified topic is not present in the name use the d-k option let's use the Manu ility to get some information about sockets on our system if I just type man socket I get chapter two of the Linux programmers manual I get the page in there in chapter two that has to do with sockets and this is a pretty General page that tells me a lot of information about sockets and different protocols that they can use if I want to get a list of all the pages that are called socket I do man- focket you'll see there's actually five of them in different chapters that by the way is exactly the same as saying what is Socket so man DF and apropo are the same if I want to see a particular page say chapter 7 I can do man 7 socket and I'm getting the man page in chapter 7 which is rather detailed if I want to see them all at once I can see man- a socket for all I guess and I can space my way through through this one if I hit Q it's telling me if I hit return I'll see the next one 3p so let's do that I'll hit Q again you see if I want to get out rather than going through the rest of them the next one would be seven I can hit contrl Ctrl D would just skip the next one if I want to see all Man pages that have the word socket in their Des basic description I do that with man- K and it's a rather list because sockets are pretty basic and involve all sorts of things on your system man- K is exactly the same just type it appropo socket and I get the exact same thing so that's just some basic day-to-day functioning of using man to get information you should play around with different Man pages and look at the real contents in them and see how they differ from page to page the next source of Linux documentation is the new info system this is the new project standard documentation format which it prefers as an alternative to man the info system is basically free form and supports linked subsections functionally info resembles man in many ways however topics are connected using links even though its design predates the worldwide web information can be viewed through either a command line interface a graphical help utility printed or viewed online typing info with no arguments in a terminal window displays an index of available topics you can browse through the topic list using the regular movement Keys arrows page up and page down you can view help for a particular topic by typing info topic name the system then searches for the topic in all available info files some useful keys are Q to quit a for help and enter to select a menu item the topic which you view in an info page is called a node this table lists the basic keystrokes for moving between nodes nodes are essentially sections and subsections in the documentation you can move between nodes or view each node sequentially each node may contain menus and links subtopics or items items function like browser links and are identified by an aster at the beginning of the item name named items side menu are identified with double colons at the end of the item name items can refer to other nodes within the file or to other files let's gain some experience using the info command for documentation so suppose I type info make I will get information about the make utility used by all programmers and this takes me to the top of the info page or the head node if I want to look for a particular topic I can hit slash and you'll see at the bottom it's prompting me for search so I'll say example and it brought me down here to rule example if I just hit return I get that page now at the top you'll notice it says the not is root example the next one is Rule syntax so if I hit an N I get the rule syntax it says the next one is prere quisite types if I hit n again I get prerequisite types if I hit P I will go back to the previous one so I hit beat rule syntax if I want to look again for example I can just hit the slash again and it it's prompting me for the same string so I'll just hit return and I'm finding a later example about wild card examples and if I hit return I find out above that if I want to go all the way up I can hit a u it takes me to the top of section 4.4 I hit you again I'm at chapter 4 I hit youu again I'm at the very top of everything if I want to get information on the various key stroke bindings I can hit an H for help and you'll see in the bottom window where the focus is shifted to it lists all the possible key strokes and what they can do so that's basically how I would use info if I hit Q I am out of it and the rest you can learn by navigating within the info page of any topic that interests you another important source of Linux documentation is the use of the --el option most commands have an available short description which can be viewed using the --el or the DH option along with the command or application for example to learn more about the man command you can type man- dhel the d-el option is useful as a quick reference and it displays information faster than the man or info pages when running within a bash command shell some popular commands such as Echo and CD actually run especially built-in bash versions of the commands rather than the usual binaries found on the file system it's more efficient to do so as execution is faster because as fewer resources are used one should note that there can be some usually small differences in the two versions of the command to view a synopsis of these built-in commands you can simply type help as shown in this screenshot for these built-in commands help performs the same basic function as the DH and --el arguments perform for Standalone programs in addition to the Man pages the new info system and the help command there are other sources of Linux documentation some of some examples of which include desktop help system package documentation and online resources you have completed chapter 8 let's summarize the key Concepts covered the main sources of Linux documentation are the Man pages new info and the help option and commands and a rich variety of online documentation sources the man utility searches formats and displays Man pages The Man pages provide in-depth documentation about programs and other topics about the system including configuration files system calls Library routines and the kernel the new info system was created by the new project as a as its standard documentation it's robust and it's accessible via command line web and graphical tools short descriptions for commands are usually displayed with the -8 or d-el argument you can type help at the command line to display a synopsis of built-in commands there are many other help resources both on your system and on the Internet by the end of this chapter you should be able to describe what a process is and distinguish between types of processes enumerate process attributes manage processes using PS and top understand the use of load averages and other process metrics manipulate processes by putting them in background and restoring them to foreground use at cron and sleep to schedule processes in the future or pause them a process is simply an instant of one or more related tasks threads executing on your computer it's not the same as a program or a command a single command may actually start several processes simultaneously some processes are independent of each other and others are related a failure of one process may or may not affect the others running on the on the system processes use many system resources such as memory CPU cycles and peripheral devices such as network cards hard drives printers and displays the operating system especially the kernel is responsible for allocating a proper share of these resources to each process and ensuring overall optimized system utilization a terminal window one kind of command shell is a process that runs as long as needed it allows users to execute programs and access resources in an interactive environment you can also run programs in the background which means they become detached from the shell processes can be of different types according to the task being performed here are some different process types along with their descript descriptions and examples a critical kernel function called the scheduler consistently shifts processes on and off the CPU sharing time according to the relative priority how much time is needed and how much has already been granted to a task when a process is in a so-called running state it means it's either currently executing instructions on a CPU or it's waiting to be granted a share of time a Time slice so it can execute all processes in this state reside on what is called a run que and on a computer with multiple CPUs or cores the there's a run que on each CPU or core however sometimes processes go into what is called a sleep State generally when they're waiting for something to happen before they can resume perhaps for the user to type something in this condition a process is said to be sitting in a weight queue there are some other less frequent process States especially when a process is terminating sometimes a child process completes but its parent process has not asked about its state amusingly such a process is said to be called a said to be in a zombie State it's not really alive but still shows up in the systems's list of processes at any given time there are always multiple processes being executed the operating system keeps track of them by assigning each of each a unique process ID or p number the p is used to track process State CPU usage me memory use precisely where resource are located in memory and other characteristics new PS are usually assigned in ascending order as processes are born thus P1 denotes the init process and and su su succeeding processes are gradually assigned higher numbers the table explains the P ID types and their descriptions at some point one of your applications may stop working properly how do you eliminate it to terminate a process you can type kill Das Sig kill P ID or K-9 PID note however you can only kill your own processes those belonging to another user are off limits unless you're root many users can access a system simultaneously and each user can run multiple processes the operating system identifies the user who starts the process by the real user ID or the ru ID assigned to the user the user who determines the access rights for the users is identified by the effective uid the euid the euid may or may not be the same as the ruid users can be categorized into various groups each group is identified by the real group ID or the RG ID the access rights of the group are determined by the effective group ID the EG ID each user can be a member of one or more groups most of the time we ignore these details and just talk about the user ID the U ID and the group ID GID at any given time many processes are running on the system however a CPU can actually accommodate only one task at a time just like a car can have only one driver at a time some processes are more important than others so Linux allows you to set and manipulate process priority higher priority processes get preferential access to the CPU the priority for a process can be set by specifying a nice value or niceness for the process for the the lower the nice value the higher the priority low values are assigned to important processes while high values are assigned to processes that can wait longer a process with a high nice value simply allows other processes to be executed first in Linux a nice value of -20 represents the highest priority and positive 19 represents the lowest while this may sound backwards this convention goes back to the earliest days of Unix you can also assign a so-called realtime priority to time sensitive tasks such as controlling machines through a computer or collecting incoming data this is just a very high priority and is not to be confused with what is called hard real time which is conceptually different and has more to do with making sure a job gets completed within a very well- defined time window so now let's show how to see what the niceness or priority of a process is and how you can change it with the rice command or how you can do it actually from a graphical user interface so let's look at the uh processes and current screen with the PS command which we will discuss in detail later and we see this current bash shell is 3077 to see the priority I can run PS with the options LF and there you see 3077 here is is uh here is the bash command and the niceness is zero so let's try to change the niess I can do rece um + 5 3077 and you see it did change the priority to five which I can see once again with the PS command it has made it five here notice that the child process I ran off there the command pslf also has a niess of five is there anything else I create in this shell will have that new niceness so this is a lower priority remember in inreasing the NCIS lowers the priority so now suppose I try to increase the priority by decreasing the NCIS to Minus 5 you notice it says I can't do that that's because only the super user or root is allowed to increase the priority of a process but if I type the same command over again with Su it work just fine and I can verify that once again with pslf and there you see it's set up to be minus5 now as well as the new um the new uh PS command that I issued now if I want to do this from a graphical utility I can run gnome system monitor I'll start from the command line here though I could get it uh from a menu and uh this is on the first possible screen here on processes so if I hear that was process 30 uh that was process is 3077 it's right here and you notice it says priority High I could rightclick on there and I can go to change priority and I can just say low and now you see that it's low and if I get out of the graphical utility and I look at the niess again you see now the priority has come up to five I not the the niess of five so that means it's low priority again so that's how you can manipulate the priority of a process from the command line or from a graphical utility the load average is the average of the load number for a given period of time it takes into account processes that are actively running on a CPU considered runnable but waiting for a CPU to become available or sleeping I.E waiting for some kind of resource to become available the load average can be viewed by running W top or uptime the load average is displayed using three numbers such as 0.45 0.17 and 0.12 in this screenshot assuming our system is a single CPU system the three load average numbers are interpreted as follows 0.45 means for the last minute the system has been 45% utilized on average .17 means for the last 5 minutes utilization has been 17% and 12 is for the last 15 minutes utilization has been 12% if we saw a value of 1 in the second position that would imply the single CPU system was 100% utilized on average over the past 5 minutes this is good if we want to fully use a system value over one for a single CPU system implies that the system was over utilized there were more processes needing CPU than CPU was available if we had more than one CPU say a quad CP CPU system we would divide the load average numbers by the number of CPUs in this case for example seeing a 1 minute load average of 4.0 implies that the system as a whole was 100% 4id by 4 utilized during the last minute short-term increases are usually not a problem a high peak you see is likely a burst of activity not a new level for example at start up many processes start and then act and then activity settles down the high peak is seen in the five and 15 minute load averages it may be caused for concern Lin supports background and foreground job processing a job in this context is just a command launched from a terminal window foreground jobs run directly from the shell and when one foreground job is running other jobs need to wait for Shell access at least in that terminal window if using the the guey until it's completed this is fine when when jobs complete quickly but this can have an adverse effect if the current job is going to take a long time even several hours to complete in such cases you can run the job in the background and free the shell for other tasks the background job will be executed at lower priority which in turn will allow smooth execution of the interactive tasks and you can type other commands in the terminal window while the background job is running by default all jobs are executed in the foreground you can put a job in the background by suffixing and or the Amper sand to the command for example update DB Amper sand you can either use contrl Z to suspend a foreground job or contrl C to terminate a foreground job and you can always use the BG and FG commands to run a process in the background and foreground respectively the job utility displays all jobs running in the background the display shows the job ID State and command name as shown here jobs- L provides the same information as jobs and adds the P ID of the background jobs the background jobs are connected to the terminal window so if you log off the job utility will not show the one started from that window PS provides information about currently running processes keyed by P ID if you want a repetitive update of this status you can use top or other commonly installed variants such as htop or aop from the command line or invoke your distributions graphical system monitor application PS has many options for specifying exactly which tasks to examine what information to display about them and precisely what output format should be used without options PS will display all processes running under the current shell you can use the dasu option to display information of processes for a specified username the command ps- EF displays all the processes in the system in full detail the command ps- EF goes one step further and displays one line of information for every thread remember a process can contain multiple threads PS has another style of option specification which stems from the BSD variety of Unix where options are specified without proceeding dashes for example the command PS Au displays all processes of all users the command PS axo allows you to specify which attributes you want to view this screenshot shows a stample output of PS with the aux and axo qualifiers the PS utility is used very often at the command line to gather information about what is running on on the system about the various processes and tasks which were running what resource they were using what relationship they have to each other Etc if I just type PS without any arguments I get the processes which have been launched underneath this particular terminal window and uh in order to make it more interesting I have a background processes running I have a cat a aulus which is the file manager and Evin which is the PDF viewer I can get more information if I type ps- f which you see now also tells me the parent process ID so you notice bash has a process ID of 2942 and that's the parent process for both the cat and the Nautilus which I launched directly out of the shell as well as the PS command itself uh the evince command is actually has something else as a pair for complicated reasons having to do with how the gnome shell runs if I want to get a different piece of information I can do ps- L and now uh I am also seeing information in these two columns about the priority and the niceness which on most Linux systems is just a a a numerical shift okay from uh a neutral niess of zero means the default priority of 80 which is what all normal processes start out with okay now I can do more than this if I want to give additional arguments so I do ps- EF uh this will tell me about all processes on a system and let me type it into less so it doesn't go too quickly so you can see this is everything which is actually running on my system you'll notice that the first bunch processes uh in this rather long list all have these square brackets around them that means they were not started by a user program they're running inside the kernel to do various kinds of uh background tasks that run in the kernel all the time handle moving things from one CPU to another for instance and all kinds of other things uh and you see they have different priorities uh they minus 20 here uh minus 20 there that means they're higher priorities okay it's kind of backwards the lower the priority number here the higher the priorities is if I page down to the bottom I will eventually get to tests which are not running inside the kernel which are uh running for instance uh under my name here Coupe and so you see these are the actual user processes and uh they they're quite a bit different now one reason the PS command can be a little confusing is that there are different kinds of options those which have a dash and which those which do not so for instance ps- e is different than PS space e uh one commonly set of options is PS aux without a dot dash and there you see uh one nice additional piece of information is the percentage of CPU being used and of course uh there isn't much going on in the system right now so that tends to be zero so you can customize what the output of the PS command is uh if you look at the man page for PS you'll see there's ways to have it print out only the columns that you want if you want to produce some customized reports Etc but a standard Linux system administrator probably uses PS every day for one thing or another PS3 displays the processes running on the system in the form of a tree diagram showing the relationship between a process and its parent process and any other processes that it created repeated entries of a process are not displayed and threads are displayed in curly braces while a static view of what the system is doing is useful monitoring the system performance live over time is also valuable one of option would be to run PS at regular intervals say every few seconds a better alternative is to use top to get constant realtime updates until you exit by typing q. toop this clearly highlights which processes are consuming the most CPU cycles and memory using appropriate commands from within top the first line of the top output displays a quick summary of what is happening in the system including how long the system has been up how many users are logged on and what is the load average the load average determines how busy the system is load average of 1.0 per CPU indicates a fully subscribed but not overloaded system if the load average goes above the value it indicates that the processes are competing for CPU time if the load average is very high it might indicate that the system is having a problem such as a runaway process a process in a nonresponding state the second line of the top output displays the total number of processes the number of running sleeping stopped and zombie processes comparing the number of running processes with the load average helps determine if the system has reached its capacity or perhaps a particular user is running too many processes the stopped processes should be examined to see if everything is running correctly the third line of the top output indic indicates how the CPU time is being divided between the users and the kernel by displaying the percentage of CPU time used for each the percentage of user jobs running at a lower priority niceness dni is then listed idle mode or ID should be low if the load average is high and vice versa the percentage of jobs waiting wa for Io is listed interrupts include the percentage of Hardware or hi vers software interrupts SI steel time St is generally used with virtual machines which has some of its idle CPU time taken for other uses the fourth and fifth lines of the top output indicate memory usage which is divided in two categories physical memory or Ram displayed on line 4 and swap space displayed on line five both categories display total memory used memory and free space you need to monitor memory usage very carefully to ensure good system performance once the physical memory is exhausted the system starts using swap space or temporary storage space on the hard drive as an extended memory pool and since accessing disk is much slower than access accessing memory this will negatively affect the system performance if the system starts using swap often you can add more swap space however adding more physical memory should also be considered each line in the process list of the top output displays information about a process by default processes are ordered by highest CPU usage the following information about each process is displayed process identification number P ID process owner the user priority PR and nice values ni virtual physical and shared memory status s a percentage of CPU and memory used execution time the time plus and command besides reporting information top can be utilized interactively for monitoring and controlling processes while top is running in a terminal window you can enter single letter commands to change its behavior for example you can view the top ranked processes based on CPU or memory usage if needed you can alter the priorities of running processes or you can stop or kill a process this table lists what happens when pressing various Keys when running top the top utility is used to interactively monitor what processes and tests are doing on your system to start it up all you have to do is type top and it will refresh itself at some interval of I think by default two or 3 seconds it's easily changed uh it shows you standard information about each process similar to what you get with the PS command such as the process ID the user the priority and niceness some information about how the memory is being used by the process U the state as being meaning sleeping for instance and by default it is sorted by CPU time and then there's also memory the total time and what the actual command is the lines at the top are are have been designed over the years to convey a lot of information so in the first one you see how long the system has been up how many users there are the load average or uh or rolling averages of how much time has been spent in the last I believe 1 minute 5 minutes Etc there are currently 295 tasks running on the system but really only one is is running the others are sleeping um and this shows you the CPU time percentages used by the user processes by the system by so-called nice processes um and then uh idle and uh how many would be waiting how many are high priority and and and some other details like that then you have basic information about the memory such how much is being used how much swap there is available being used how much is in cash Etc if I type the letter one I get statistics for each CPU instead of uh just The Amalgamated total and that can be rather useful one will take it back again if I hit H I get a listing of what the possible keys I can hit are and what they do uh I wouldn't make sense to try to run through much of that here but I highly recommend that you run top and play with these different keys and try to understand what kind of information you can extract well top is how you can do it from the command line and if you hit q that will kill the program you can get similar information by going to your menus and finding system monitor and then uh let me drag that over to this screen uh the processes paint on here is pretty much the same as tops got the same information it's easier to do things that could Resort because I could just click on memory and get it sorted by how much memory is used by clicking again I'll get it in descending order uh priorities CPU Etc you can also once again change the priority of processes you can kill them Etc so uh you can do a lot and if you want to see the graph just click on resources you can see what's going with a constantly redrawn graph and with file systems you can see um how much of your file systems on the computer are actually full uh where they're mounted Etc so that's a brief explanation of top and some related issues suppose you need to perform a task on a specific day sometime in the future however you know you will be away from the machine on that day how will you perform the task you can use the at utility program to execute any non-interactive command at a specified time as Illustrated in this screenshot Kon is a time-based scheduling utility program it can launch routine background jobs at specific times and or days on an ongoing basis KRON is driven by a configuration file called the cron table which contains the various shell commands that need to be run at the properly scheduled times there are both systemwide cron tab files and individual user-based ones each line of the Chron tab file represents a job and is composed of a so-called Chron expression followed by a shell command to execute typing Chron t-e will open the Chron tab Editor to edit existing jobs or to create new jobs each line of the cron tab file will contain six fields and here are some examples sometimes a command or job must be delayed or suspended suppose for example an application has read the and process the contents of a data file and then needs to save a report on a backup system if the backup system is currently busy or not available the application can be made to sleep or wait until it can complete its work such a delay might might be to mount the backup device and prepare it for writing sleep suspends execution for at least the specified period of time which can be given as the number of seconds the default minutes hours or days after that time has passed or an interrupting signal has been received execution will resume the syntax is sleep and the number and then the suffix where the suffix may be S for seconds the default m for minutes H for hours or D for days sleep and at or at are quite different sleep delays execution for a specific period while at starts execution at a later time youve completed chapter nine let's summarize the key Concepts covered processes are used to perform various tasks on the system processes can be single-threaded or multi-threaded processes can be of different types such as interactive and non-interactive every process has a unique identifier the PID to enable the operating system to keep track of it the nice value or niess can be used to set priority PS provides information about the currently running processes you can use top to get constant real time updates about overall system performance as well as information about the processes running on the system load average indicates the amount of utilization the system is under at particular times Linux supports background and foreground processing for a job at executes any non-interactive command at a specified time KRON is used to schedule tasks that need to be performed at regular intervals by the end of this chapter you should be able to explore explore the file system and its hierarchy explain the file system architecture compare files and identify different file types and backup and compress data in Linux and all Unix like operating systems it is often said everything is a file or at least at least it's treated as such this means whenever you are dealing with normal data files and documents or with devices such as sound card cards and printers you interact with them through the same kind of input output operations this simplifies things you open a file and perform normal operations like reading the file and writing on it which is one reason why text editors which you will learn about in in an upcoming section are so important on many systems including Linux the file system is structured like a tree the tree is usually portrayed as inverted and starts at what is most often called the root directory which marks the beginning of the hierarchial file system and is also sometimes referred to as the trunk or simply denoted by a slash the root directory is not the same as the root user the hierarchial file system also contains other elements in the path or directory names which are separated by forward slashes as in user Spinx where the last element is the actual file name in this section you will learn about some basic concepts including the file system hierarchy as well as about disk partitions Linux supports a number of native file system types expressly created by Linux developers such as ext3 ext4 uh squash fs and btrfs it also offers implementations of file systems used on other alien operating systems such as those from Windows SGI IBM or Mac OS many older Legacy file systems such as fat are also supported each file system on a Linux system occupies a disk partition partitions help to organize the contents of diss according to the kind and use of the data contained for example important programs required to run the system are often kept on a separate partition known as root or slash this is a separate partition than the one that contains files owned by regular users of the system in slome in addition temporary files created and destroyed during the normal operation of Linux may be located on dedicated partitions one advantage of this kind of isolation by type and variability is that when all available space on a particular partition is exhausted the system may still operate normally this picture shows the use of the G parted utility which displays the partition layout on a system which has four operating systems on it R eight8 C os7 Ubuntu and Windows before you can start using a file system you need to mount it on the file system tree at the mount point this is simply a directory which may or may not be empty where the file system is to be grafted on sometimes you may need to create the directory if if it does not already exist but keep in mind this warning if you mount a file system on a non-empty directory the former contents of that directory are covered up and not accessible until the file system is unmounted thus Mount points are usually empty directories the mount command is used to attach a file system which can be local to the computer or on a network somewhere within the file system tree the basic arguments are the device node and the mount point for example studo Mount or /dev sda5 slome will attach the file system contained in the dis partition associated with the /dev sda5 device node into the file system tree at the /home mount point there are other ways to specify the partition other than the device node such as using the dis label or The UU ID to unmount the partition the command would be pseudo umount slome note the command is umount not unmount only a root user has the privilege to run these commands unless the system has been otherwise configured if you want it to be automatically available every time the system starts up you need to edit the /c/ fstab accordingly looking at this file will show you the configuration of all preconfigured file systems man fstab will display how this file is used and how to configure it executing Mount without any arguments will show all presently mounted file system systems the command df- th dis free will display information about mounted file systems including the file system type and usage statistics about currently used and available space it's often necessary to share data across physical systems which may be either in the same location or anywhere that can be reached by the internet a network or distributed file system may have all data on one machine or have it spread out out on more than one network node a variety of different file systems can be used locally on the individual machines a network file system can be thought of as a grouping of lower level file systems of varying types many system administrators Mount remote users home directories on a server in order to give them access to the same files and configuration files across multiple client systems this allows the users to log into different computers you still have access to the same files and resources the most common such file systems is named simply NFS the network file system it has a very long history and was first developed by Sun Microsystems another common implementation is cifs also termed Samba which has Microsoft roots in this section you will learn to identify and differentiate between the most important directories found in Linux we start with ordinary users home directory space each user has a home directory usually placed under the slome the/ root directory on Modern Linux systems is no more than the home directory of the root user or super user or system administrator account on multi-user systems the slome directory infrastructure is often mounted as a separate file system on its own partition or even exported remotely on a network through NFS sometimes you may group users based on their department or function you can then create subdirectories under the slome directory for each of these groups for example a school May organized slome with something like the following slome facty slome staff slome students the /bin and SL sbin directory the /bin directory contains executable binaries essential commands used to boot the system and essential commands required by all system users such as cat CP LS MV PS and RM likewise the/ sbin directory is intended for essential binaries related to system administration such as FSS and IP to view of list of these programs you can type lsbs spin commands that are not essential for the system to boot or operate in single user mode are placed in the/ user bin and/ userin directories historically this was done so/ user could be mounted as a separate file system that could be mounted at a later stage of system startup or even over a network however nowadays most find this distinction is obsolete in fact many distributions have been discovered to be unable to boot with this separation as this modality had not been used or tested for a long time thus on some of the newest Linux distributions sluser spin and/ spin are actually just symbolically linked together as are/ userin and/ spin certain file systems like the one mounted at slpr are called pseudo file systems because they have no permanent presence anywhere on the disk the slpr file system contains virtual files files that only exist in memory that permit viewing constantly changing kernel data slpr contains files and directories that mimic kernel structures and configuration information it does not contain real files but onetime system information IG system memory devices mounted Hardware configuration Etc some important entries in SL proc are the following slpr has subdirectories as well including the following the first example shows there is a directory for every process running on a system which contains Vital Information about it the second example shows a virtual directory that contains a lot of information about the entire system in particular its hardware and configuration the slpr file system is very useful because the information it reports is gathered only as needed and never needs storage on the dis the /dev directory contains device nodes a type of pseudo file used by most hardware and software devices except for network devices this directory is empty on the dis partition when it's not mounted and also contains entries which are created by the UDF system which creates and manages device nodes on Linux creating them dynamically when devices are found the /dev directory contains items such as /dev sda1 the first partition on the first hard disk /d lp1 the second printer SL da random a source of random numbers the SL ofar directory contains files that are expected to change in size and content as the system is running VAR stands for a variable such as the entries in the following directories system log files /ar log and packages and database files like slf farli print cues /ar SLS poool and temporary files /var TMP the /var directory may be put on its own file system so that growth of the files can be accommodated and any exploding file sizes do not fatally affect the system network service directories such asfar FP the FTP Service inar www the HTTP web service are also found under SLB bar the SLC directory is the home for system config configuration files it contains no binary programs although there are some executable scripts for example /c/ resolve. conf tells the system where to go on the network to obtain host to IP address mappings DNS files like password Shadow and group for managing user accounts are found in the SLC directory well some distributions have historically had their own extensive infrastructure under SLC with the Adent of system MD there's much more uniformity among distributions today note that/ Etc is for systemwide configuration files and only the super user can modify files there user specific configuration files are always found under their home directory the SL boot directory contains the few essential files needed to boot the system for every alternative kernel installed on the system there are these four files VM Li nuz which is the compressed Linux kernel required for booting in it Ram FS which is the initial Ram file system required for booting sometimes called init Rd not init Ram fs and then config the kernel configuration file only used for debugging and bookkeeping and finally system.map which is the kernel symbol table only used for debugging each of these files has a kernel version appended to its name the grub files such as boot SLG grub grub.com orboot grub2 grub2 CFG are also found under the/ boot directory this screenshot shows an example listing of the/ boot directory taken from the real system that has multiple installed kernels including both distribution supplied and custom compiled ones names will vary and things will tend to look somewhat different on a different distribution SL Li contains libraries which is which are common code shared by applications and needed for them to run it contains libraries for essential programs in SLB and slin these Library file names either start with LD or lib here's an example most of these are what is known as dynamically loaded libraries also known as shared libraries or shared objects on some Linux distributions there exist a SL lib64 directory containing 64-bit libraries while SL lib contains 32-bit versions on re recent Linux distributions you can find this just like for /bin and/ sbin the directories just point to the those under SL user kernel modules or colel code often device drivers that can be loaded and unloaded without restarting the system are located in/ li/ modules SL and then the kernel version number one often uses removable media such as USB driv CDs and DVDs to make the material accessible through the regular file system it has to be mounted at a convenient location most Linux systems are configured so any removable media are automatically mounted when the system notices something has been plugged in while historically this was done under the/ media directory modern Linux distributions place these Mount points under the/ run directory for example a USB pin drive with a label my USB drive for a usern named student will be mounted atrun media studenty USB drive the SL Mount directory has been used since the early days of Unix for temporarily mounting file systems these can be those on removal able media but more often they might be Network file systems which are not normally mounted or these can be temporary partitions or so-called loop back file systems which are files which pretend to be partitions here are some additional directories to be found under the root directory the SL user directory tree contains theoretically non-essential programs and scripts in the sense that they should not be needed to initially boot the system and has at least the following subdirectories shown here now that you know about the file system and its structure let's learn how to manage files and directories diff is used to compare files and directories this often used utility program has many useful options including the ones you see here to compare two files at the command prompt type diff and options file name one file name two diff is meant to be used for text files for binary files one can use CMP in this section you will learn additional methods for comparing files and how to apply patches to files you can compare three files at once using diff 3 which uses one file as the reference basis for the other two for example suppose you and a coworker both have made modifications to the same file working at the same time independently diff 3 can show the differences based on the common file you both started with here's the Syntax for diff 3 this graphic shows the use of diff 3 many modifications to source code and configuration files are distributed utilizing patches which are applied not surprisingly with the patch program a patch file contains the Deltas or changes required to update an older version of a file to the new one the patch files are actually produced by running diff with the correct options as in this command Distributing just the patch is more concise and efficient than Distributing the entire file for example if only one line needs to change in a file that contains 1,000 lines the patch file will be just a few a few lines long to apply a patch you can just do either of these two methods the first usage is more common as it's often used to apply changes to an entire directory tree rather than just one file as in the second example to understand the use of the- P1 option and many others see the man page for patch in Linux a file's extension often does not categorize it the way it might in other operating system systems one cannot assume that a file name file.txt is a text file and not an executable program in Linux a file name is generally more meaningful to the user of the system than the system itself in fact most applications directly examine a file's contents to see what kind of app object it is rather than relying on an extension this is very different from the way Windows handles file names where a file name ending in. exe for example represents an executable binary file the real nature nature of a file can be determined by using the file utility for the file names given as arguments it examines the contents and certain characteristics to determine whether the files are plain text shared libraries executable programs scripts or something else there are many ways you can back up data or even your entire system basic ways to do so include the use of simple coping with CP and use of the more robust rsync both can be used to synchronize entire directory trees however our sync is more efficient because it checks if the file being copied already exists if the file exists and there is no change in size or modification time our sync will avoid an unnecessary copy and save time furthermore because R sync copies only the parts of the file that have actually changed it can be very fast CP can only copy files two and from destinations on the local machine but rsync can also be used to copy files from one machine to another locations are designated in the Target colon path form where Target can be the form of someone at host and the someone at part is optional and used if the remote user is different from the local user our sync is very efficient when recursively copying One Directory tree to another because only the differences are transmitted over the network one often synchronizes the destination directory tree with with the origin using the dasr option to recursively walk down the directory tree copying all files and directories below the one listed as the source our sync is a very powerful utility for example a very useful way to back up a project directory might be to use this command note that rsync can be very destructive accidental misuse can do a lot of harm to data and programs by inadvertently copying changes to where they are not wanted take care to specify the correct options and paths it's highly recommended that you first test your rsync command using the dash dry-run option to ensure that it provides the results that you want to use rsync at the command prompt type rsync source file destination file where either file can be on the local machine or on a network machine the contents of source file will be copied to destination file a good combination of options is shown here the file data is often compressed to save dis space and reduce the time it takes to transmit files over networks Linux uses a number of methods to perform this compression including these these techniques vary in the efficiency of the compression or how much space is saved and how long they take to compress generally the more efficient techniques take longer decompression time does not vary as much across different methods you have completed chapter 10 let's summarize the key Concepts covered the file system tree of starts at what is often called the root directory or trunk or slash the file system hierarchial standard FHS provides Linux developers and system administrators a standard directory structure for the the file system partitions help to segregate files according to usage ownership and type file systems can be mounted anywhere on the main file system tree at a mount Point automatic file systems mounting can be set up by editing Etc FST tab NFS or network file system is a useful method for sharing files and data through the network systems file systems like slpr are called studo file systems because they exist only in memory SL root is the home directory for the root user /var may be put in its own file system so that growth can be contained and not fatally affect the system/ boot contains the basic files needed to boot the system patch is a very useful tool in Linux many modifications to source code and configuration files are distributed with patch files as they contain the Deltas or changes to go from an old version of a file to the new version of a file file extensions in Linux do not necessarily mean that a file is of a certain type CP is used to copy files on the local machine while rsync can be all can be used to copy files from one machine to another as well as synchronized contents by the end of this chapter you should be familiar with how to create and edit files using the available Linux text editors Nano a simple text based editor gedit a simple graphical editor VI and emac two Advanced editors with both text based and graphical interfaces at some point you will need to manually edit text files you might be composing an email offline writing a script to be used for bash or other command interpreters altering a system or application configuration file or developing source code for a programming language such as C python or Java Linux administrators May sidestep using a text editor instead employing graphical utilities for creating and modifying system configuration files however this can be more laborous than directly using a text editor and be more limited in capability note that word processing applications including those that are part of common Office application Suites are not really basic text editors they add a lot of extra usually invisible formatting information that will probably render system administration configuration files unusable for their intended purpose so knowing how to confidently use one or more text editors is really an essential skill to have for Linux by now you have certainly realized Linux is packed with choices when it comes to text editors there are many choices ranging from quite simple to very complex including Nano gedit VI or emac in this section we learn first about the Nano and gedit editors which are relatively simple and easy to learn and then later the more complicated choices VI and emac before we start let's take a look at some cases where an editor is not needed sometimes you may want to create a short file and don't want to bother invoking a full text editor in addition doing so can be quite useful when used from within scripts even when creating longer files you'll no doubt find yourself using this method when you start on the later chapters that cover shell skip scripting if you want to create a file without using an editor there are two standard ways to create one from the command Lin and fill it with content the first one is to use Echo repeatedly like shown here note that while a single greater than sign will send the output of a command to a file two of them will appin the new out output to an existing file the second way is to use cat combined with redirection uh as in this example here both techniques produce a file with the following lines in it line one line two line three and are extremely useful when employed by scripts there are some text editors that are pretty obvious they require no particular experience to learn and are actually quite capable even robust particularly easy to use one is the text terminal based editor Nano just invoke Nano by giving a file name as an argument all the help you need is displayed at the bottom of the screen and you should be able to proceed without any problem as a graphical editor gedit is part of the gnome desktop system kri is associated with KDE the gedit and kri editors are very easy to use and are extremely capable they're also very configured they look a lot like notepad and windows other variants such as Kate are also supported by KDE Nano is easy to use and requires very little effort to learn to open a file type Nano and then the file name and press enter if the file does not exist it will be created Nano provides a two-line shortcut at the bottom of the screen that lists the available commands some of these commands are contrl G display the help screen crl o WR to a file contrl X ex exit a file contrl R insert contents from another file to the current buffer or contrl C show the cursor position zedit is a simpl to ous graphical editor that can only be run within a graphical desktop environment it is visually quite similar to the notepad text editor in Windows but it's actually far more capable and very configurable and has a wealth of plugins available to extend its capabilities further to open a new file find the program in your desktop's menu system or from the command line type gedit and then the file name if the file does not exist it will be created using gedit is pretty straightforward and does not require much training it's interface is composed of quite familiar elements developers and administrators experienced in working on Unix like systems almost always use one of the two vable editing options VI and emac both are present or easily available on all distributions and are completely compatible with the versions available on other operating systems both VI and emac have a basic purely text-based form that can run in a non-graphical environment they also have one or more graphical interface forms with extended capabilities these may be friendlier for a less experienced user while VI and Emil Max can have significantly steep learning curves for new users they're extremely efficient when when one has learned how to use them usually the actual program installed on your system is vim which stands for Vi improved and is Alias to the name VI even if you don't want to use VI it's good to gain some familiarity with it it's a standard tool installed on virtually all Linux distributions and Mac OS indeed there may be times when there is no other editor available on the system and remember VI and them are going to be very similar gome extends VI with a graphical interface known as gvm and KDE offers km either of these may be easier to use at first when using VI all commands are entered through the keyboard you don't need to keep moving your hands to use a pointer device such as a mouse or touchpad unless you want to do so when using one of the graphical versions of the editor typing Vim tutor launches a short but very comprehensive tutorial for those who want to learn their first VI commands even though it provides only an introduction and just seven lessons it has enough material to make you a very proficient VI user because it covers a large number of commands after learning these basic ones you can look up new tricks to incorporate into your list of VI commands because there are always more optimal ways to do things in VI with less typing VI provides three modes as described in this table here here it's vital to not lose track of which mode you're in many keystrokes and commands have quite different behave quite differently in different modes this table describes the most important commands used to start exit read and write files in VI the enter key needs to be pressed after all of these commands and this table describes the most important keystrokes used when changing cursor positions in VI line mode commands those following a colon require the enter key to be pressed after the command is typed let's get started on using modes and cursor movements in VI open VI by typing VI followed by the file name VI opens in command mode type I to enter insert mode VI's insert mode is displayed type the following sentences the quick brown fox jumped over the lazy dog nobody expects the Spanish Inquisition to exit insert mode and switch to command mode press escape to exit VI and save the file type colon WQ and press enter open the recently saved file and place the cursor on the letter k in the word quick in the first sentence to move the cursor four characters to the left type h four times the cursor is moved to letter Q of the word quick to move the cursor to the next line type J to move the cursor to the beginning of the next word type w the cursor is moved to the beginning of the word expects to move the cursor to the end type the dollar sign the cursor is moved to the end of the second sentence type I to enter insert mode VI insert mode is displayed to insert text at the end of the second sentence type A and type history the word history is displayed to the end of the sentence to exit insert mode and switch to command mode press escape to exit VI and save the file type colon WQ and press enter here you can see the most important commands used when searching for text in VI the enter key should be pressed after typing the search pattern this table describes the most important keystrokes used when searching for text in VI and this table describes the most important keystrokes used when changing adding and deleting text in VI typing the sh command opens an external command shell when you exit the shell you will resume your editing session typing exclamation point executes a command from within VI the command follows the exclamation point this technique is best suited for non-interactive commands such as exclamation point WC percentage typing this will run the word count command on the file the character the percentage represents the file currently being edited let's get started on using external commands saving and closing in Vim editor open VI editor by typing VI followed by the file name VI opens in command mode type I to enter insert mode VI's insert mode is displayed type the following sentences nobody expects the Spanish Inquisition nobody expects the 2020 Revolution to exit insert mode and switch to command mode press escape to write and quit the file type colon WQ the file is updated with the changes and closed open VI by typing VI followed by the file name to count the words in the current file type colon exclamation WC percent the word count is displayed press enter to continue editing to quit if no edits were made in the file type colon Q the file is closed open VI by typing VI followed by file name to quit without saving the file type colon Q exclamation the file is closed without saving the changes the emac editor is a popular competitor for Vi unlike VI it does not work with modes emac is highly customizable and includes a large number of features it was initially designed for use on a console but was soon adopted to work with a guy as well emac has many other capabilities other than simple text Ting for example it can be used for email debugging and many other things rather than having different modes for command and insert like VI emac uses the control and meta or alt or Escape keys for special commands here you can see some of the most important key combinations that are used when starting exiting reading and writing files in emac but emac tutorial is a good place to start learning basic commands it's available anytime when in emac by simply typing control h for help and then the letter t for tutorial we will now demonstrate some of the operations you can do with emac in your daily work so first let's get a file to edit so working in the TMP directory let's get a copy of Etc password and bring it over here and then in order to work on it I just have to say emac pass and the name of the file Now the default font here is a little small so I'll play a trick and hit control and the middle button of the mouse to control the size of the font and then I'll make the window a little bigger Okay so we've done that now suppose I want to look for a certain string let's say FTP I would hit contrl s and type in the very bottom window the very bottom line here FTP so you can see down here and you'll see it brought me to FTP I'll go back to the beginning of the line by hitting control a and then let's say I want to change all occurrences of the string FTP to something else I hit Escape percent Mark and then I'll say FTP again on the bottom line and then let's just do it backwards in capitals PTF and you see I hit space it does the first one space it does the second one space it does the third one if I had hit an exclamation point it would have done all of them in the entire file suppose I want to remove a a line I can just hit contrl K and it's gone contrl K is gone again suppose I want to remove a range of lines I hit control space and then I go down a few lines uh with either the arrow key or crln I hit contrl w and they're gone if I want to move them further on in the file I go down a few lines and I hit control y for yank and they're back in there one nice thing I can do with emac is open up multiple windows at the same time so let me hit crl X2 and now I've got two windows and I can switch to the bottom window by hitting crl XO for other and then I hitr XF I can put a different file in that buffer so let's say I put in ETC group okay and once again I'll make the font a little bigger by hitting control in the middle button on the mouse okay and you'll notice the bottom line is actually uh right protected so I can't really delete anything because it belongs to root if I try to delete this line it won't let me do it it says buffer is read only but in general I if I had two files with the same permissions I could cut and paste and go from one to the other to get back to just one I can do control X1 and I have only this but if I really wanted the other window I could can hit control XB and I'm back in the password file if I want to rewrite it uh I can hit control xw contr X control W and that would let me write it as a different name so I'll say p WD revised and it's there if I want to terminate the program I sayr XS to make sure things have been saved and then controll XC and I'm done so you can see we used the control key quite a bit in neac the position most keyboards put it in these days is a little unnatural all the way at the bottom left or right so veteran emac users tend to remap the keyboard so that the caps lock key also works as control so that's some of the basic operations you would do in day-to-day use of emac you have completed chapter 11 let's summarize the key Concepts covered text editors rather than word processing programs are used quite often in Linux for tasks such as creating or modifying system configuration files writing scripts developing sour code and more Nano is an easyto use text based editor that utilizes onscreen prompts gedit is a graphical editor very similar to notepad and windows the vi editor is available on all Linux systems and is very widely used graphical extension versions of VI are widely available as well emac is available on all Linux systems as a popular alternative to VI emac can support both a graphical user interface and a text mode interface to access the vi tutorial typee Vim tutor at a command line window to access the emac tutorial typ contrl H in then T from within emac VI has three modes command insert and line emac has only one but requires use of special keys such as control and Escape both editors use various combinations of key strokes to accomplish tasks the learning curve to master these can be long but once mastered using either editor is extremely efficient by the end of this chapter you should be able to use and configure user accounts and user groups use and set environment variables use the previous shell command history use keyboard shortcuts use and Define aliases use and set file permissions and ownership as you know Linux is a multi-user operating system meaning more than one user can log on at the same time to identify the current user type who am I to list the currently logged on users type who giving who the- a option will give more detailed information in Linux the command shell program generally bash uses one or more startup files to configure the user environment files in the /c directory define global settings for all users while initialization files in the user's home directory can include and or override the global settings the startup files can do anything the user would like to do in every command shell such as customizing The Prompt defining command line shortcuts and aliases setting the default text editor setting the path for where to find executable Pro or setting the path for where to find executable programs the standard prescription is that when you first log into Linux /c/ profile is read and evaluated after which the following files are searched if they exist in this order bash profile bash loginprofile where the squiggly line/ do denotes the user's home directory the Linux login shell evaluates whatever startup file that it comes across first and ignores the rest this means that if it finds bash profile it ignores bash login and profile different distributions may use different startup files however every time you create a new shell or terminal window you do not have to perform a full system login only a file name bashrc file is read and evaluated although this file is not read in evaluated along with the login shell most distributions and or users include the bashrc file from within one of the three user owned startup files most commonly users only fiddle with the bash RC as it is it is invoked every time a new command line shell initiates or another program is launched from a terminal window while the other files are read and executed only when the user first logs on to the system recent distributions sometimes do not even have bash profile and or bash login and some just do little more than include bash RC you can create customized commands or modify the behavior of already existing ones by creating aliases most often these aliases are placed in your bash RC file so they're available to any command shell you create on Alias removes an alias typ tying Alias with no argument will list currently defined aliases please note that there should not be any spaces on either side of the equal sign and the Alias definition needs to be placed within either single or double quotes if it contains any spaces all Linux users are assigned a unique user ID uid which is just an integer normal users start with a uid of 1,000 or greater Linux uses groups for organizing users groups are collections of accounts with certain shared permissions control of group membership is administered through the slcg group file which shows a list of groups and their members by default every user belongs to a default or primary group when a user logs in the group membership is set for their primary group and all the members enjoy the same level of access and privilege permissions on various files and directories can be modified as the group level users also have one or more group IDs GID including a default one which is the same as the user ID these numbers are associated with names through the files SLC password and slcg group groups are used to establish a set of users who have common interests for the purpose of access rights Privileges and security considerations access rights to files and devices are granted on the basis of the user and the group they belong to distributions have straightforward graphical interfaces for creating and removing users and groups and manipulating group membership however it's often useful to do it from the command line or from within shell scripts only the root user can add and remove users and groups adding a new user is done with user ad and removing an existing user is done with user Dell and the simplest form and account for the new user BJ moose would be done with pseudo user ad BJ moose which by default sets the home directory to slome BJ moose populates it with some basic files copied from SLC skll and adds a line to the SLC password such as this and sets the default shell to /bin/bash removing a user account is as easy as typing user Dell BJ moose however this will leave slh home/ BJ moous directory intact this might be useful if it's a temporary inactivation to remove the home directory while removing the account one needs to use the- R option to user Dell typing ID with no arguments gives gives information about the current user as in this ID if given the name of another user as an argument ID will report information about that other user let's get some experience with creating modifying and removing a new user account we will do this on Ubuntu 1704 there are some variations between distributions about what exactly is created when a new account is is created and exactly which files are there Etc this is mostly controlled by a file under Etc default user ad appropriately named so you can see for example in here here the default shell is set to be Shell bsh B bsh now on some distributions such as red hat this file is rather short and not very well documented on auntu it's rather long so let's create the account so Su do uh user ad and I'll say- M to make sure it creates a home directory some uh some distributions do not do that by default two does not for instance and neither does open Su I'll give the full name to be Eric dolphy I'll specify the default shell to be bin bash with the S option and here's the name e d o l p y e DOI now I still have to pass a specify a password so I'll do that with s do pass wde e d o l py and then I type something and now the accounts exists and I can verify that by making sure entries were made uh in the ETC password file and Etc group and there we go notice it is now user 1001 remember normal user start at 1,000 and student is user 1000 and so that's appropriate and also the other information I specified is there such as the full username and the shell bin bash and the group is set to be 101 which is the same ID as the user all users are created with at least one group that has the same number as their username now let's actually try to log into that account and I'll do that with SSH and e d o l py at Local Host and I'll give the password and I succeeded just fine so let's see what's actually in that directory and you'll see there isn't much but these are files that all new users get um and let me log out now and that's controlled by whatever is in the ETC skel directory anything you put in there let me uh do the a option anything you put in there will show up in any new users uh account so let's just clean up and I'll do that with user d-r uh e doy and the r is necessary to make sure removes the home directory you know I get a warning message about uh not having created a m spool file that's harmless and if we do LSL on home now we see the account is gone so we're all cleaned up adding a new group is done with group AD so you can use pseudo usergroup add a new group the group can be removed with studo userin group Dell a new group adding a user to an already existing group is done with user mod for example when you would first look at what groups the user already belongs to and then add the new group pseudo userin user- a-g a new group rjs squirrel RJ squirrel and then groups RJ squirrel will show the new group these utilities update the /c/ group as necessary make sure you use the- a option for aend so as to avoid removing r existing groups group mod can be used to change group properties such as the group ID with the dasg option or name with the with the dash in option removing a user from the group is somewhat trickier the dasg option to user mod must give a complete list of groups thus if you do pseudo user sbin ususer mod DG RJ squirrel RJ squirrel and then do groups RJ squirrel you'll see that only the RJ squirrel group will be left the root account is very powerful and has full access to the system other operating systems often call this the administrator account in Linux it's often called the super user account you must be extremely cautious before granting full rot access to a user it's rarely if ever Justified external attacks often consists of tricks used to elevate the root account however you can use pseudo to assign more limited privileges to user accounts but only do it on a temporary basis and only for a specific subset of commands when assigning elevated privileges you can use the command Su the switch or substitute user to launch a new shelf running as another user you must type the password of the user you are becoming most often this user is root and the new shell allows the use of elevated privileges until it's until it is exited it's almost always a bad practice to use S Su to become root resulting errors can include deletion of vital files from the system and security breaches granting privileges using pseudo is less dangerous and is preferred by default studo must be enabled on a per user basis however some distributions such as BTU enable it by default for at least one main user or give this as an installation option to temporarily become the super user for a series of commands you can type Su and then be prompted for the root password to execute just one command with root privileges type pseudo and then the command when the command is complete you will return to being a normal un privileged user pseudo configuration files are stored in the /c/ pseudo file and in the SLC sudoers DOD directory by default the pseudo s.d directory is empty and whenever you talk about pseudo in a course or article you're basically required to show this web comic by XKCD and environment variables are quantities that have specific values which may be utilized by the command shell such as bash or other utilities and applications some environment variables are given preset values by the system which can usually be overridden While others are set directly by the user either at the command line or within startup and other scripts an environment variable is actually just a character string that contains information used by one or more applications there are a number of ways to view the values of currently set environment variables one can type set EMV or export depending on the state of your system set May print out many more lines than the other two methods by default variables created within a script are only available to the current shell child processes subshells will not have access to values that have been set or modified allowing child processes to see the values requires use of the export command you can also set environment variables to be fed as a one shot to a command as in the following this feeds the values of the S dur and kroot environment variables to the command make modules install home is an environment variable that represents the home or login directory of the user CD without arguments will change the current working directory to the value of Home note the ti character is often used as an abbreviation for home thus CD home and CD with utility are completely equivalent statements path is an ordered list of directories the path which is scanned when a command is given to find the appropriate program or script to run each directory in the path is separated by colons a null or empty directory name or slash indicates the current directory at any given time so in this example there is a null directory before the first call similarly for this there is a null directory between path 1 and path 2 to prefix a private bin directory to to your path you can use this command the environment variable shell points to the user's default command shell the program that is handling whatever you type in a command window usually bash and it contains the Full path name to the Shell prompt statement or Ps is used to customize your prompt string in your terminal Windows to display the information you want PS1 is the primary prompt variable which controls what your command line prompt looks like the following special characters can be included in PS1 they must be surrounded in in single quotes when they are used as in this example bash keeps track of previously entered commands and statements in a history buffer you can recall previously used commands simply by using the up and down cursor keys to view the list of previously executed commands you can just type history at the command line this list of commands is displayed with the most recent command appearing last in the list this information is stored in the sl- bash history if you have multiple terminals open the commands typed in each session are not saved until the session terminates several Associated environment variables can be used to get information about the history pile his file is the location of the history file his file size is the maximum number of lines in the history file default 500 his size is the maximum number of commands in the history file hist control is how commands are stored hist ignore is which which command lines can be unsaved for a complete description of the the use of these environment variables see the man page and Bash there are specific keys to per perform various tasks if you want to recall a command in the history list but do not want to press the arrow key repeatedly you can press controlr to do a reverse intelligent search as you start typing the search goes back in reverse order to the First Command that matches the letters you have typed by typing more successive letters you make the match more and more specific you can use keyboard shortcuts to perform different tasks quick quickly this table lists some of these keyboard shortcuts and their uses note the case of the hot key does not matter meaning doing control a is the same as doing control capital A in Linux and other Unix Bas operating systems every file is associated with a user who is the owner every file is also associated with a group a subset of all users which has an interest in the file and certain rights or permissions read write and execute the following utility programs involve user and group ownership and permission settings files have three kinds of permissions read write and execute these are generally represented as rwx these permissions affect the three groups of owners owner user owner group and others as a result you have the following three groups of three permissions there are a number of different ways to use CH mod for instance to give the owner and others execute permission and remove the group write permission you can do this where the U stands for user or owner o stands for other world and G stands for group this kind of syntax can be difficult to type and remember so what often uses a short hand which lets you set all the permissions in one step this is done with a simple algorithm and a single digit suffices to specify all three permission bits for each entity this digit is the sum of four if read permission is desired two if write permission is desired one if execute permission is is desired so seven means read write execute six means read write five means read execute when you apply this to the the chod command you have to give three digits for each degree of Freedom such as chod 755 Su file now let's see an example of changing file ownership using CH own as shown in this screenshot first we create two empty files using touch notice it requires pseudo to change the owner of file 2 to rout the second CH own command changes both owner and group at the same time finally only the super user can remove the files now let's see an example of changing the group ownership using chgrp you have completed chapter 12 let's summarize the key Concepts covered Linux is a multi user system to find the currently logged on users you can use the who command to find the current user ID you can use the who am I command the root account has full access to the system it's never sensible to Grant full root access to a user you can assign root privileges to regular user accounts on a temporary basis using the pseudo command the shell program or bash uses multiple startup files to create the user environment each file affects the interactive environment in a different way /c/ profile provides the global settings advantages of startup files include that they customize the user's prompt set the user's terminal type set the command line shortcuts and aliases and set the default text editor an environment variable is a character string that contains data used by one or more applications the built-in shell variables can be customized to suit your requirements the history command recalls a list of previous commands which can be edited and recycled in Linux various keyboard shortcuts can be used at the command prompt instead of long actual commands you can customize commands by creating aliases adding an alias to the sl. bashrc file will make it available for other shells file permissions can be changed by typing chod permission in the file name file ownership is changed by typing CH own then the owner and the file name file group ownership is changed by typing chgrp then the group then the file name by the end of this chapter you should be able to display and append to file contents using cat and Echo edit and print file content contents using SED and awk search for patterns using GP use multiple other utilities for file and text manipulation irrespective of the role you play with Linux such as system administrator developer or user you often need to browse through and parse text files Andor extract data from them these are file manipulation operations thus it's essential for the Linux user to become Adept at performing certain operations on files most of the time such file manipulation is done at the command line which allows users to perform tasks more efficiently than while using a guey furthermore the command line is more suitable for automating often executed tasks indeed experienced system administrators write customized scripts to accomplish such repetitive tasks standardized for each particular environment we'll discuss such scripting later in much detail in this section we'll concentrate on command line file and text manipulation related U utilities cat is short for concatenate and is one of the most frequently used Linux command line utilities it's often used to read and print files as well as for simply viewing file contents to view a file use the following command cat and then the file name for example cat readme.txt will display the contents of readme.txt on the terminal however the main purpose of cat is often to combine or concatenate multiple files together you can perform the actions listed in this table using cat the TCH command or cat spelled backwards prints the lines of a file in reverse order each line Remains the Same but the order of lines is inverted the syntax of TAC is exactly the same as for cat as in the following cat can be used to read from standard input such as the terminal window if no files are specified you can use the greater than operator to create and add new lines to the file and the double greater than operator to append lines or files to an existing file to create a new file at the command prompt type cat greater than file name and press the enter key this command creates a new file and waits for the user to edit or enter the text after you finish typing the required text press contrl D at the beginning of the next line to save and exit the editing let's demonstrate some of the basic operations you can performed with the cat utility where the word cat stands for concatenate it's typically used to copy files combine them Etc so first we will need a couple of simple text files to play with let's create one using a text editor let's say Nano so Nano file one. text and I will just type in a couple of lines actually three lines with a PL one at the end I hit contr X for exit I say yes I want to save the modified buffer and I keep the name so now I can look at the the file created with cat so do cat file what. text perfect now let's create another one interactively using cat itself as we talked about earlier so I can say cat in Direction with eof and I'll put it into file 2. text and here is a second file with a few lines and then I just type eof on a line and that closes the input phase and I can say c for l2. text it's there if I want to see them both together I can say C file one. text file 2. text I see it combined or I could send it into a third file file 3. text and then clear the screen I can say cat file 3. text and I see they combined two files in a third file so this is how we use CAD it's an everyday operation you rarely do anything that much more complicated with it system administrators need to work with configuration files text files documentation files and log files some of these files may be larger or become quite large as they accumulate data with time these files will require both viewing and administrative updating in this section you will learn how to manage such large files for example a banking system might maintain one simple large log file to record details of all of One day's ATM transactions due to a security attack or a malfunction the administrator might be forced to check for some data by navigating within the file in such cases directly opening the file in an editor will cause issues due to high memory utilization as an editor will usually try to read the whole file into memory first however one can use less to view the contents of such a large file scrolling up and down Page by Page without the system having to place the entire file in memory before starting this is much faster than using a text editor viewing some file can be done by typing either of the two following commands less sum file or cat Su file pipe less by default Man pages are sent through the less command you may have encountered the older more utility which has some basic functionality but fewer capabilities I.E less is more head reads the first few lines of each named file Tim by default and displays it on standard output you can give a different number of lines in an option for example if you want to print the first five lines from Etc default scrub we can use this command head- in and then Etc deault scrub you can also just do this head- 5 Etc deault scrub tail prints the last few lines of each named file and displays it on standard output by default it's it displays the last 10 lines you can give a different number of lines as an option tail is especially useful when you are troubleshooting any issue using log files as you probably want to see the most recent lines of output for example to display the last 15 lines of some file. log we can use this command tail DN 15 some file that log you can also just do this tail -15 some file. log to continually monitor new output in a growing log file we can do tail-f su file. log this command will continuously display any new lines of output in some file. log as soon as they appear thus it enables you to monitor any current activity that is being reported and recorded it's very common to create and then repeatedly edit and or extract contents from a file let's learn how to use S and awk to easily perform such operations note that many Linux users and administrators will write scripts using comprehensive scripting languages such as Python and pearl rather than use S and awk and some of other utilities we'll discuss later using such utilities is certainly fine in most circumstances once should always feel free to use the tools one is experienced with however the utilities that are described here are much lighter I.E they use fewer system resources and execute faster there are situations such as during booting the system where a lot of time would be wasted using the more complicated tools and the system may not even be able to run them so the simpler tools will always be needed SD is a powerful text processing tool and is one of the oldest earliest and most powerful Unix utilities it's used to modify the contents of a file or input stream usually placing the contents into a new file or output stream its name is is an abbreviation for stream editor said s can filter text as well as perform substitutions in data streams data from an input source or file is taken and moved to a working space the entire list of operations or modifications is applied over the data in the working space and then final contents are moved to the standard output space or stream you can invoke set or SED using commands like those listed in this table the- e option allows you to specify multiple editing commands simultaneously at the command line it's unnecessary if you only have one operation invoked now that you know that you can perform multiple editing and filtering operations with said let's explain some of them in more detail the table explains some basic operations where pattern is the current string and replace uncore string is the new string let's demonstrate some of the most Elementary operations you can perform with SCD on a fedora system so I have taken the Liberty to prepare a simple text file uh before we start which looks like this cat INF file. text it just says three lines indicating their presence suppose I do sd- e slash and then uh let's say is to r on the file and the output will go right on standard out and you see it changed only the first instance on every line so I even have the instead of this um I can make a slight modification to the command if I put a g at the end of it and you see this time it caught every instance I could also do something like this uh 1 comma 2s and it only did it on the first and the second line but it left the third line alone you notice that I don't have to use a forward slash I can use many other characters so here I'll use a colon and it makes no difference what I use now there is an option for S to change character streams in place on the original file but it's a pretty dangerous operation to do since you destroy the original file so generally it's better to send the output into another file so I'll do I'll call that one out file. text oh I forgot to say INF file. text for input so it hung so now I can look at out file. text you see and that's the output and if I want to use the diff command to see the difference I can do something like this diff INF file. text L file. text and it shows me the two lines that have changed now you can do some pretty complicated things with SD when you're trying to deal with special characters including spaces and question marks and stars life being get pretty complicated it it is it respects everything in the world about what are called regular Expressions uh which can look rather strange but it's a daily tool that system min administrators do to make Elementary substitutions and files so that's a little bit about s awk a is used to extract and then print specific contents of a file is often used to construct reports it was created at Babs in the 1970s and derived its name from the last names of its authors o has the following features it's a powerful utility and interpreted programming language it's used to manipulate data fil and for retrieving and processing text it works well with Fields containing a single piece of data essentially a column and Records a collection of fields essentially a line in a file a is invoked as shown in this example as was said short o commands can be specified directly at the command line but a more complex script can be saved in a file that you can specify using the- F option the this table explains the basic tasks that can be performed using a the input file is read one line at a time and for each line o matches the given pattern in the given order and performs the requested action the- F option allows you to specify a particular field separator character for example the /c/ password file uses a colon to separate the fields so the- F colon option is used with the SLC password file the command or action in a needs to be surrounded with apostrophes or single quotes o can be used like the following like in this example in managing your files you may need to perform tasks such as sorting data and copying data from one location to another Linux provides numerous file manipulation utilities that you can use while working with text files in this section you will learn about the following file manipulation programs sort unique paste join and split you also learn about regular expressions and search patterns sort is used to rearrange the lines of a text file in either ascending or descending order according to a sort key you can also sort with respect to particular fields or columns in a file the default sort key is the order of the asky characters I.E essentially alphabetically sort can be used like this when used with the dasu option sort checks for Unique values after sorting the records or lines it's basically equivalent to running unique on the output of sort unique removes duplicate consecutive lines in a text file and it's useful for simplifying the text display because unique requires that the duplicate entries must be consecutive one often runs sort for first and then pipes output into unique if sort is used with the dasu option it can do all this in one step to remove duplicate entries from multiple files at once use this command or you can use do this one to count the number of duplicate entries use this command suppose you have a file that contains the full name of all employees and another file that list their phone numbers and employee IDs you want to create a new file that contains all the data listed in three columns name employee ID and phone number how can you do this effectively without investing too much time Paste can be used to create a single file containing all three columns the different columns are identified based on delimiters which is spacing used to separate two fields for example delimiters can be BL a blank space a tab or an enter in this image a single space is used as a delimiter in all files paste accepts the following options- D for the delimiters which specify a list of delimeters to be used instead of tabs for separating consecutive values on a single line each delimiter is used in turn when the list has been exhausted Pace begins again at the first delimiter d s which causes Pace to appin the data in series rather than in parallel that is in a horizontal rather than vertical fashion Pace can be used to combine Fields such as name or phone number from different files as well as combin lines from multiple files for example line one from file one can be combined with line one of file two and line two from file one can be combined with line two of file two and so on to paste contents from two files one can do this and here's the syntax to use a different delimiter common delimiters are space Tab and comma suppose you have two files with with similar columns you have saved employees phone numbers in two files one with the first name and the other with their last name you want to combine the files without repeating the data of common columns how do you achieve this this task can be achieved using join which is essentially an enhanced version of paste it first checks whether the files share common fields such as names or phone numbers and then joins the lines into files based on a common field to combine two files on a common field at the common prompt type join file one file two and press the enter key for example the common field I.E it contains the same values among the phone book and cities files is the phone number and the result of joining these two files is shown here split is used to break up or split a file into equal siiz segments for easier viewing and manipulation and it's generally used only on relatively large files by default split breaks up a file into 1,000 line segments the original file remains unchanged and a set of new files with the same name plus added prefix is created by default the X prefix is added to split a file into segments use the command split in file to split a file into segments using a different prefix use the command split in file and then the prefix we will apply split to an American English dictionary file of over 999,000 lines and in this example we've used WC which stands for word count that we'll discuss shortly to report on the number of lines in the file and then you just type this this will split the American English file into 100 equal siiz segments named dictionary XX the last one will of course be somewhat smaller regular expressions are text strings used for matching a specific pattern or to search for a specific location such as the start or end of a line or a word regular Expressions can contain both normal characters or so-called medic characters such as an aster or and then and a dollar sign many text editors and utilities such as VI said o find and grep work extensively with regular Expressions this table lists the search patterns and their usage for example consider the following sentence the quick brown fox jumped over the lazy dog some of the patterns that can be applied to the sentence are shown here GP is extensively used as a primary text searching tool it scans files for specified patterns and it can be used with regular Expressions as as well as simple strings as shown in this table strings is used to extract all printable character strings found in a file or files given as arguments it's useful in locating human readable content embedded in binary files for text files one can just use GP for example to search for the string mycore string in a spreadsheet you can use this command and this screenshot shows a search of a number of programs to see which ones have GPL licenses of various versions in this section you will learn about some additional text utilities that you can use for performing various actions on your Linux files such as changing the case of letters or determining the count of words lines and characters in a file the TR utility ised used to translate specified characters into other characters or to delete them the general syntax is as follows TR options set one and set two the items in the square brackets are optional TR requires at least one argument and accepts a maximum of two the first designated set one in this example list the characters in the text to be replaced or removed the second set two list the characters that are to be substituted for the characters listed in the first argument sometimes these sets need to be surrounded by apostrophes or single quotes in order to have the shell ignore that they mean something special to the Shell it's usually safe and may be required to use the single quotes around each of the sets as you'll see in these examples uh for example suppose you have a file named City containing several lines of a text in mixed case to translate all lowercase characters to uppercase at the command prompt type cat City pipe TR A- Z A-Z and press enter key T takes the output from any command and while sending to the standard output it also saves it in a file in other words it T's the output stream from the command one stream is displayed on the standard output and the other is saved to a file for example to list the contents of a directory on the screen and save the output to a file at the command prompt type ls- lpip T new file and press enter key typing cat new file will then display the output of ls-- L WC or word count counts the number of lines words and characters in a file or a list of files opt are given in this table by default all three of these options are active cut is used for manipulating column based files and is designed to extract specific columns the default column separator is the tab character different Eliminator can be given as a command option for example to display the third column eliminated by a blank space at the command prompt Type ls- S pipe cut d d double quot space double quote then- F3 and then you press the enter key you have completed chapter 13 let's summarize the key Concepts covered the command line often allows the users to perform tasks more efficiently than the guey cat short for concatenate is used to read print and combined files Echo displays a line of text either on standard output or to place in a file said is a popular stream editor often used to filter and perform substitutions on files and Text data streams o is an interpretive programming language typically used as a data extraction and reporting tool sort is used to sort text files and output streams in either ascending or descending order unique eliminates duplicate entries in a text file paste combines fields from different files it can also extract and combine line from multiple sources join combines lines from two files based on a common field it works only if files share a common field split breaks up a large file into equal siiz segments regular expressions are text strings used for pattern matching the pattern can be used to search for a specific location such as the start or end of a line or a word grep searches the text files and data streams for patterns and can be used with regular Expressions TR translates characters copy standard input to standard output and handles special characters T saves a copy of standard output to a file while still displaying at the terminal WC for word count displays the number of lines words and characters in a file or group of files cut extracts columns from a file less views files a page at a time and allows scrolling in both directions head displays the first few few lines of a file or data stream or standard standard output by default it displays 10 lines pil displays the last few lines of a file or data stream on standard output by default it displays 10 lines strings extracts printable character strings from binary files by the end of this chapter you should be able to explain basic networking Concepts including types of networks and addressing issues configure Network interace faes and us and use basic networking utilities such as if config IP ping route and trace route use graphical and non-graphical browsers such as links w3m Firefox Chrome and Epiphany transfer files to and from clients and servers using both graphical and text mode applications such as filezilla FTP SFTP curl and wget a network is a group of computers and Computing devices connected together through communication channels such as cables or wireless media the computers connected over a network may be located in the same geographical area or spread across the world a network is used to allow the connected devices to communicate with each other enable multiple users to share devices over the network such as music and video servers printers and scanners share and manage information AC cross computers easily most organizations have both an internal Network and an internet connection for users to communicate with machines and people outside the organization the internet is the largest Network in the world and can be called the network of networks devices attached to a network must have at least one unique Network address identifier known as the IP or Internet Protocol address the address is essential for routing packets of information through the network exchanging information across the network requires using streams of small packets Each of which contains a piece of the information going from one machine to another these packets contain data buffers together with headers which contain information about where the packet is going to and coming from and where it fits in the sequence of packets that constitute the Stream Network Protocols are and software are rather complicated due to the diversity of machines and operating systems they must deal with as well as the fact that even very old standards must be supported there are two different types of IP addresses available IP V4 version 4 and IPv6 version 6 ipv4 is older and by far the most widely used while IPv6 is newer and is designed to get past limitations inherent in the older standard and furnish many more possible addresses ip4 uses 32 bits for addresses there are only 4.3 billion unique addresses available furthermore many addresses are allotted in resered but not actually used ipv4 is considered inadequate for meeting future needs because the number of devices available on the global network has increased enormously in recent years IPv6 uses 128 bits for addresses this allows for 3.4 time 10 to the power of 38 unique addresses if you have a larger network of computers and want to add more you may want to move to IPv6 because it provides more unique addresses however it can be complex to migrate to IPv6 the two protocols do not always interoperate well thus moving equipment and addresses to IPv6 require significant effort and has not been quite as fast as was originally intended we'll discuss ipv V4 more than IPv6 as you're more likely to deal with it one reason ipv4 has not disappeared is there are ways to effectively make many more addresses available by methods such as natat the network address translation natat enables sharing one IP address among many locally connected computers Each of which has a unique address only seen on the local network while this is used in organizational settings it's also used in simple home networks for example if you have a router hooked up to your internet provider such as a cable system it gives you one externally visible address but issues each device in your home an individual local address a 32-bit ipv4 address is divided into four 8bit sections called octets so here's an example note that octet is just another word for bite Network addresses are divided into five classes a b c d and e classes a B and C are classified into two parts Network addresses net ID and host address host ID the net ID is used to identify the network while the host ID is used to identify a host in the network class D is used for special multicast applications information is broadcast to multiple computers simultaneously and Class E is reserved for future use in this section you will learn about classes a b and c Class A addresses use the first octet of an IP address as their net ID and use the other three octets as their host ID the first bit of the first octet is always set to zero so you can only use seven bits for Unique Network numbers as a result there are a maximum of 126 Class A networks available not surprisingly this was only feasible when there were very few unique networks with large numbers of hosts as the use of the internet expanded classes B and C were added in order to accommodate the growing the growing demand for independent networks each class a network can have up to 16.7 million unique hosts on its Network the range of host addresses is from 1.0.0 point0 to 12725 5. 255.255 class B addresses use the first two octets of their IP address as their net ID and the last two octets as their host ID the first two bits of the first octet are always set to Binary 10 so there are a maximum of 16,384 Class B networks the first octet of a Class B address has values from 128 to 191 the introduction of Class B networks expanded the number of networks but but it soon became clear that a further level would be needed each class B Network can support a maximum of 65,536 unique hosts on its Network the range of host addresses is from 128.0 z.0 to 19125 255.255 Class C addresses use the first three octets of the IP address as their net ID in the last OCTA as their host ID the first three bits of the first OCTA are set to Binary 110 so so almost 2.1 million Class C networks are available the first OCTA of a Class C address has values from 19 192 to 223 these are most common for smaller networks which don't have many unique hosts each class seed Network can support up to 256 unique hosts the range of host addresses is from n2.0 z.0 to 223 typically a range of IP addresses are requested from your internet service provider your ISP by your organization's network administrator often your choice of which class of IP address you are given depends on the size of your network and expected growth needs if natat is an operation such as in a home network you only get one externally visible address you can assign IP addresses to computers over a network either manually or dynamically manual assignment adds static or never-changing addresses to the network dynamically assigned addresses can change every time you reboot or even more often the dynamic host C configuration protocol DHCP is used to assign IP addresses name resolution is used to convert numerical IP address values into a human readable format known as the host name for example 104.9 58515 is the numerical IP address that refers to the host name white house.gov host names are much easier to remember given an IP address you can obtain its corresponding host name accessing the machine over the network becomes easier when you can type the host name instead of the IP address you can view your system's host name simply by typing host name with no argument the special host name Local Host is associated with the address 127.0.0.1 and describes the machine you are currently on which normally has additional Network related IP addresses let's get a feel for how the domain name server works on a recent Ubuntu system so first we need to log in and when you log in we'll open up a command line terminal because uh we're going to do all our operations from the command line so I have done that by right clicking on the desktop and then let me make a bigger font I might as well go full screen while I'm at it so there are a couple of important files on your system one is called Etc resolve. now on older Linux systems you didn't have all this information at the top you just had an important thing here name server 127 0.053 you more likely to find your name server is not a 1271 which all 127 addresses are on the actual machine but 1 192168 that1 that1 for instance would be a common thing um might point to your your wireless modem which is attached to your internet service provider for instance uh recent systems use a system D service called system D resolve d which works in a more complicated way it makes a DNS server on the local machine uh which caches the results of previous searches uh so we're not going to get into the details of that but uh that's a recent development that you'll find on newer machines another important file is ETC hosts this file is consulted before the domain name server is consulted so you'll see for instance here at the bottom we've got two machines on the local network we give their IP addresses and a name that we can use to get it them and you'll notice you can have more than one name tied to an IP address so for instance I could do ping Theodore and that's going to take me to 200 or I could do ping uh Beaver takes me to the same machine now if I want to look at something which isn't specified in in that file or in fact I can do that host uh Theodore and I will go look at the file but if I want to get something out on the internet I could do L Linux foundation.org and I'll get the both the ip4 and the ip6 addresses here of the Linux foundation and also information about the mail services provided by the Linux Foundation I can do uh another utility for similar information is nslookup so I'll do that nslookup foundation.org links foundation.org and you see I got the same basic information a little more compactly I got here's the ip4 address and then the two ip6 addresses another utility I can use is dig so let's do dig Linux foundation.org and you'll see I once again got the information about the IP address and then a lot more information about the search to find that server so that's just a little bit of what you can do with DNS and some of the files that are associated with it network configuration files are essential to ensure that interfaces function correctly they're located in the /etc directory tree however the exact files used have historically been dependent on the particular Linux distribution ution and version being used for dbn family configurations the basic network configuration files could be found under slcn Network while for red hat and Susi family systems one needed to inspect /c/ CYS config Network modern systems emphasize the use of network manager which we briefly discuss when we considered graphical system administration rather than keep up with all the files in/ Etc while the graphical versions of network manager do look somewhat different in different distributions the nmtui utility shown here varies almost not at all as does even more sparse NM CLI or command line interface utility if you are proficient in the use of goys by all means use them if you're working on a variety of systems the lower level utilities may make life easier network interfaces are a connection Channel between a device and a network physically network interfaces can proceed through a network interface card or it can be more abstractly implemented as software you can have multiple network interfaces operating at once specific interfaces can be brought up or activated or brought down deactivated at any time information about a particular network interface or all network interfaces can be reported by the IP and if config utilities which you may have to run as the super user or at least give the full path name I.E SLS spin if config IP is newer than if config and has far more capabilities but its output is uglier to the human eye some new Linux distributions do not install the older net tools package to which if config belongs and so you would have to install it if you want to use it to view the IP address you can do this SLS spin I address show to view the routing information slin I rout show IP is a very powerful program that can do many things older and more specific utilities such as if config and Route are often used to accomplish similar tasks a look at the relevant Man pages can tell you much more about these utilities ping is used to check whether or not a machine attached to the network can receive and send data I.E it confirms that the remote host is online and is responding to check the status of the remote host at the command prompt type ping and then the host name ping is frequently used for Network testing and management however its usage can increase Network load unacceptably hence you can abort the execution of ping by typing control C or by using the- C option which limits the number of packets that ping will send before it quits when when an execution stops a summary is displayed a network requires the connection of many nodes data moves from source to destination by passing through a series of routers and potentially across multiple networks servers maintain routing tables containing the addresses of each node in the network the IP routing protocols enable routers to build up a forwarding table that correlates final destinations with the next hop addresses one can use the route utility or the newer IP route command to view or change IP routing table to add delete or modify specific static routes to specific hosts or networks this table explains some commands that can be used to manage IP routing trace route is used to inspect the route which the data package it takes to reach the destination host which makes it quite useful for troubleshooting Network delays and errors by using trace route you can isolate connectivity issues between hops which helps resolve them faster to print the route taken by the packet to reach the network host at the command prompt type trace route and then the address now let's learn about some additional networking tools networking tool tools are very useful for monitoring and debugging network problems such as network connectivity and network traffic let's get started on using more networking tools to use more networking tools open the command prompt to query network interface connected to eth2 type pseudo eth tool eth0 and press enter to display all active connections and routing tables type netstat - R and press enter all active connections and routing tables are displayed to scan open ports on a network type pseudo nmap DSP 10.0.2 do15 sl24 and press enter the open ports on a network are displayed browsers are used to retrieve transmit and explore information resources usually on the worldwide web Linux users commonly use both graphical and non-graphical browser applications the common graphical browsers used in Linux are Firefox Google Chrome chromium coner and Opera sometimes you either do not have a graphical environment to work in or have reason not to use it but still need to access web resources in such a case you can use non-graphical browsers such as these sometimes you need to download files and information but a browser is not the best choice either because you want to download multiple files or you want to perform the action from a command line or a script WG is a command line utility that can capably handle the following types of downloads large file downloads recursive downloads where a web page refers to other web pages and all are downloaded at once password required downloads and multiple file downloads to download a web page you simply type WG and then the URL and then you can read the downloaded page as a local file using a graphical or non-graphical browser besides downloading you may want to obtain information about a URL such as the source code being used curl can be used from the command line or a script to read such information curl also allows you to save the contents of a web page to a file as does wget you can read a URL using curl URL for example if you want to read freecodecamp.org type curl HTP freecodecamp.org it to get the contents of a web page and store it to a file type curl SL o save HTML and then the website address the contents of the main index file at the website will be saved in save. HTML secure shell SSH is a cryptographic network protocol used for secure data communication it's also used for remote services and other secure Services between two devices on the network and is very useful for administering systems which are not easily available to physically work on but to which you have remote access to log in a remote system using your same username you can just type SSH some system and press enter SSH then prompts you for the remote password you can also configure SSH to securely allow your remote access without typing a password each time if you want to run as another user you can do either s-l someone some system or SSH someone at some system to run a command on a remote system via SSH at the command primed you type SSH some system my command we can also move file securely using secure copy SCP between two networked hosts SCP uses the SSH protocol for transferring data to copy a local file to a remote system at the command prompt type STP then the local file and then the user at the remote system cl/ hom user and then you press enter you will receive a prompt for the remote password you can also configure SCP so that it does not prompt for a password for each transfer let's do a simple demonstration of using secure shell and secure copy between two virtual machines uh Ubuntu machine and a cnos machine so first from the Ubuntu machine let's try to log into the Centos machine well first I need to know the IP address of both machines so I can do that with IP and I'll say brief to get a condensed output um addr for address show and I can see my address on this machine is 17216 249 133 I'll do the same command on this Centos machine and you see the address is the same except for the last bite or octed which is 129 so first let's log into the C West machine from obuntu I do SSH student at 17216 24929 and it's the first time I'm doing this so it wants to make sure that I'm authentic so I say yes and now I have to give the password and it's fine I'm on the Centos machine as you can see from The Prompt now in that command I really didn't have to give student that because we're using student count on both machines but never hurts to do that so let me exit now let's do from the SOS machine Let's copy over directory using SCP over to the iunu machine so let me do SCP R for recursive to get the whole directory and everything underneath it uh and this time uh I won't see home student I'll copy the home student directory I won't bother saying student ad I'll just give the address 17216 24913 3 and I'll put it in the temp directory once again it wants to make sure that it's authentic so I'll say yes and once again I have to give the password and it's copied over and if I go over to the Ubuntu machine and I look in the temp directory oh see the account is now there the directory is now there so that's all there is to do a pretty simple demonstration of using secure shell and secure copy you have completed chapter 14 let's summarize the key Concepts covered the IP or Internet Protocol address is a unique logical Network address that is assigned to a device on a network ipv4 uses 32 bits for addresses and IPv6 uses 128 bits for addresses every IP address contains both a network and a host address field there are five classes of network addresses available a b c d and e DNS domain name system is used for converting Internet domain and host names to IP addresses the if config program is used to display current Active network interfaces the commands IP addr show and IP route show can be used to view IP addresses and routing information you can use ping to check if the remote host is alive and responding you can use the route utility program to manage IP routing you can monitor and debug networking problems using networking tools Firefox Google Chrome chromium and Epiphany are the main graphical browsers used in Linux non-graphical or text browsers used in Linux are links links and w3m you can use WG to download web pages you can use Curl to obtain information about URLs you can use SSH to run commands on remote systems we've reached the end of the course you should now have a good working knowledge of Linux from both a graphical and command line perspective I mentioned at the beginning of the course that there is a text based version of this course Linked In the video's description that version also has sections about the bass shell and scripting Printing and local security principles those won't be relevant to everybody but feel free to check that out if you want to learn about those topics so good luck as you use and administer Linux\n"