Introduction to Linux – Full Course for Beginners — Transcript
Full transcript
- 0:00welcome to this introduction to Linux
- 0:01course I'm Bo K and I will be teaching
- 0:04this course this course is designed for
- 0:06computer users who have limited or no
- 0:08previous exposure to Linux whether
- 0:10they're working in an individual or
- 0:12Enterprise environment this course
- 0:15explores the various tools and
- 0:16techniques commonly used by Linux system
- 0:18administrators and endusers to achieve
- 0:21their day-to-day work in a Linux
- 0:23environment you will gain a good working
- 0:26knowledge of Linux and how to navigate
- 0:28through major Linux distributions system
- 0:32configurations and graphical interfaces
- 0:34of L Linux basic command line operations
- 0:37common applications of Linux and more
- 0:40upon completion of this training you
- 0:42should have a good working knowledge of
- 0:44Linux from both a graphical and command
- 0:47line perspective allowing you to easily
- 0:50navigate through any of the major Linux
- 0:53distributions the content of this course
- 0:55was developed by the Linux Foundation
- 0:59Who provided a Grant to make this course
- 1:01possible I've taken their primarily text
- 1:04based course and turned it into a
- 1:06video-based course throughout the course
- 1:09you will see some video segments that
- 1:11were developed by the Linux Foundation
- 1:13also you should know that sometimes
- 1:15throughout this course I put Linux
- 1:17commands on the screen like this the
- 1:19dollar sign at the beginning is not part
- 1:21of the command that just indicates the
- 1:23command should be typed into the system
- 1:25shell or terminal so if you're following
- 1:28along type everything after the dollar
- 1:30sign in the description of this video
- 1:33I've linked to a text based version of
- 1:35this course okay let's get
- 1:40started by the end of this chapter you
- 1:43should be able to describe the software
- 1:45environment required for this course and
- 1:48describe the three major Linux
- 1:50distribution
- 1:54families in order to fully benefit from
- 1:57this course you will need to have at
- 1:58least one link Linux distribution
- 2:00installed if you're not already familiar
- 2:03with the term distribution as it relates
- 2:05to Linux you soon will be you are about
- 2:08to learn some more details about the
- 2:10many available Linux distributions
- 2:13because there are literally hundreds of
- 2:15distributions I'm not covering them all
- 2:17in this course instead I'll focus on the
- 2:20three major distribution families the
- 2:24families in representative distributions
- 2:26this course will focus on are red hat
- 2:29family system sys including C OS and
- 2:32Fedora Susi family systems including
- 2:35open Susi and Debian family systems
- 2:38including Ubuntu and Linux
- 2:44Mint I'm about to tell you more about
- 2:46red hat Susi and Debian well this course
- 2:50focuses on these three major Linux
- 2:52distribution families as long as there
- 2:54are talented contributors the families
- 2:56of distributions and the distributions
- 2:58within these families will continue to
- 3:00change and grow people see a need and
- 3:03develop special configurations and
- 3:05utilities to respond to the need
- 3:08sometimes that effort creates a whole
- 3:09new distribution of Linux sometimes that
- 3:12e effort will leverage an existing
- 3:14distribution to expand the members of an
- 3:16existing
- 3:20family Red Hat Enterprise Linux or Rel
- 3:25heads the family that includes cnos cnos
- 3:28stream fedora and Oracle Linux Fedora
- 3:32has a close relationship with re and
- 3:34contains significantly more software
- 3:37than Red Hats Enterprise version one
- 3:40reason for this is that a diverse
- 3:41Community is involved in building Fedora
- 3:44with many contributors who do not work
- 3:46for Red Hat furthermore it's used as a
- 3:49testing platform for future real
- 3:52releases in this course we'll mainly use
- 3:54syn OS stream from the Red Hat Family
- 3:57the basic version of CN OS is also
- 3:59virtually identical to Rel the most
- 4:02popular Linux distribution in Enterprise
- 4:05environments however cnos 8 has no more
- 4:09scheduled updates the replacement is
- 4:11cnos 8 stream some of the key facts
- 4:14about the red hat distribution family
- 4:16are Fedora serves as an upstream testing
- 4:19platform for real cnos is a close clone
- 4:22of real while Oracle Linux is mostly a
- 4:25copy with some changes it supports
- 4:27Hardware platforms such as Intel x86 arm
- 4:31itanium power PC and IBM system Z it
- 4:34uses the Yum and dnf RPM based yum
- 4:37package managers uh to install update
- 4:40and remove packages in the system re is
- 4:43widely used by Enterprise which hosts
- 4:45their own
- 4:50systems the Susi family and their the
- 4:53relationship between Susi and open Susi
- 4:57is similar to the one described between
- 4:59real cnos Idora we use open Susi as the
- 5:04reference distribution for the Susi
- 5:06family as it's available to end users at
- 5:08no cost because the two products are
- 5:11extremely similar the material that
- 5:13covers open Susi can typically be
- 5:16applied to SLE with few problems some of
- 5:20the key facts about the Susi family are
- 5:23the Susi Linux Enterprise server or SLE
- 5:26is Upstream from open Susi it uses the
- 5:30RPM based zipper package manager which
- 5:33we'll cover later to install update and
- 5:36remove packages in the system it
- 5:38includes the yast or yet another setup
- 5:41tool application for system
- 5:43administration purposes slas is widely
- 5:46used in retail and many other
- 5:52sectors the Debian distribution is
- 5:55Upstream for several other distributions
- 5:57including auntu in turn a Von 2 is
- 6:00Upstream for Linux Mint and a number of
- 6:02other distributions it's commonly used
- 6:04on both servers and desktop computers
- 6:07Debian is a Pure open- Source Community
- 6:10project which is not owned by any
- 6:12Corporation and has a strong focus on
- 6:14stability and dbm provides by far the
- 6:17largest and most complete software
- 6:19repository to its users of any Linux
- 6:23distribution Ubuntu aims to at providing
- 6:26a good compromise between long-term
- 6:28stability and ease of use since autu
- 6:31gets most of its packages from Debian
- 6:33stable Branch it also has access to a
- 6:36very large software repository for those
- 6:39reasons we will use auntu LTS or
- 6:41long-term support as the reference to
- 6:44the dbm family distributions for this
- 6:46course some key facts about the dbm
- 6:49family are the dbm family is Upstream
- 6:52for Ubuntu and yuntu is Upstream for
- 6:55Linux Mint and others it uses the dpkg
- 6:59based AP package manager which we'll
- 7:03cover later in detail to install update
- 7:06and remove packages in the system Ubuntu
- 7:09has been widely used for cloud
- 7:12deployments while and while Ubuntu is
- 7:14built on top of Debian and is gnome
- 7:17based under the hood it differs visually
- 7:19from the interface on standard Debian as
- 7:22well as other
- 7:26distributions so in conclusion there are
- 7:29three m Major Distribution families
- 7:30within Linux Red Hat Susi and Debian in
- 7:34this course we'll work with
- 7:36Representative members of all of these
- 7:38families
- 7:42throughout by the end of this chapter
- 7:44you should be able to define the common
- 7:47terms associated with Linux and discuss
- 7:50the components of a Linux distribution
- 7:53in order for you to get the most out of
- 7:55this course we recommend that you have
- 7:57Linux installed on a machine that you
- 7:59can use throughout this course you can
- 8:02use this brief installation guide
- 8:04preparing your computer for Linux
- 8:06training it will help you to select a
- 8:08Linux distribution to install decide on
- 8:11whether you want to do a standalone pure
- 8:13Linux machine or a dual boot one whether
- 8:16to do a physical or virtual install and
- 8:19more and then it guides you through the
- 8:21steps I'll also cover installation soon
- 8:24well we have not covered everything in
- 8:26great detail but keep in mind that most
- 8:28of the documentation in Linux is
- 8:31actually already on your system in the
- 8:33form of band Pages which we'll discuss
- 8:36in great detail later whenever you do
- 8:38not understand something or want to know
- 8:40more about a command program topic or
- 8:42utility you can just type man and then
- 8:45the topic at the command line so I'll
- 8:47just assume you're thinking this way so
- 8:49I won't constantly repeat for more
- 8:52information look at the man page for
- 8:54this topic on a related note throughout
- 8:57the course we'll use a shorthand that is
- 9:00common in the open-source Community when
- 9:03referring to cases where the user has to
- 9:05make a choice of what to enter like a
- 9:08name of a program or file we use the
- 9:10shorthand Fu to represent the to
- 9:13basically represent insert file name
- 9:15here so we're not actually suggesting
- 9:17that you manipulate files or install
- 9:19Services called Foo the best way to
- 9:22learn Linux is by doing it so make sure
- 9:25to try things out yourself as you follow
- 9:27along you'll need to have a Linux system
- 9:30up and running that can either be a
- 9:32native Linux system on your Hardware
- 9:35running through a live USB stick or CD
- 9:38or a virtual machine running through a
- 9:40hypervisor we'll show you all these
- 9:42methods so let's get
- 9:44going before you begin using Linux you
- 9:47need to be aware of some basic terms
- 9:49such as kernel distribution boot loader
- 9:53service file system X Windows system
- 9:57desktop environment and command line
- 10:01these are very commonly used by the
- 10:03Linux
- 10:04Community the kernel is considered the
- 10:06brain of the Linux operating system it
- 10:09controls the hardware and makes the
- 10:11hardware interact with the
- 10:13applications an example of a kernel is
- 10:15the Linux kernel the most recent Linux
- 10:18kernel along with past Linux kernels can
- 10:21be found at the kernel.org
- 10:24website a distribution also known as
- 10:27dros is a collection of programs
- 10:29combined with the Linux kernel to make
- 10:31up a linux-based operating system some
- 10:34common examples of a distribution are
- 10:36red hat Enterprise Linux Fedora Ubuntu
- 10:41and
- 10:42gentu the boot loader as the name
- 10:44implies is a program that Boots the
- 10:46operating system two examples of a boot
- 10:49loader are grub and isol
- 10:52Linux a service is a program that runs
- 10:54as a background process some examples of
- 10:57the service are a
- 11:00httpd nfsd
- 11:03ntpd ftpd and name
- 11:06d a file system is a method for storing
- 11:09and organizing files in Linux some
- 11:12examples of file systems are
- 11:15ext3
- 11:17ext4 fat xfs and butter
- 11:21FS the X Windows system provides the
- 11:24standard toolkit and protocol to build
- 11:26graphical user interfaces on nearly all
- 11:29Linux systems the desktop environment is
- 11:32a graphical user interface on top of the
- 11:35operating system gome KDE xfce and
- 11:40fluxbox are some examples of the desktop
- 11:43environment the command line is an
- 11:45interface for typing commands on top of
- 11:48the operating
- 11:49system the shell is the command line
- 11:52interpreter that interprets the command
- 11:54line input and instructs the operating
- 11:57system to perform any necessary test
- 11:59tasks and commands for example bash TC
- 12:03shell and
- 12:08zshell suppose you've been assigned to a
- 12:11project building a product for a Linux
- 12:14platform project requirements include
- 12:16making sure that project works properly
- 12:18on the most widely used Linux
- 12:21distributions to accomplish this you
- 12:23need to learn about the different
- 12:25components services and configurations
- 12:29associated with each distribution we're
- 12:31about to look at how you would go about
- 12:33doing exactly that so what is a Linux
- 12:36distribution and how does it relate to
- 12:38the Linux kernel the Linux kernel is the
- 12:42core of the operating system a full
- 12:44Linux distribution consists of the
- 12:46kernel plus a number of other software
- 12:48tools for file related operations user
- 12:51management and software package
- 12:53management each of these tools provides
- 12:55a part of the complete system each tool
- 12:58is often its own separate project with
- 13:00its own developers working to perfect
- 13:02that piece of the system while the most
- 13:05recent Linux kernel and earlier versions
- 13:08can always be found in the Linux kernel
- 13:10archives Linux distributions may be
- 13:13based on different kernel versions for
- 13:15example the very popular real 8
- 13:17distribution is based on the 4.18 Kernel
- 13:20which is not new but is extremely stable
- 13:23other distributions may move move more
- 13:26quickly in adopting the latest kernel
- 13:28releases it's important to note that the
- 13:30kernel is not an All or Nothing
- 13:33proposition for example re and C OS have
- 13:37Incorporated many of the most the more
- 13:39recent kernel improvements into their
- 13:41older versions as have auntu op sui SL
- 13:45and more examples of other essential
- 13:47tools and and ingredients provided by
- 13:49distributions include the C and C++ and
- 13:52claim compilers the GDB de debugger the
- 13:55core system libraries applications need
- 13:58to to link with in order to run the
- 14:01low-level interface for drawing graphics
- 14:03on the screen as well as the higher
- 14:06level desktop environment and the system
- 14:08for installing and updating the various
- 14:10components including the C the kernel
- 14:13itself in all distributions come with a
- 14:15rather complete Suite of applications
- 14:18already
- 14:21installed the vast variety of Linux
- 14:24distributions are designed to cater to
- 14:26many different audiences and or
- 14:29organizations according to their
- 14:31specific needs and tastes however large
- 14:34organizations such as companies and
- 14:36governmental institutions and other
- 14:38entities tend to choose the major
- 14:41commercially supported distributions
- 14:44from Red Hat Susi and canle which is
- 14:48iunu SOS and C OS stream are popular
- 14:51free alternatives to Red Hat Enterprise
- 14:53Linux real and are often used by
- 14:55organizations that are comfortable
- 14:57operating without paid techn technical
- 14:59support huntu and pedora are widely used
- 15:02by developers and are also popular in
- 15:04the educational realm scientific Linux
- 15:07is favored by the scientific research
- 15:09Community for its compatibility with
- 15:11scientific and mathematical software
- 15:14packages both cnos variants are binary
- 15:17compatible with real which means in most
- 15:20cases binary software packages will
- 15:22install properly across the
- 15:24distributions many commercial
- 15:25Distributors including Red Hat Ubuntu
- 15:27Susi and or Le provide long-term fee
- 15:31based support for their distributions as
- 15:33well as hardware and software
- 15:35certification all major distributions
- 15:37provide update services for keeping your
- 15:39system primed with the latest security
- 15:41and Bug fixes and performance
- 15:43enhancements as well as provide online
- 15:46support
- 15:50resources you have completed chapter 2
- 15:53let's summarize the key Concepts covered
- 15:56Linux borrows heavily from the Unix
- 15:58operating system
- 15:59with which its creators were well-versed
- 16:01Linux accesses many features and
- 16:04services through files and filik objects
- 16:07Linux is a fully multitasking multi-user
- 16:10operating system with built-in
- 16:12networking and service processes known
- 16:14as dam some of the more common terms
- 16:17used in Linux are kernel distribution
- 16:20bootloader service file system X window
- 16:23system desktop environment and command
- 16:25line and a full Linux distribution
- 16:28consists of the kernel plus a number of
- 16:31other software tools for file related
- 16:33operations user management and software
- 16:36package
- 16:41management by the end of this chapter
- 16:43you should be able to identify Linux
- 16:45file systems identify the differences
- 16:48between partitions and file systems
- 16:51describe the boot process and install
- 16:54Linux on a computer the Linux boot
- 16:57process is the procedure for for
- 16:59initializing the system it consists of
- 17:01everything that happens from when the
- 17:03computer is first switched on until the
- 17:06user interface is fully operational
- 17:09having a good understanding of the steps
- 17:11in the boot process may help you with
- 17:13troubleshooting problems as well as with
- 17:16tailoring the computer's performance to
- 17:19your
- 17:20needs on the other hand the boot process
- 17:22can be rather Technical and you can
- 17:24start using Linux without knowing all
- 17:26the details
- 17:30starting an x86 based Linux system
- 17:33involves a number of steps when the
- 17:35computer's powered on the basic input
- 17:37output system or bios in initializes the
- 17:40hardware including the screen and
- 17:42keyboard and tests the main memory this
- 17:45process is also called post power on
- 17:48self test the bio software is stored on
- 17:51a ROM chip on the motherboard after this
- 17:54the remainder of the boot process is
- 17:56controlled by the operating system
- 18:02once the post is completed the system
- 18:04control passes from the BIOS to the
- 18:06bootloader the boot loader is usually
- 18:08stored on one of the hard diss in the
- 18:10system either in the boot sector for
- 18:13traditional bios or MBR systems or the
- 18:17EFI partition for more recent or unified
- 18:20extensible firmware interfaces or EFI
- 18:22ufi systems up to this stage the machine
- 18:25does not access any mass storage media
- 18:28there after information on date time and
- 18:31the most important peripherals are
- 18:33loaded from the seos values after
- 18:35technology used for the battery powered
- 18:37memory store which allows the system to
- 18:39keep track of the date and time when
- 18:42even when it's powered off a number of
- 18:44boot loaders exist for Linux the most
- 18:46common ones are grub for Grand unified
- 18:49boot loader isol Linux for booting from
- 18:51removable media and dos uboot for
- 18:54booting on embedded devices appliances
- 18:57most Linux boot loaders can present a
- 18:59user interface for choosing alternative
- 19:01options for booting Linux and even other
- 19:05op operating systems that might be
- 19:06installed when booting Linux the boot
- 19:09loader is responsible for loading the
- 19:11kernel image and the initial Ram disc or
- 19:14file system into
- 19:19memory the boot loader has two distinct
- 19:22stages for systems using the BIOS MBR
- 19:25method the bootloader resides at the
- 19:27first sector of the hard disk also known
- 19:30as the master boot record the size of
- 19:33the MBR is just 512 bytes in this stage
- 19:36the bootloader examines the partition
- 19:38table and finds a bootable partition
- 19:41once it finds a bootable partition it
- 19:43then searches for the second stage boot
- 19:45loader for example grub and loads it
- 19:47into RAM for systems using the EFI
- 19:51slfi method UEFI firmware reads its boot
- 19:55manager data to determine which UEFI
- 19:57application is to be launched and from
- 19:59where the firmware then launches the
- 20:02UEFI application for example grub as
- 20:05defined in the boot entry in the
- 20:07firmware boot manager the second stage
- 20:10boot loader resides under slash boot a
- 20:13splash screen is displayed which allows
- 20:15us to choose which operating system to
- 20:17boot after choosing the OS the boot lead
- 20:20boot the boot loader loads the Kel of
- 20:23the selected operating system into RAM
- 20:25and passes control to it kernels are
- 20:28almost always compressed so its first
- 20:30job is to uncompress itself after this
- 20:33it will check and analyze the system
- 20:35hardware and initialize any hardware
- 20:37device drivers built into the
- 20:41kernel the init Ram FS file system image
- 20:45contains programs and binary files that
- 20:47perform all actions needed to mount the
- 20:49proper root file system like providing
- 20:52kernel functionality for the needed file
- 20:54system and device drivers for mass
- 20:56storage controllers with a facility
- 20:58called udev for user device which is
- 21:00responsible for figuring out which
- 21:02devices are present locating the device
- 21:05drivers they need to operate properly
- 21:07and loading them after the root file
- 21:09system has been found it's checked for
- 21:11errors and mounted the mount program
- 21:14instructs the operating system that a
- 21:16file system is ready for use and
- 21:19Associates it with a particular point in
- 21:21the overall hierarchy of the file system
- 21:24the mount point if this is successful
- 21:26the the init Ram FS is is cleared from
- 21:29RAM and the init program from the root
- 21:31file system is executed init handles the
- 21:34mounting and pivoting over to the final
- 21:36real root file system if special
- 21:39Hardware drivers are needed before the
- 21:41mass storage can be accessed they must
- 21:43be in the init ramfs
- 21:48image near the end of the boot process
- 21:50init starts a number of text mode login
- 21:53prompts these enable you to type your
- 21:55username followed by your password and
- 21:58to eventually get a command shell
- 22:01however if you're running a system with
- 22:03a graphical login interface you'll not
- 22:06see these at first usually the default
- 22:08command shell is Bash but there are a
- 22:11number of other Advanced command shells
- 22:14available the shell prints a text prompt
- 22:17indicating it is ready to accept
- 22:19commands after the user types the
- 22:21command and presses enter the command is
- 22:24executed and another prompt is displayed
- 22:27after the command is done
- 22:32the boot loader loads the kernel and an
- 22:35initial Ram based file system into
- 22:37memory so it can be used directly by the
- 22:40kernel when the kernel is loaded in Ram
- 22:43it immediately initializes and
- 22:45configures the computer's memory it also
- 22:48configures all the hardware attached to
- 22:50the system this includes all processors
- 22:53IO subsystems storage devices and more
- 22:56the kernel also loads some necess are
- 22:58user space
- 23:03applications once the kernel has set up
- 23:05all its hardware and mounted the root
- 23:07file system the kernel runs the sbin
- 23:10init this then becomes the initial
- 23:13process which then starts other
- 23:15processes to get the system running most
- 23:17other processes on the system Trace
- 23:19their origin ultimately to init
- 23:22exceptions include the so-called kernel
- 23:25processes these are started by the
- 23:27kernel directly and their job is to
- 23:29manage internal operating system details
- 23:32besides starting the system init is
- 23:35responsible for keeping the system
- 23:37running and for shutting it down cleanly
- 23:40one of it one of its responsibilities is
- 23:42to act when necessary as a manager for
- 23:45all non-el processes it cleans up after
- 23:48them upon completion and restarts user
- 23:51login Services as needed when users log
- 23:54in and out and does the same for other
- 23:56background system services
- 23:59traditionally this process startup was
- 24:01done using conventions that date back to
- 24:03the
- 24:041980s and the system V variety of Unix
- 24:08this serial process had the system
- 24:10passing through a sequence of run levels
- 24:12containing collections of scripts that
- 24:14start and stop Services each run level
- 24:17supported a different mode of running
- 24:19the system with within each run level
- 24:22Individual Services could be set to run
- 24:24or to be shut down if running however
- 24:27all major distribu s have moved away
- 24:29from this sequential runlevel method of
- 24:32system initialization although they
- 24:34usually emulate many system V utilities
- 24:37for compatibility
- 24:39purposes next we'll discuss the new
- 24:41methods of which system MD has become
- 24:47dominant systems with system D start up
- 24:50faster than those with earlier init
- 24:52methods this is largely because it
- 24:55replaces a serialized set of steps with
- 24:58aggressive pitalization techniques which
- 25:01permits multiple services to be
- 25:03initiated simultaneously it has been
- 25:06adapted by all major distributions and
- 25:09so we'll not discuss the older system V
- 25:11method or upstart which has become a
- 25:13dead end complicated Startup shell
- 25:15scripts are replaced with simpler
- 25:17configuration files which enumerate what
- 25:20has to be done before a service is
- 25:22started how to execute service startup
- 25:25and what conditions the service should
- 25:26indicate have been accom accomplished
- 25:29when startup is finished one thing to
- 25:31note is that s spinit now just points to
- 25:34lib system d/ systemd so system D takes
- 25:38over the init process one system D
- 25:41command system control is used for most
- 25:44basic tasks while we have not yet talked
- 25:47about working at the command line here's
- 25:49a brief listing of its use
- 26:01think of a refrigerator that has
- 26:03multiple shelves that can be used for
- 26:05storing various items these shelves help
- 26:08you organize the grocery items by shape
- 26:11size type Etc the same concept applies
- 26:14to a file system which is the embodiment
- 26:17of a method of storing and organizing
- 26:19arbitrary collections of data in a human
- 26:22usable form different types of file
- 26:25systems supported by Linux include
- 26:28conventional disk file systems flash
- 26:31storage file
- 26:33systems database file systems and
- 26:37special purpose file
- 26:39systems this section will describe the
- 26:41standard file system layout shared by
- 26:44most Linux
- 26:49distributions a partition is a
- 26:52physically contigous section of a dis or
- 26:55what appears to be so in some Advanced
- 26:56setups a file system is a method of
- 27:00storing or finding files on a hard disk
- 27:03usually in a partition one can think of
- 27:05a partition as a container in which a
- 27:08file system resides although in some
- 27:10circumstances a file system can span
- 27:13more than one partition if one uses
- 27:16symbolic links which we'll discuss much
- 27:18later a comparison between file systems
- 27:21in Windows and Linux is shown in this
- 27:24table
- 27:33Linux systems store their important
- 27:35files according to a standard layout
- 27:37called the file system hierarchy
- 27:40standard which has long been maintained
- 27:43by the Linux Foundation having a
- 27:45standard is designed to ensure that
- 27:47users administrators and developers can
- 27:50move between distributions without
- 27:52having to relearn how the system is
- 27:55organized Linux uses the slash care to
- 27:58separate paths unlike Windows which uses
- 28:01the backslash and it does not have
- 28:03multiple Drive letters multiple drives
- 28:05and or partitions are mounted as
- 28:08directories in the single file system
- 28:11removable media such as USB drives and
- 28:13CDs and DVDs will show up as mounted at
- 28:17run/ media your username slis Lael for
- 28:21recent Linux systems or under SL media
- 28:24for older distributions for example if
- 28:27your username is student a USB pin Drive
- 28:30labeled Fedora might end up being found
- 28:32at run/ media student Fedora and a file
- 28:37readme.txt on that dis would be at run/
- 28:41media student Fedora readme.txt all
- 28:45Linux file systems are case sensitive so
- 28:49these different ways of spelling boot
- 28:51represent three different directories or
- 28:53folders many distributions distinguish
- 28:56between core utilities needed for proper
- 28:58system operation and other programs and
- 29:01place the ladder in directories under SL
- 29:04USR or user now let's learn about
- 29:07viewing the file system hierarchy from
- 29:10the graphical interface in
- 29:13yuntu Click the file manager icon on the
- 29:16left panel by default it explores your
- 29:18home
- 29:19directory to see all directories under
- 29:22root directory click computer on the
- 29:24left places pane inside this window
- 29:29doubleclick the Etsy directory to open
- 29:32it double click aahi and press control L
- 29:36to see the current location the current
- 29:39path appears at the top of the window
- 29:41the path for this is Etsy
- 29:44aah now let's learn about viewing the
- 29:47file system hierarchy from the graphical
- 29:49user interface in open
- 29:51Susi click activities on the top left
- 29:54corner of the screen
- 29:56Corner click the file manager your icon
- 29:58on the left panel by default it explores
- 30:01your home
- 30:03directory click computer on the left
- 30:05places pane inside this window you can
- 30:08see all directories under the root
- 30:11directory doubleclick the Etsy directory
- 30:14to open
- 30:16it to see the current location
- 30:18doubleclick the avahi folder and press
- 30:21control L the current path appears at
- 30:24the top of the window the path for this
- 30:27is Etsy
- 30:32aahi suppose you intend to buy a new car
- 30:36what factors do you need to consider to
- 30:38make a proper Choice requirements which
- 30:41need to be taken into account include
- 30:43the size needed to fit your family in
- 30:45the vehicle the type of engine and gas
- 30:48economy your expected budget and
- 30:50available financing options reliability
- 30:54record and after Sal Services Etc
- 30:57similarly determining which distribution
- 30:59to deploy also requires planning here
- 31:03you can see some but not all choices
- 31:06note that many embedded Linux systems
- 31:08use custom crafted contents rather than
- 31:11Android or yako some questions worth
- 31:14thinking about before deciding on a
- 31:17distribution include what is the main
- 31:19function of the system what types of
- 31:22packages are important to the
- 31:25organization for example web server word
- 31:27process processing Etc how much hard
- 31:30disk space is required and how much is
- 31:32available for example when installing
- 31:35Linux on an embedded device space is
- 31:37usually
- 31:38constrained how often are packages
- 31:42updated how long is the support cycle
- 31:44for each release for example LTS
- 31:47releases have long-term support do you
- 31:50need kernel customization from a vendor
- 31:52or a third party what Hardware are you
- 31:55running on for example it might be x86
- 31:57arm or PPC do you need long-term
- 32:00stability can you accept or need a more
- 32:03volatile Cutting Edge system running the
- 32:05latest
- 32:10software the partition layout needs to
- 32:12be decided at the time of installation
- 32:15it can be difficult to change later
- 32:17while Linux systems handle multiple
- 32:19partitions by mounting them at specific
- 32:21points in the file system and you can
- 32:24always modify the design later it's
- 32:26always easier to try to get it right to
- 32:28begin with nearly all installers provide
- 32:32a reasonable default layout with either
- 32:34all space dedicated to normal files on
- 32:37one big partition and a smaller swap
- 32:39partition or with separate partitions
- 32:42for some space sensitive areas like home
- 32:45and VAR you may need to override the
- 32:47defaults and do something different if
- 32:49you have special needs or if you want to
- 32:51use more than one dis
- 32:58all installations include the bare
- 33:00minimum software for running a Linux
- 33:03distribution most installers also
- 33:05provide options for adding categories of
- 33:08software common applications such as the
- 33:11Firefox web browser and Libra office
- 33:14office suite developer tools like the V
- 33:17and emex text editors which we'll
- 33:20explore later and other popular services
- 33:22such as the Apache web server tools or
- 33:25mySQL database are usually included
- 33:28in addition for any system with a
- 33:30graphical desktop a chosen desktop such
- 33:33as nomer KDE is installed by default all
- 33:36installers set up some initial security
- 33:38features on the new system one basic
- 33:41step includes setting the password for
- 33:43the super user rout and setting up an
- 33:46initial user in some cases only an
- 33:49initial user set up direct root login is
- 33:52not configured and root access requires
- 33:54logging in first as a normal user and
- 33:56then using PSE sudo as we'll describe
- 33:58later some distributions will also
- 34:01install more advanced security
- 34:02Frameworks such as SE Linux or app armor
- 34:06for example all red hat based systems
- 34:08including Fedora and CN OS always use SE
- 34:11Linux by default and yuntu comes with
- 34:14app armor up and
- 34:19running like other operating systems
- 34:22Linux distributions are provided on
- 34:24removable media such as USB drives and
- 34:27CDs or D DVDs most Linux distributions
- 34:30also support booting a small image and
- 34:32downloading the rest of the system over
- 34:34the network these small images are
- 34:36usable on Media or as Network boot
- 34:38images in which case it is possible to
- 34:41perform and install without using any
- 34:43local media many installers can do an
- 34:46installation completely automatically
- 34:48using a configuration file to specify
- 34:51installation options this file is called
- 34:54a Kickstart file for Red Hat based
- 34:56systems and Auto yes profile for Susi
- 34:59based systems and a preed file for
- 35:02Debian based systems each distribution
- 35:05provides its own documentation and tools
- 35:08for creating and managing these
- 35:14files the actual installation process is
- 35:17pretty similar for all
- 35:19distributions after booting from the
- 35:21installation media the installer starts
- 35:23and asks questions about how this system
- 35:26should be set up these questions are
- 35:28skipped if an automatic installation
- 35:31file is provided then the installation
- 35:34is performed finally the computer
- 35:36reboots into the newly installed system
- 35:39on some distributions additional
- 35:41questions are asked after the system
- 35:43reboots most installers have the option
- 35:46of downloading and installing updates as
- 35:49part of the installation process this
- 35:51requires internet access otherwise the
- 35:54system uses its normal update mechanism
- 35:57to retrieve retrieve those updates after
- 35:59the installation is
- 36:04done the demonstrations we see show how
- 36:07to install Linux directly on your
- 36:09machine erasing everything that was
- 36:11there while the demonstrations will not
- 36:14alter your computer following these
- 36:16procedures in real life will erase all
- 36:19current data there are also alternate
- 36:21methods to install Linux where you won't
- 36:23lose any data so some of those methods
- 36:26include repartition your hard disk to
- 36:28free up enough room to permit dual boot
- 36:31or side by-side installation of Linux
- 36:34along with your present operating system
- 36:36or using a host machine hypervisor
- 36:38program such as vmware's products or
- 36:41Oracle virtual box to install a client
- 36:44Linux virtual machine and finally
- 36:46booting off of and using a live CD or
- 36:49USB disc and not riding to the hard disk
- 36:51at all the first method is sometimes
- 36:54complicated and should be done when your
- 36:56confidence is high and you understand
- 36:58the steps involved the second and third
- 37:01methods are quite safe and make it
- 37:04difficult to damage your
- 37:09system here are the steps to install
- 37:11yuntu now going to do an install of
- 37:14Ubuntu
- 37:151804 as a virtual machine under the
- 37:18VMware hypervisor using a redhead 7 host
- 37:24system running VMware Player
- 37:28so first thing we need to do is to
- 37:31create a new virtual
- 37:33machine and for that I already have the
- 37:37uh Ubuntu install disc
- 37:40mounted
- 37:42uh in the virtual CD drive and we'll
- 37:45give it a
- 37:47name for the user as LF
- 37:52student with a username of student and
- 37:56we have to give a password
- 37:59which I've
- 38:01done and then for the name let's just
- 38:03call it Ubuntu and then on the host
- 38:05machine I want to have a certain place I
- 38:08want to put it uh rather than my home
- 38:11directory I want it in a on a disc that
- 38:14has a lot of
- 38:16space and then let's allocate 30 gigabyt
- 38:21of
- 38:22space and I prefer to have it as one big
- 38:26file rather than multiple files or
- 38:28slices I find that clutters my system
- 38:34less and really that's all you have to
- 38:36do to start setting up the install but
- 38:39it's better to click on customize
- 38:41hardware and increase the amount of
- 38:44memory from 1 Gigabyte to four in my
- 38:47case and I might as well take advantage
- 38:49of having multiple processors so I'll
- 38:51let it use all four processors on this
- 38:55host machine
- 38:57and then I'll just click on
- 39:00finish and uh it will start the install
- 39:03after a couple of harmless messages
- 39:06about how the virtual machine graphics
- 39:09driver doesn't permit accelerated
- 39:12graphics
- 39:14performance
- 39:15now the beautiful thing about the Ubuntu
- 39:19install on this recent version is that I
- 39:22am done there are no more choices to
- 39:24make I don't have any more parameters to
- 39:26specify
- 39:27Etc if I hadn't been installing in a
- 39:30virtual machine it would have asked me
- 39:33information like username and password
- 39:37at this stage but it was able to pick
- 39:39that up because of the intelligent way
- 39:42that VMware can handle UB
- 39:44to so I'm doing this in real time if you
- 39:48can read the messages you see it just
- 39:50created the the main file system on the
- 39:54system and now it's going to the stage
- 39:56of copying all the files over to the
- 39:59hard disk or I should say the simulated
- 40:02hard disk now this takes a little bit of
- 40:05time so I'll pause the recording for a
- 40:08few seconds so you don't have to watch
- 40:10not much happening I skipped about a
- 40:12minute or so and now it says it's almost
- 40:15finished copying files it's showing a
- 40:18bunch of different blurbs for various
- 40:21features in this bionic Beaver or Ubuntu
- 40:2518.04 release
- 40:30the status bar has reached all the way
- 40:32to the right so it should be almost
- 40:36done and now it's doing the actual
- 40:39install of the system so it's copied all
- 40:41the files it needs over to the hard disk
- 40:44and it's doing the actual
- 40:52configuration so once again I believe
- 40:54I'll pause for a little while so you
- 40:56don't have to sit here and watch not
- 40:58much
- 40:59happening paused for about a minute now
- 41:02it says it's configuring
- 41:05Hardware so it's finding all the
- 41:07hardware devices in the system making
- 41:09sure it has the right device drivers for
- 41:12it
- 41:14Etc it's now configuring the boot loader
- 41:17the
- 41:18grub and now it's doing cleanup it's
- 41:21getting rid of packages which were only
- 41:24needed during the install
- 41:30and of course
- 41:33that's rolling by far too fast to be
- 41:41readable and
- 41:44so it's doing a little bit more package
- 41:49installation I think I'll pause again
- 41:51for a little
- 41:54while so it reached the end of the
- 41:57status bar and now it's doing the
- 42:05reboot and shortly I should be getting a
- 42:07login
- 42:14prompt if you notice it's installing
- 42:17open VM tools that's a package of
- 42:20special drivers and configuration stuff
- 42:24that's used when you're running it as a
- 42:27guest under VMware
- 42:33hypervisor and we've reached the login
- 42:35screen running under the
- 42:37greeter so I'll just log in as
- 42:43student and oops I typed in the wrong
- 42:46password I suppose
- 42:52yep and now the system's running there's
- 42:55a few introductory uh messages here and
- 42:58I'll just click through them to get to a
- 43:02fully up system and then just to see
- 43:05what really happened here if I right
- 43:07click I can open up a
- 43:09terminal and then I'm going to run the
- 43:11command DF for dis
- 43:14free- T to show me what type of file
- 43:17systems I have in h to print out the
- 43:20results in megabytes and
- 43:23gigabytes and I see that in the main
- 43:25file system I have 30 GB of space of
- 43:29which I'm using 5.3 and it's an ext4
- 43:33file system when we install Centos we
- 43:36need to actually specify the type of
- 43:38file system the size of the partition
- 43:41Etc but auntu made choices that it
- 43:44thought were best likewise uh we won't
- 43:48talk about this now but if I look
- 43:50at Swap
- 43:52files you'll see that there is a swap
- 43:55file of about 1 and a 12 Gab
- 43:58created uh instead of a swap partition
- 44:00usually distributions create swap
- 44:03partitions so that's all there is to
- 44:06install the latest uh version of
- 44:09Ubuntu uh absolutely nothing to do
- 44:11during the install it makes what it
- 44:13thinks as sensible decisions for
- 44:15everything and after the system is up
- 44:17and running you could then go into the
- 44:19package manager and put in exactly what
- 44:21you need and configure the system in
- 44:23other ways if you need a more flexible
- 44:26installation
- 44:28to begin with you can make such choices
- 44:31uh when you start but we we took the
- 44:33easy path
- 44:36here here are the steps to install syn
- 44:40OS we are now going to do a fresh
- 44:43install of
- 44:45Centos 8.1 the latest version of Centos
- 44:50at the time of this
- 44:51installation we have already allocated
- 44:55hard disk space for this install ation
- 44:57to make a virtual machine under
- 45:00VMware and we have inserted
- 45:03the install dis image and we're ready to
- 45:07begin so we will uh not take the step of
- 45:11testing the media and installing it
- 45:13because uh that takes some time so we'll
- 45:16just go directly to an install so I'll
- 45:18just move to the first element here and
- 45:21hit
- 45:23return and uh we'll try to do this
- 45:25install as as quickly as possible so
- 45:28we'll choose mostly the uh default
- 45:32choices and we're going to do a
- 45:34workstation install rather than a server
- 45:37install uh because this is what is
- 45:40desired for this course um to have an to
- 45:44have a user based uh
- 45:52install Okay so the first choice is to
- 45:55pick the language we'll pick
- 46:03English and then uh we can go really
- 46:06through any order we want through these
- 46:08different
- 46:09choices uh to begin with but let's just
- 46:12go in order so we've already picked an
- 46:13English keyboard with the US uh layout
- 46:17and also language support is set up for
- 46:19English for United States you can click
- 46:21on these to make those changes for the
- 46:24time and date uh it's actually better to
- 46:26to make sure the network is installed
- 46:29first so here I'm going I clicked on
- 46:32network and I'm going to turn on the
- 46:35network it found the network card and
- 46:37it's kind of ready to go probably should
- 46:41configure uh but I think the default
- 46:44choices will be fine if I go to General
- 46:47uh it says all users May connect and
- 46:51then if I go to ipv vce settings you'll
- 46:54see it's automatic DHCP
- 46:57uh so that's generally what you want
- 46:59rather than having to give it a fixed
- 47:01address so we'll just say okay for all
- 47:05this and
- 47:06uh
- 47:08um I guess we should say connect
- 47:11automatically with priority zero that
- 47:13means it'll always connect when you
- 47:15start up the machine and we can say done
- 47:18the reason it's good to do that before
- 47:20we set the time and date is we can now
- 47:23have Network time on which means it will
- 47:25automatically find a
- 47:27time
- 47:29uh I'm currently doing this installation
- 47:32from Central Time Zone in the United
- 47:35States so you can try to do that with
- 47:38the
- 47:39mouse and I got it right it's set for
- 47:41Chicago which is Central Time so I'll
- 47:44say
- 47:45done and then uh the installation source
- 47:49is uh rather important but that's local
- 47:52media I already have the DVD set as you
- 47:55see at Centos 8-11 1911 that's the uh
- 47:59latest version of
- 48:01Centos for the software
- 48:04selection uh let's just keep the
- 48:07workstation I could make it a server
- 48:09with a graphical interface or just a
- 48:11server if I really wanted to be quick I
- 48:13could do a minimal install and then
- 48:15bring everything up later that I need uh
- 48:18but within the workstation I should pick
- 48:20a few things so I'll pick gnome
- 48:22applications internet
- 48:25applications uh you'll probably want to
- 48:27pick the office suite and productivity
- 48:28but I'd like this to go quickly so I
- 48:30won't do that right
- 48:32now uh I'll pick development Tools in
- 48:35case I want to compile
- 48:37anything um and that's probably the main
- 48:40things I need right now but you can
- 48:42always change everything in detail once
- 48:44the system's up so it's it's good to do
- 48:48a a relatively quick
- 48:50install the trickiest part here is to do
- 48:53the
- 48:54installation um
- 48:56partitioning setup so I'll pick I've
- 49:00already got picked here the virtual 30
- 49:03gigabyte disc and if I wanted to take
- 49:06things really fast I would do automatic
- 49:09storage
- 49:10configuration uh and let it decide what
- 49:12kind of partitions I should have how big
- 49:15they should be Etc and you may want to
- 49:17at least look at that but I let me just
- 49:19do custom because it fits in better with
- 49:21my needs and then I can say
- 49:24done okay and then I get to pick what
- 49:27kind of installation I want to do a
- 49:30standard partition and not an lvm which
- 49:33is logical volume management uh I just
- 49:36want a simple standard partition so I'll
- 49:38do that and then I actually have to
- 49:40create the partitions I need so I hit
- 49:43the plus sign and I'll have one big
- 49:46partition for everything so it's mounted
- 49:49at slash and let's give it 29
- 49:53gabes and I'll add that this is a 30 G
- 49:56abte dis and then I'll add one
- 49:59more okay and that won't be mounted
- 50:02that'll be for Swap and if I don't give
- 50:05it desired capacity it should take it
- 50:08all uh which it actually decided it
- 50:12should have three gigabytes I'll let the
- 50:15system go with what it wants it's it's
- 50:17doing that based on how much uh memory I
- 50:20have okay um and it says I have only
- 50:24like one megabyte left I the total 30
- 50:28gabt the one other thing I get to do for
- 50:31the first Mount Point here is pick what
- 50:33kind of file system and you notice the
- 50:36default on red hat now is or C is xfs
- 50:40let me make it
- 50:42ext4 um which is which is easier to
- 50:46mount from other other machines Etc than
- 50:50xfs but you can just take the the uh
- 50:53default if you prefer and then I'd say
- 50:55done and and should be done it's telling
- 50:59me do I really want to do this cuz it's
- 51:01going to wipe out everything that's on
- 51:02that dis I'll say sure accept the
- 51:06changes so uh I'm pretty much done uh K
- 51:10dump is a system you can set up so that
- 51:14if the system crashes you produce what's
- 51:16called a cord dump file so I'll just you
- 51:19know you probably won't need to use that
- 51:22it'll be a little faster to boot uh when
- 51:24you have a new kernel so I'll just not
- 51:27enable that but if you're doing a
- 51:29develop machine you probably want that
- 51:32we already configured the network and
- 51:34under security policy uh we won't do any
- 51:38specialization we'll just leave it alone
- 51:40for now you can always change it later
- 51:43and then you just say begin
- 51:46installation now it'll already take a
- 51:48head start on trying to load some
- 51:51packages and files while you have some
- 51:53more information to put in uh first have
- 51:56to pick a password for the root account
- 52:00and so I'll do that and it's actually LF
- 52:03train for uh Mach virtual machines we
- 52:07use for the classes which is a pretty
- 52:09simple
- 52:10password and
- 52:13uh it's it's hard to read here but it it
- 52:16should be saying it's too simple I can't
- 52:19see that oh it says weak here but it
- 52:21says press done again to use the
- 52:23password anyway so I'll do that this is
- 52:26a away machine and then I have to create
- 52:29a user I'll make the full name of the
- 52:32user LF student and by choice by default
- 52:36it wants to make the username of the
- 52:38account L student but we'll just make it
- 52:42student um it will require a password to
- 52:45use this account if we said make this
- 52:48user administrator it would be like
- 52:51Ubuntu systems where there's just one
- 52:53password and uh you have to do su to do
- 52:56anything privileged but let's keep a
- 52:59standard Unix type set up with separate
- 53:01accounts and passwords for the student
- 53:03user and the root user so we're going to
- 53:06give a very simple password again just
- 53:08the word
- 53:10student and once you get it oh it says
- 53:13it does not match I must have typed
- 53:14things wrong let's try again St
- 53:18ENT St
- 53:21ENT yeah so now it says the password
- 53:24contains the username and some form
- 53:27you will have to pass done twice to
- 53:28confirm it it's also considered very
- 53:30weak but we'll accept it once again it's
- 53:33a throwaway machine in real life you
- 53:35shouldn't do
- 53:37this and so I say
- 53:40done and now uh we just have to wait for
- 53:43the install you'll see it has installed
- 53:46F 500 some odd packages out of
- 53:501481 we could keep watching while this
- 53:52happens but it takes some time so I'm
- 53:54going to pause the recording and come
- 53:56back when it's almost
- 54:05done so it has finished and it's
- 54:08configuring the kernel
- 54:10now uh that takes a little bit of time
- 54:13it installed I think, 1481 packages so
- 54:17now it's doing the actual configuration
- 54:19of the kernel it is doing a few other
- 54:23configuration steps you'll notice it is
- 54:26is installing the boot loader it
- 54:28configured the
- 54:29editors is generating What's called the
- 54:32init Ram FS which is uh needed to boot
- 54:36it contains the initial file system
- 54:38which is stored in memory for just for
- 54:41the system booting which we talk about
- 54:44in detail in this
- 54:47course and this is probably the last
- 54:50thing it really has to do before it's
- 54:52done uh depending on the complexity of
- 54:55things it can take away while is now
- 54:57complete so now we can simply reboot so
- 55:02let's do that and we should have a
- 55:05running
- 55:10system and you see it's wants to boot
- 55:13there into the default kernel
- 55:174.8.0 and I didn't do anything it will
- 55:20automatically boot on its own
- 55:27and then there's a few things that
- 55:28happen when you start up the first time
- 55:32I it wants me to accept the uh and user
- 55:35license which is pretty simple for uh
- 55:39open source
- 55:42product uh and then finish
- 55:45configuration it has a few other things
- 55:48to set up and we're ready to do our
- 55:51first login as student so I clicked on
- 55:54that I type in the password
- 56:02and we have an up and running
- 56:05system and uh it's going to ask us to
- 56:08confirm again our choice of
- 56:11language and uh we could check to make
- 56:14sure the keyboard is okay but uh we're
- 56:16fine with English
- 56:18us and uh I'm going to turn off location
- 56:21services that's a that's a choice you
- 56:24can make
- 56:27and if you want you can connect to
- 56:29various online accounts so we're going
- 56:31to skip all that and we're ready to go
- 56:35so now we have a fully functional system
- 56:38it brings up so a tutorial screen if you
- 56:40want to get some more information we'll
- 56:42just skip
- 56:44that and here we are it's a fully
- 56:46functional system if I want to uh get a
- 56:50little information let me drop to a
- 56:51command line so I clicked on activities
- 56:54I'll say terminal and and here we are so
- 56:57for instance if I do
- 57:00df- you'll see uh I've used 5.2
- 57:04GB uh and there's plenty of space
- 57:07available uh if I wanted to change the
- 57:09size of the screen depending on your
- 57:11hypervisor sometimes you can just kind
- 57:13of drag it out or something but uh here
- 57:17let me go to display settings and it's
- 57:19set for 1280 time 78
- 57:23768 and I obviously can go bigger so
- 57:26just to show you for instance let's say
- 57:29I take 19 20 by
- 57:331220 and I'm filling up the whole screen
- 57:36now it's actually bigger than my whole
- 57:38screen so I'll revert the settings but
- 57:40you can do all sorts of other
- 57:42adjustments and we've done a complete
- 57:44install of centos8 it's all set and
- 57:47ready to use and customize to your
- 57:49heart's
- 57:52content here are the steps to install
- 57:54open Susi
- 57:56we are now going to do a fresh install
- 57:58of open Su as a virtual machine under a
- 58:01VMware hypervisor on a red hat 7
- 58:05system we have already inserted the
- 58:07installed DVD and we are about to begin
- 58:12notice that in our initial screen we can
- 58:14do an installation and upgrade or if we
- 58:17scroll down to
- 58:19more we see that we can also use the
- 58:22install DVD as a rescue system uh uh we
- 58:26can check memory and do various things
- 58:28but we're going to do an install so I'll
- 58:31just pick on install and then it will
- 58:34cook for a while before it asks me to do
- 58:39anything uh so now it's finding all the
- 58:42hardware deciding what drivers to use
- 58:44Etc and getting
- 58:48started this is open Su leap version
- 58:5142.3
- 58:57and this is a typical gnome graphical
- 59:00booting screen while it's getting itself
- 59:09ready it should take a few more
- 59:13seconds I'll pause so we don't have to
- 59:15watch the whole thing okay it has moved
- 59:18on and it's about ready to bring up a
- 59:20graphical screen and there we go
- 59:26so it's initializing the hardware on the
- 59:32system okay now it's asking whether we
- 59:35want to accept English as a language and
- 59:38also the license agreement so we'll just
- 59:40say
- 59:41sure click on the next button it's doing
- 59:45more probing of the system deciding what
- 59:47to
- 59:51do and it says in a very small font
- 59:54initializing the installation now it
- 59:57would like to take a default partition
- 1:00:00scheme which we will
- 1:00:03override um so let me say edit proposed
- 1:00:07settings and I will take a
- 1:00:09partition-based
- 1:00:11proposal I will choose for my root
- 1:00:14partition
- 1:00:15ext4 I won't have any separate home
- 1:00:19partition or other partitions to keep
- 1:00:20things simple and that's all I have to
- 1:00:23choose so it's pretty simple
- 1:00:26and it says here it's going to create a
- 1:00:28swap partition of 2 gabt and then a root
- 1:00:32partition for everything else 28
- 1:00:35gigabytes um and so I'm happy enough
- 1:00:38with that so I'll just say
- 1:00:46next and first thing is just to pick the
- 1:00:50time zone so I'll pick central
- 1:00:52time where I am currently sitting
- 1:00:56and I could do some other
- 1:00:59settings that unless I don't want to
- 1:01:01take automatic time
- 1:01:03setting so I just say
- 1:01:06next and here I have a choice for what
- 1:01:08kind of desktop let me pick the gome
- 1:01:10desktop I could pick the KDE or as a
- 1:01:13server pure text mode no graphical or I
- 1:01:16could do custom to do something a little
- 1:01:18more complicated or
- 1:01:21different and then it wants me to give a
- 1:01:25a full name name for uh the main user
- 1:01:27I'll say LF
- 1:01:30student and for username I'll pick
- 1:01:32student and I'll give a
- 1:01:36password and then I will not pick use
- 1:01:38this password for system administrator
- 1:01:41that would be like what auntu does and I
- 1:01:43will not pick automatic log and it's
- 1:01:45generally not a good idea to let your
- 1:01:47system log in without having to give a
- 1:01:50password so I'll say
- 1:01:52next it doesn't like my password because
- 1:01:55it's too simple but I'll say okay do it
- 1:01:58and now I have to give a root
- 1:02:02password and you might want to test your
- 1:02:04keyboard layout to make sure you have
- 1:02:06the right
- 1:02:08language I'll say next and once again
- 1:02:11it's going to complain my password is
- 1:02:12too
- 1:02:14simple and then I just say install and
- 1:02:17that's all the choices that I actually
- 1:02:20have to make uh so really nothing except
- 1:02:24specifying username password and what
- 1:02:27kind of desktop I want we can do further
- 1:02:30adjustments once the system is fully
- 1:02:33installed now while it's
- 1:02:35installing which should take about 10
- 1:02:38minutes uh the default screen here is a
- 1:02:41slide show giving you brochures and
- 1:02:44information if I click on details it's a
- 1:02:46little more fun to look at so you can
- 1:02:49see the overall progress as it goes this
- 1:02:52first bar here is for each package as it
- 1:02:55is being installed and on the bottom you
- 1:02:57can see I'm already about 15% installed
- 1:03:01so I'm going to pause the recording cuz
- 1:03:02it's kind of boring to watch it install
- 1:03:04all 1500 packages and I'll wait until
- 1:03:07it's asking me to do something again
- 1:03:09before
- 1:03:11resuming okay that took about less than
- 1:03:1410 minutes and now it's telling me the
- 1:03:17system is going to reboot and it
- 1:03:20did um and so we'll just see our normal
- 1:03:24booting uh
- 1:03:26of the new open Su
- 1:03:33system and uh it should quickly bring up
- 1:03:36the login
- 1:03:43screen just a few more seconds
- 1:03:56and there's our usual greeter screen
- 1:03:58I'll just type in the password for the
- 1:04:01student
- 1:04:02account and we have a fully operational
- 1:04:05open Su
- 1:04:06system now the first thing I would do
- 1:04:09from here is update the system because
- 1:04:12there's always new updates to various
- 1:04:15packages since the DVD install disc was
- 1:04:19released so that's important for both
- 1:04:21security and
- 1:04:22performance and it's even prompting me
- 1:04:25to go go ahead and do that and then I'd
- 1:04:27probably do some minor customizations
- 1:04:29about what kind of menus I see how
- 1:04:31Windows behave the keyboard Etc but I'll
- 1:04:34leave that for people to do as an
- 1:04:42exercise you have completed chapter 3
- 1:04:46Let's summarize the key Concepts covered
- 1:04:49a partition is a logical part of the dis
- 1:04:52a file system is a method of storing or
- 1:04:55finding files on a hard disk by dividing
- 1:04:58the hard disk into partitions data can
- 1:05:00be grouped and separated as needed when
- 1:05:03a failure or a mistake occurs only the
- 1:05:06data in the effective partition will be
- 1:05:08damaged while data on the other
- 1:05:11partitions will likely
- 1:05:13survive the boot process has multiple
- 1:05:15steps starting with the BIOS which
- 1:05:18triggers the boot loader to start up the
- 1:05:20Linux kernel from there the init Ram FS
- 1:05:23file system is invoked which triggers
- 1:05:25the anet program to complete the startup
- 1:05:28process and determining the appropriate
- 1:05:31distribution to deploy requires that you
- 1:05:33match your specific system needs to the
- 1:05:36capabilities of the different
- 1:05:42distributions by the end of this chapter
- 1:05:44you should be able to manage graphical
- 1:05:47interface sessions perform basic
- 1:05:50operations using the graphical interface
- 1:05:53change the graphical desktop to suit
- 1:05:55your needs needs you can use either a
- 1:05:57command line interface or a graphical
- 1:05:59user interface when using Linux to work
- 1:06:03at the CLI you have to remember which
- 1:06:05programs and commands are used to
- 1:06:07perform tasks on the other hand using
- 1:06:10the guey is often quick and easy it
- 1:06:12allows you to interact with your system
- 1:06:14through graphical icons and screens for
- 1:06:18repetitive tasks the CLI is often more
- 1:06:20efficient while the guei is easier to
- 1:06:22navigate if you don't remember all the
- 1:06:24details or do something only rarely
- 1:06:27we'll learn how to manage sessions using
- 1:06:29the guey for the three Linux
- 1:06:31distribution families that we cover the
- 1:06:33most in this course which are red hat
- 1:06:36including C and Fedora Susi open Susi
- 1:06:39and deian Ubuntu and mint in subsequent
- 1:06:43sections of this course we'll
- 1:06:44concentrate in great detail on the
- 1:06:47command line interface which is pretty
- 1:06:49much the same on all distributions
- 1:06:52generally in a Linux desktop system the
- 1:06:54x windows system is loaded as one of the
- 1:06:57final steps in the boot process it's
- 1:06:59often just called x a service called the
- 1:07:02display manager keeps track of the
- 1:07:04displays being provided and loads the X
- 1:07:07server so-called because it provides
- 1:07:09graphical services to Applications
- 1:07:12sometimes called X clients the display
- 1:07:14manager also handles graphical logins
- 1:07:17and starts the appropriate desktop
- 1:07:19environment after a user logs in X is
- 1:07:22rather old software it dates back to the
- 1:07:24mid1 1980s
- 1:07:26and as such it has certain def
- 1:07:28deficiencies on Modern systems for
- 1:07:30example with security and it's been
- 1:07:32stretched rather far from its original
- 1:07:35purpose a newer system known as Wayland
- 1:07:38is gradually superseding it and is the
- 1:07:40default display system for Fedora real 8
- 1:07:42and other recent distributions for the
- 1:07:45most part it looks just like x to the
- 1:07:47user although under the hood it's quite
- 1:07:49different a desktop environment consists
- 1:07:52of a session manager which starts and
- 1:07:54maintains the components of the
- 1:07:56graphical session and the window manager
- 1:07:59which controls the placement and
- 1:08:00movement of Windows the window title
- 1:08:03bars and controls although these can be
- 1:08:06mixed generally a set of utilities
- 1:08:09session manager and Window Manager are
- 1:08:11used together as a unit and together
- 1:08:13they provide a seamless desktop
- 1:08:15environment if the display manager is
- 1:08:18not started by default in the default
- 1:08:20run level you can start the graphical
- 1:08:22desktop in different in a different way
- 1:08:24after logging into a text mode console
- 1:08:27by running start X from the command line
- 1:08:29when you install a desktop environment
- 1:08:31the X display manager starts at the end
- 1:08:34of the boot process it's responsible for
- 1:08:36starting the graphics system logging in
- 1:08:38the user and starting the user's desktop
- 1:08:41environment you can often select from a
- 1:08:43choice of desktop environment when
- 1:08:46logging into the system gnome is a
- 1:08:48popular desktop environment with an
- 1:08:50easyto usee graphical user interface
- 1:08:53it's bundles as the default desktop
- 1:08:55environment for most Linux distributions
- 1:08:58including Red Hat Enterprise Linux re
- 1:09:00Fedora Centos Susi Linux Enterprise
- 1:09:03auntu and deian gome has menu based
- 1:09:06navigation and is sometimes an easy
- 1:09:09transition to accomplish for Windows
- 1:09:11users however as you'll see the look and
- 1:09:14feel can be quite different across
- 1:09:16distributions even if they're all using
- 1:09:18gnome another common desktop environment
- 1:09:20very important in the history of Linux
- 1:09:23and also widely used is KD e which has
- 1:09:26often been used in conjunction with Susi
- 1:09:28and open Susi as previously mentioned
- 1:09:31most desktop environments follow a
- 1:09:33similar structure to gnome and we'll
- 1:09:35restrict ourselves mostly to it to keep
- 1:09:37things less complex let's demonstrate
- 1:09:40how we log in and log out of a system
- 1:09:43which has already been booted on all
- 1:09:45recent distributions this looks pretty
- 1:09:47much the same here we're showing an
- 1:09:50instance of Centos stream which has
- 1:09:54three users on the system
- 1:09:55and I can log in in any one of them by
- 1:09:58selecting so let's go with the second
- 1:10:00one BJ moose and you'll notice that when
- 1:10:03I log in if I click on the gear item I
- 1:10:05have a choice of different
- 1:10:07desktops okay here's the default on
- 1:10:10couette stream which is a whan but I can
- 1:10:13pick a couple different kinds of x11s if
- 1:10:17I want I'll type in the
- 1:10:21password and I log in I depending on
- 1:10:24what's going on it may see a little bit
- 1:10:26of information um and that's all
- 1:10:30involved in logging in I probably won't
- 1:10:32see a hell of a lot uh this is a new
- 1:10:34user without much going on if I click on
- 1:10:37activities for instance I'll see some
- 1:10:39favorite
- 1:10:40applications uh if I click on Terminal
- 1:10:43here I can bring up a terminal if I want
- 1:10:45to do command line activity to log out
- 1:10:48all I have to do is go in the upper
- 1:10:49right corner and I can click on my
- 1:10:53name and then I can say either switch
- 1:10:55user or log out I would do switch user
- 1:10:58if I want to keep more than one session
- 1:11:00active at a time for different people
- 1:11:02which is something you probably won't
- 1:11:04want to do very often but it would mean
- 1:11:06if I came back into this user session I
- 1:11:09would see the whatever applications I
- 1:11:12had open but I'll just pick on log out
- 1:11:15and then I click here log out and I'm
- 1:11:19back to my greeter or my login screen
- 1:11:21where I can pick the users again so I
- 1:11:24can log in on any one of them so that's
- 1:11:27a simple demonstration of how one logs
- 1:11:29in and out of a system each Linux
- 1:11:32distribution comes with its own set of
- 1:11:34desktop backgrounds you can change the
- 1:11:36default by choosing a new wallpaper or
- 1:11:39selecting a custom picture to be set as
- 1:11:41the desktop background if you don't want
- 1:11:44to use an image as the background you
- 1:11:47can select a color to be displayed on
- 1:11:49the desktop instead in addition you can
- 1:11:52also change the desktop theme which
- 1:11:54changes the look feel of the Linux
- 1:11:56system the theme also defines the
- 1:11:59appearance of application windows so
- 1:12:02let's see how to change the desktop
- 1:12:03background and
- 1:12:05theme we are going to demonstrate how to
- 1:12:08change the background wallpaper on a red
- 1:12:11hat 7 system all recent Linux
- 1:12:14distributions have exactly the same
- 1:12:15method so this will suffice to show for
- 1:12:19all so all we have to do is click on the
- 1:12:23background with a right click
- 1:12:25and change
- 1:12:29background click on background again and
- 1:12:31then we have a choice between wallpapers
- 1:12:34that the system knows already and it's
- 1:12:38possible to load up other ones so let's
- 1:12:40say we pick this one
- 1:12:42here and you see now the background has
- 1:12:45been
- 1:12:46changed or I could pick for instance a
- 1:12:49picture stored on my machine in my
- 1:12:52pictures directory under my home
- 1:12:54directory so I'll pick this
- 1:12:57one and you see it's been
- 1:13:00changed so that's all we have to do to
- 1:13:02change the background on any recent
- 1:13:04Linux
- 1:13:10system most common settings both
- 1:13:13personal and systemwide are to be found
- 1:13:15by clicking in the upper right hand
- 1:13:17corner on either a gear or other obvious
- 1:13:21icon depending on your Linux
- 1:13:23distribution
- 1:13:25however there are many settings which
- 1:13:27many users would like to modify which
- 1:13:30are not accessible in that way the
- 1:13:33default settings utility is
- 1:13:35unfortunately rather Limited in modern
- 1:13:37gnome based
- 1:13:38distributions unfortunately the Quest
- 1:13:40for Simplicity has actually made it
- 1:13:43difficult to adapt your system to your
- 1:13:45tastes and needs fortunately there is a
- 1:13:48standard utility gnome tweaks which
- 1:13:51exposes many more setting options it
- 1:13:54also perits you to easily install
- 1:13:56extensions by external parties not all
- 1:13:58Linux distributions install this tool by
- 1:14:00default but it's always available you
- 1:14:02may have to run it by hitting alt F2 and
- 1:14:05then typing in the name you may want to
- 1:14:07add it to your favorites list as we
- 1:14:09shall discuss in this screenshot the
- 1:14:11keyboard mapping is being adjusted so
- 1:14:14the useless cap loot key can be used as
- 1:14:18an additional control key this saves
- 1:14:20users who use control a lot such as emac
- 1:14:23efficient autos from getting physically
- 1:14:26damaged by pinky
- 1:14:32strain the visual appearance of
- 1:14:34applications the buttons scroll bars
- 1:14:36widgets and other graphical components
- 1:14:38are controlled by a theme gnome comes
- 1:14:42with a set of different themes which can
- 1:14:44change the way your applications look
- 1:14:48the exact method for changing your theme
- 1:14:51may depend on your distribution for
- 1:14:54older gnome based distributions you can
- 1:14:56simply run gnome tweaks as shown in this
- 1:15:00screenshot from Ubuntu
- 1:15:05however now you'll be able to see a
- 1:15:08demonstration for logging in and out on
- 1:15:11the major Linux distribution families
- 1:15:13we'll concentrate on in this course note
- 1:15:16that Evolution has brought us to a stage
- 1:15:18where little it matters little which
- 1:15:20distribution you choose as they're all
- 1:15:22rather similar recent Linux distribution
- 1:15:25which use the gnome desktop look
- 1:15:28remarkably the same when it comes to the
- 1:15:30process of starting up and shutting down
- 1:15:33so we will demonstrate that here by
- 1:15:35using a VMware hypervisor on a red hat
- 1:15:39Enterprise Linux host and we'll
- 1:15:41demonstrate three recent distributions
- 1:15:44and how they boot so we've already teed
- 1:15:47them up so here I will start Centos
- 1:15:52stream here I will start Ubuntu
- 1:15:562004 and here I will start open
- 1:16:00Su leap
- 1:16:0315.3 so you'll see a little bit
- 1:16:05different messages on each as they boot
- 1:16:07uh according to how grub is configured
- 1:16:10and what the possible kernel choices are
- 1:16:13it will take longer to boot than they
- 1:16:16were normally would if I was only doing
- 1:16:18one at a time simply because uh the host
- 1:16:21machine's a little bit overloaded
- 1:16:23running three virtual Machin machines it
- 1:16:25really doesn't have a ton of memory uh
- 1:16:28in this case I have allotted 3 GB of
- 1:16:31memory to each out of a total of 16 gab
- 1:16:36on the machine so it's a little bit
- 1:16:39memory stressed uh so we'll just wait
- 1:16:41till they start and reach their greeter
- 1:16:44screen which you see we've already done
- 1:16:46that on
- 1:16:47auntu we've already done that on open Su
- 1:16:51leap and it's taking somewhat longer on
- 1:16:55s uh H stream so let's log into these
- 1:16:59guys while we wait for SOS stream to get
- 1:17:02ready so I'll log in the
- 1:17:05student password here on the uh Ubuntu
- 1:17:09machine I'll do the same thing on the
- 1:17:11open Su
- 1:17:15machine and now we're just waiting for
- 1:17:18the Cent 8
- 1:17:22machine finally ready and then I'll log
- 1:17:25in there as
- 1:17:27well and you notice they have different
- 1:17:30background pictures just because we have
- 1:17:32selected different background pictures
- 1:17:34over time but they all arrive to pretty
- 1:17:37much the same appearance with an
- 1:17:39activities and an applications menu and
- 1:17:42then uh Ubuntu still likes to have this
- 1:17:45uh sidebar on the left with major
- 1:17:49applications um I can easily bring that
- 1:17:51up on the other ones for instance if I
- 1:17:53type activities here activities on open
- 1:17:57Su I will see the same thing
- 1:18:00there and then the process of shutting
- 1:18:03down is also quite similar all I need to
- 1:18:05do is click in the upper right hand
- 1:18:08corner and I find the power
- 1:18:10icon and I just say power
- 1:18:13off I'll do the same thing with the
- 1:18:16Buu I get power off going to go power
- 1:18:20off and I can do the same thing with
- 1:18:22open SU
- 1:18:25power off and power off so it's
- 1:18:26remarkably the same from distribution to
- 1:18:29distribution these
- 1:18:34days it's often a good idea to lock your
- 1:18:37screen to prevent other people from
- 1:18:39accessing your session while you're away
- 1:18:41from your computer note this does not
- 1:18:43suspend the computer all your
- 1:18:45applications and processes continue to
- 1:18:47run while the screen is
- 1:18:50locked let's show how to lock and unlock
- 1:18:53your screen on any recent gnome
- 1:18:56distribution so the simplest way is to
- 1:18:58go to the upper right corner and click
- 1:19:00and find the lock
- 1:19:03button and simply and simply click on
- 1:19:06that and then you can unlock it by
- 1:19:09clicking on the display on the time
- 1:19:12there and just typing in the password
- 1:19:15again very simple another way to do it
- 1:19:18is through combination of keys uh
- 1:19:21depending on your machine this will
- 1:19:23generally be the Super Key plus l or the
- 1:19:26Super Key plus the Escape where the
- 1:19:28super key is also known as the Windows
- 1:19:30key uh so let me do that here and once
- 1:19:33again I brought up the lock window and I
- 1:19:35can simply unlock it
- 1:19:37again so that's all that's involved it's
- 1:19:40very
- 1:19:46simple Linux is a true multi-user
- 1:19:50operating system which allows more than
- 1:19:52one user to be simultaneously logged in
- 1:19:54if more than one person uses the system
- 1:19:56it's best for each person to have their
- 1:19:58own user account and password this
- 1:20:01allows for individualize settings home
- 1:20:03directories and other files users can
- 1:20:06take turns using the machine while
- 1:20:09keeping everyone's sessions alive or
- 1:20:11even be logged in simultaneously through
- 1:20:14the
- 1:20:15network let us demonstrate how to switch
- 1:20:17users on an Ubuntu machine with several
- 1:20:22accounts so first I will choose the
- 1:20:25Linux Foundation student as the account
- 1:20:27to log
- 1:20:28into type my password and sign
- 1:20:33in and then if I look in the upper right
- 1:20:36hand
- 1:20:37corner and click there I will see LF
- 1:20:41student and I can click on either log
- 1:20:44out or switch user notice if I log out I
- 1:20:47really log out but if I switch user I
- 1:20:49will just lock the user account and then
- 1:20:51when I start up I will preserve all of
- 1:20:54my sessions and open Windows Etc when I
- 1:20:58restart on some distributions you may
- 1:21:00actually see a list of users at this
- 1:21:03screen but not on Ubuntu so I'll say
- 1:21:06switch user I'm back to the greeter
- 1:21:09screen and let me pick the second one
- 1:21:11Theodor
- 1:21:14Cleaver and log in as that other
- 1:21:19user and there we go and now if I look
- 1:21:22up here again I can do the same thing
- 1:21:25so let me click on the name and I'll say
- 1:21:28switch
- 1:21:29user and if I pick student again you
- 1:21:32notice here it says unlock and not
- 1:21:35restart that means that if I were to log
- 1:21:37in now I will have preserved all the
- 1:21:39open windows and running applications
- 1:21:41from
- 1:21:42before this will look the same
- 1:21:44essentially on all Linux
- 1:21:46distributions of recent vintage so it's
- 1:21:48very easy to switch users and not lose
- 1:21:51any information from what you're already
- 1:21:53doing
- 1:22:00besides normal daily starting and
- 1:22:02stopping of the computer a system
- 1:22:04restart may be required as part of
- 1:22:06certain major system updates generally
- 1:22:09only those involving installing a new
- 1:22:11Linux kernel initiating the shutdown
- 1:22:14process from the graphical desktop is
- 1:22:17rather trivial on most current Linux
- 1:22:19distributions with very little variation
- 1:22:22we'll discuss later how to do this from
- 1:22:24the command line using the shutdown
- 1:22:26command in all cases you click on either
- 1:22:29a settings or gear or a power icon and
- 1:22:32follow the prompts to shut down the
- 1:22:34computer on any recent gnome based Linux
- 1:22:37distribution perform the following steps
- 1:22:40uh first click the power or the gear
- 1:22:42icon in the upper right hand corner of
- 1:22:44the screen second click on click on the
- 1:22:48power off restart or cancel if you do
- 1:22:51nothing the system will shut down in 60
- 1:22:53Seconds
- 1:22:55shutdown reboot and logout operations
- 1:22:57will ask for confirmation before going
- 1:22:59ahead this is because many applications
- 1:23:02will not save their data their data
- 1:23:04properly when terminated this way always
- 1:23:07save your documents and data before
- 1:23:09restarting shutting down or logging out
- 1:23:13all modern Computers support suspend or
- 1:23:16sleep mode when you want to stop using
- 1:23:19your computer for a while suspend mode
- 1:23:22saves the current system state and
- 1:23:24allows you to resume your session more
- 1:23:26quickly while remaining on but uses very
- 1:23:30little power in the sleeping state it
- 1:23:32works by keeping your systems
- 1:23:34applications desktop and so on in system
- 1:23:37Ram but turning off all the other
- 1:23:39Hardware this shortens the the time for
- 1:23:42a full system startup as well as
- 1:23:44conserves battery power once you note
- 1:23:46that modern Linux distributions actually
- 1:23:48boot so fast that the amount of time
- 1:23:50saved is often minor
- 1:23:57even experienced users can forget the
- 1:23:59precise command that launches an
- 1:24:01application or exactly what options and
- 1:24:03arguments it requires fortunately Linux
- 1:24:06allows you to quickly open applications
- 1:24:09using the graphical interface
- 1:24:11applications are found at different
- 1:24:12places in Linux and within gnome they
- 1:24:15can be found from the applications menu
- 1:24:18in the upper leftand corner or from the
- 1:24:22activities menu in the upper left hand
- 1:24:24corner also in some Ubuntu versions from
- 1:24:29the dash button in the upper leftand
- 1:24:31corner for KDE and some other
- 1:24:34environments applications can be opened
- 1:24:37from the button in the lower leftand
- 1:24:39corner in the upcoming sections you will
- 1:24:42learn how to perform basic Linux
- 1:24:43operations using the graphical
- 1:24:50interface unlike other operating systems
- 1:24:53the initial install of Linux usually
- 1:24:55comes with a wide range of applications
- 1:24:57and software archives that contain
- 1:24:59thousands of programs that enable you to
- 1:25:01accomplish a wide variety of tasks with
- 1:25:04your computer for most key tasks a
- 1:25:07default application is usually already
- 1:25:09installed however you can always install
- 1:25:11more applications and try different
- 1:25:13options for example Firefox is popular
- 1:25:17as the default browser in many Linux
- 1:25:19distributions while Epiphany codor and
- 1:25:22chromium the open source uh of Google
- 1:25:25Chrome are usually available for install
- 1:25:27from software repositories proprietary
- 1:25:30web browsers such as Opera and chrome
- 1:25:32are also available locating applications
- 1:25:35from The Gnome and KDE menus is easy as
- 1:25:38they're neatly organized in functional
- 1:25:41submenus multiple applications are
- 1:25:43available to accomplish various tasks
- 1:25:46and to open a file type a file of a
- 1:25:48given type for example you can click on
- 1:25:50a web address while reading an email and
- 1:25:52launch a browser such as fir fox or
- 1:25:55Chrome to set the default applications
- 1:25:58enter the settings menu on all recent
- 1:26:01Linux distributions and then click on
- 1:26:03either default applications or details
- 1:26:07default
- 1:26:08applications let's now demonstrate how
- 1:26:10to set default applications on a red hat
- 1:26:13system we go to the upper right hand
- 1:26:16corner click on the top bar then scroll
- 1:26:19down to the gears icon for settings go
- 1:26:23down to the bottom for d
- 1:26:25details and then I can click on default
- 1:26:29applications so you see under web or
- 1:26:31browser there are three choices on this
- 1:26:34system I have Google Chrome Firefox or
- 1:26:37Opera we'll leave it at Google
- 1:26:40Chrome for video the default choic is
- 1:26:44videos which is actually a program
- 1:26:46called totem but let's switch it to the
- 1:26:49VC media player and for the image viewer
- 1:26:52I have the built-in image viewer or I
- 1:26:55could switch to the new image
- 1:26:57manipulation program better known as
- 1:26:59so on all recent distributions with
- 1:27:03a gnome desktop the procedure is
- 1:27:06identical and absolutely the same and
- 1:27:08it's very simple to change your default
- 1:27:15applications each distribution
- 1:27:17implements the naist or file manager
- 1:27:21utility which is used to navigate the
- 1:27:23file system
- 1:27:24it can locate files and when a file is
- 1:27:26clicked upon either it will run if it's
- 1:27:29a program or an associate application
- 1:27:31will be launched using the file as data
- 1:27:34this behavior is completely familiar to
- 1:27:36anyone who has used other operating
- 1:27:38systems to start the file manager you
- 1:27:41will have to click on its icon a file
- 1:27:43cabinet which is easily found usually
- 1:27:46under favorites or accessories it will
- 1:27:49have the name files this will open a
- 1:27:52window with your home directory
- 1:27:54displayed the left panel of the file
- 1:27:56manager window holds a list of commonly
- 1:27:59used directories such as desktop
- 1:28:03documents downloads and
- 1:28:09pictures the file manager let you access
- 1:28:11different locations on your computer and
- 1:28:13the network including the home directory
- 1:28:16the desktop uh documents pictures and
- 1:28:20other other locations every user with an
- 1:28:23account on on the system will have a
- 1:28:25home directory usually created under
- 1:28:28home slome and usually named according
- 1:28:30to the user such as slome SL student by
- 1:28:34default files the user saves will be
- 1:28:36placed in a directory Stree starting
- 1:28:39there account creation whether during
- 1:28:41system installation or at a later time
- 1:28:44when a new user is added also induces
- 1:28:46default directories to be created under
- 1:28:48the user's home directory such as
- 1:28:52documents desktop and and
- 1:28:59downloads the file manager allows you to
- 1:29:01view files and directories in more than
- 1:29:03one way you can switch between the icons
- 1:29:06and list formats either by clicking The
- 1:29:09Familiar icons in the top bar or you can
- 1:29:11press control1 or control2 respectively
- 1:29:14in addition you can also arrange the
- 1:29:16files and directories by name size type
- 1:29:19or modification date for future sorting
- 1:29:23to do so click View and select arrange
- 1:29:26items another useful option is to show
- 1:29:29hidden files sometimes I'm precisely
- 1:29:31called system files which are usually
- 1:29:34configuration files that are hidden by
- 1:29:36default and whose name starts with a DOT
- 1:29:39to show hidden files select show hidden
- 1:29:42files from the menu or press controll h
- 1:29:45the file browser provides multiple ways
- 1:29:47to customize your window view to
- 1:29:50facilitate easy drag and drop file
- 1:29:53operations you can also alter the size
- 1:29:55of the icons by selecting zoom in and
- 1:29:58zoom out under the view menu the file
- 1:30:02manager includes a great Search tool
- 1:30:04inside the file browser
- 1:30:06window one click search in the toolbar
- 1:30:09to bring up a text box then enter the
- 1:30:12keyword in this text box this causes the
- 1:30:14system to perform a recursive search
- 1:30:16from the current directory for any file
- 1:30:19or directory which contains a part of
- 1:30:21this keyword you can refine your search
- 1:30:24beyond the initial keyword by providing
- 1:30:27drop-down menus to further filter the
- 1:30:33search deleting a file in Nautilus will
- 1:30:35automatically move the deleted file to
- 1:30:38the lo/ share tr/ files directory uh
- 1:30:42basically a trash can under the user's
- 1:30:44home directory there are several ways to
- 1:30:46delete files and directories under
- 1:30:48Nautilus one you can select all you
- 1:30:51select all the files and directories
- 1:30:52that you want to delete then press
- 1:30:54control delete on your keyboard or right
- 1:30:57click the file then select move to
- 1:31:00trash note that you may have a delete
- 1:31:04permanently option which bypasses the
- 1:31:06trash folder and this option may be
- 1:31:09visible all the time or only in list
- 1:31:12rather than icon mode to permanently
- 1:31:15delete a file on the left panel inside a
- 1:31:18nautilus file browser window rightclick
- 1:31:21on the trash the the on the trash
- 1:31:23directory
- 1:31:24select empty trash and that's all
- 1:31:28alternatively select the file or
- 1:31:30directory you want to permanently delete
- 1:31:33and press shift delete let's see how to
- 1:31:36locate the Firefox application in locate
- 1:31:40Firefox click activities on the top left
- 1:31:43corner of your desktop on the left panel
- 1:31:46click the show applications icon click
- 1:31:49the Firefox
- 1:31:52icon close Firefox by clicking close in
- 1:31:55the top right corner of the Firefox
- 1:31:58window next let's explore the home
- 1:32:01directory using the file manager try to
- 1:32:03View files in list mode create a new
- 1:32:06empty document save it and remove it
- 1:32:10click activities in the upper left
- 1:32:11corner of your
- 1:32:13desktop in the left panel click the file
- 1:32:16manager icon this will by default open
- 1:32:19the home directory to View files in list
- 1:32:22mode click the list icon in the upper
- 1:32:24right of the file manager window
- 1:32:27doubleclick the document directory to
- 1:32:29open it click activities in the top left
- 1:32:32corner of your desktop to launch
- 1:32:36gedit type gedit in the search box click
- 1:32:40the gedit icon to open
- 1:32:43it type your name and click close in the
- 1:32:46top right corner of the gedit window to
- 1:32:49create and close a file click save as to
- 1:32:52save the created file
- 1:32:54select documents from the left panel of
- 1:32:57the save as
- 1:32:58window type test to save the file by
- 1:33:01that
- 1:33:02name click save to save the file and
- 1:33:05close gedit this brings you back to the
- 1:33:07document directory rightclick the test
- 1:33:10file in the document window select move
- 1:33:13to trash to remove the
- 1:33:19file you have completed chapter 4 let's
- 1:33:22summarize the key Concepts covered gome
- 1:33:25is a popular desktop environment and
- 1:33:28graphical user interface that runs on
- 1:33:30top of the Linux operating system the
- 1:33:33default display manager for Gnome is
- 1:33:35called gdm the gdm display manager
- 1:33:39presents the user with the login screen
- 1:33:41which prompt for the user the login
- 1:33:43username and password loging out through
- 1:33:45the desktop environment kills all
- 1:33:48processes in your current X session and
- 1:33:51returns to the display manager login
- 1:33:53screen Linux enables users to switch
- 1:33:56between logged in sessions suspending
- 1:33:59puts the computer into sleep mode for
- 1:34:01each key task there is generally a
- 1:34:03default application
- 1:34:05installed every user created in the
- 1:34:08system will have a home
- 1:34:10directory the places menu contains
- 1:34:13entries that allow you to access
- 1:34:15different parts of the computer and the
- 1:34:18network Nautilus gives three formats to
- 1:34:21View files each each Linux distribution
- 1:34:25comes with its own set of desktop
- 1:34:27backgrounds gnome comes with a set of
- 1:34:30different themes which can change the
- 1:34:32way your applications
- 1:34:37look by the end of this chapter you
- 1:34:39should be able to apply system display
- 1:34:42and date and time settings using the
- 1:34:44system settings panel track the network
- 1:34:47settings and manage connections using
- 1:34:49the network manager in Linux install an
- 1:34:53update soft Ware Linux from a graphical
- 1:34:56interface note that we'll revisit all
- 1:34:58these tasks later when we discuss how to
- 1:35:00accomplish them from the command
- 1:35:06line the system settings panel allows
- 1:35:09you to control most of the basic
- 1:35:11configuration options and desktop
- 1:35:13settings such as specifying the screen
- 1:35:15resolution managing network connections
- 1:35:17or changing the date and time of the
- 1:35:20system for The Gnome desktop manager one
- 1:35:23clicks on the upper right hand corner
- 1:35:25and then selects the tools image the
- 1:35:27screwdriver crossed with a rinse or a
- 1:35:29gear uh depending on your distribution
- 1:35:32you may find other ways to get into the
- 1:35:33settings configurations as well you'll
- 1:35:36also find variations in the menu layout
- 1:35:38between Linux distributions and versions
- 1:35:40so you may have to hunt for the settings
- 1:35:41you need or to examine or
- 1:35:48modify to get deeper into configuration
- 1:35:51one can click on the devices on the
- 1:35:54previous menu in order to configure
- 1:35:56items like the display the keyboard the
- 1:35:59printers Etc one can also click on the
- 1:36:02users icon which may be under details to
- 1:36:05set values for system users such as
- 1:36:08their login picture password
- 1:36:14Etc a lot of personalized configuration
- 1:36:17settings do not appear on the settings
- 1:36:18menu instead you have to launch a tool
- 1:36:21called either gnome tweaks or gnome
- 1:36:24tweak tool we have not really discussed
- 1:36:27working at the command line yet but you
- 1:36:29can always launch a program such as this
- 1:36:31by doing alt F2 and typing in the
- 1:36:34command some distributions have a link
- 1:36:36to the tweaks menu in the settings but
- 1:36:39for some mysterious reason many obscure
- 1:36:41this Tool's existence and it becomes
- 1:36:43hard to discover how to modify even
- 1:36:46rather basic desk type attributes and
- 1:36:49behaviors important things you can do
- 1:36:51with this tool include selecting a theme
- 1:36:53configuring extensions which you can get
- 1:36:56from your distribution or download from
- 1:36:59the internet you can control fonts mod
- 1:37:01modify the keyboard layout and set which
- 1:37:04program start when you log in the most
- 1:37:06recent gnome versions have removed a lot
- 1:37:08of the functionality of gnome tweaks
- 1:37:12extensions now have to be configured
- 1:37:13using a new a new app called gnome
- 1:37:15extensions app the reasoning for this is
- 1:37:18obscure here you can see a screenshot
- 1:37:20from a red hat system with quite a few
- 1:37:23extensions installed but not all being
- 1:37:29used clicking on settings displays or
- 1:37:32settings devices displays will expose
- 1:37:35the most common settings for changing
- 1:37:37the desktop appearance these settings
- 1:37:40function independently of the specific
- 1:37:42display drivers you're running the exact
- 1:37:45appearance will depend enormously on how
- 1:37:48many monitors you have and other factors
- 1:37:50such as Linux distribution and
- 1:37:52particular vers
- 1:37:55if your system uses a proprietary video
- 1:37:58card driver usually from Nvidia or AMD
- 1:38:01you'll probably have a separate
- 1:38:03configuration program for that driver
- 1:38:06this program may give more configuration
- 1:38:08options but may also be more complicated
- 1:38:11and might require admin root access if
- 1:38:14possible you should configure the
- 1:38:16settings in the displays panel rather
- 1:38:18than with the proprietary program the X
- 1:38:22server which actually provid Ides the
- 1:38:24the guey uses SLC x1x org.com as its
- 1:38:29configuration file if it exists in
- 1:38:31modern Linux distributions this file is
- 1:38:34usually present only in unusual
- 1:38:36circumstances such as when certain less
- 1:38:39common graphic drivers are in use
- 1:38:41changing this configuration file
- 1:38:43directly is usually for more advanced
- 1:38:50users while your system will usually
- 1:38:52figure out the the best resolution for
- 1:38:54your screen automatically it may get
- 1:38:56this wrong in some cases or you might
- 1:38:58want to change the resolution to meet
- 1:39:01your needs you can accomplish this using
- 1:39:04the displays panel the switch the switch
- 1:39:07to the new resolution will be effective
- 1:39:09when you click apply and then confirm
- 1:39:11that the resolution is working in case
- 1:39:14the selected resolution fails to work or
- 1:39:16you're just not happy with the
- 1:39:18appearance the system will switch back
- 1:39:20to the original resolution after a short
- 1:39:22timeout once again the exact appearance
- 1:39:25of the configuration screen will vary a
- 1:39:27lot between distributions and versions
- 1:39:30but usually it's rather intuitive and
- 1:39:32easy Once you find the configuration
- 1:39:35menus in most cases the configuration
- 1:39:37for multiple displays is set up
- 1:39:39automatically as one big screen spanning
- 1:39:42all monitors using a reasonable guess
- 1:39:44for screen layout if the screen layout
- 1:39:47is not as desired a checkbox can turn on
- 1:39:49mirrored mode where the same display is
- 1:39:51seen on all monitors clicking on a
- 1:39:53particular monitor image lets you
- 1:39:55configure the resolution of each one and
- 1:39:59whether they make one big screen or
- 1:40:01mirror the same video configuring
- 1:40:04display settings such as resolution is
- 1:40:06almost identical on all major
- 1:40:08distributions so we'll demonstrate that
- 1:40:12running virtual machines under VMware on
- 1:40:15a red hat 8 host so let's begin with
- 1:40:19showing what it looks like on
- 1:40:21auntu so I go up in the upper right hand
- 1:40:24corner and I find the settings
- 1:40:27button and then uh in the main uh panel
- 1:40:31here we have displays so we've already
- 1:40:34clicked on that and you see uh the
- 1:40:37easiest thing to do here is I can change
- 1:40:40the resolution to be any one of these
- 1:40:42numbers now you can continuously vary
- 1:40:46the display size usually on a virtual
- 1:40:49machine um and by dragging and dropping
- 1:40:52the corners you see now it's changed to
- 1:40:54another number but that's all that's
- 1:40:56involved in Ubuntu for instance if I
- 1:40:59want to go to open well let's try
- 1:41:03Centos Centos uh H stream actually I
- 1:41:08find the settings once again and then
- 1:41:11here you have to scroll down to
- 1:41:13devices and then displays is in there
- 1:41:16and we have the identical setup except
- 1:41:18for this NightLight uh option which is
- 1:41:21for looking in a darker situation a
- 1:41:24which we also had in the auntu was just
- 1:41:26located in a different place on open
- 1:41:30Su you'll see it's virtually identical
- 1:41:33as well I just click on the uh settings
- 1:41:36gear button here and uh once again I
- 1:41:40have to go to devices like I did on the
- 1:41:43red hat system and I have the identical
- 1:41:45situation you couldn't tell what
- 1:41:48operating system you were on if you just
- 1:41:50looked at
- 1:41:51this now the these are all virtual
- 1:41:54machines with one terminal if I look on
- 1:41:56the host which actually has three
- 1:41:58different monitors hooked up to it
- 1:42:01you'll see then I get something like
- 1:42:03this where I can see all three of my
- 1:42:06monitors uh I can figure any one of them
- 1:42:09here it's doing the the smaller one the
- 1:42:1118inch one but I could switch to the 27
- 1:42:15or the
- 1:42:1624 and I can control uh their different
- 1:42:20resolutions if I move these around here
- 1:42:24I can change the way the three of them
- 1:42:26are laid out from left to right I don't
- 1:42:29particularly want to do that uh because
- 1:42:31it gets kind of messy but this is how
- 1:42:33you can control which one's in the
- 1:42:35middle which is on the right or left Etc
- 1:42:38so these days configuring the display
- 1:42:40resolution and some other basic things
- 1:42:43is really very simple very intuitive the
- 1:42:45hardest thing is just to find the the um
- 1:42:49settings icon to click on
- 1:42:56by default Linux always uses coordinated
- 1:42:58universal time for its own internal
- 1:43:01timee keeping displayed or stored time
- 1:43:03values rely on the system time zone
- 1:43:06setting to get the proper time UTC is
- 1:43:08similar to but more accurate than green
- 1:43:11witch
- 1:43:12meantime if you click on the time
- 1:43:14displayed on the top panel you can
- 1:43:16adjust the format with which the date
- 1:43:18and time is shown on some distributions
- 1:43:20you can also alter the values the more
- 1:43:24detailed date and time settings can be
- 1:43:26selected from the date and time window
- 1:43:28in the system settings menu the
- 1:43:31automatic settings are referring to the
- 1:43:34use of network time protocol which we'll
- 1:43:37discuss
- 1:43:42next the network time protocol is the
- 1:43:45most popular and reliable protocol for
- 1:43:47setting the local time by Consulting
- 1:43:50established internet servers l
- 1:43:53distributions always come with a working
- 1:43:55ntp setup which refers to a specific
- 1:43:58time servers run or relied on by the
- 1:44:01distribution this means that no setup
- 1:44:03Beyond on or off is generally required
- 1:44:05for Network time
- 1:44:11synchronization all Linux distributions
- 1:44:13have network configuration files but
- 1:44:15file formats and locations can differ
- 1:44:17from one distribution to another hand
- 1:44:19editing of these files can handle quite
- 1:44:22complicated set
- 1:44:23but it's not very dynamic or easy to
- 1:44:26learn and use network manager was
- 1:44:28developed to make things easier and more
- 1:44:31uniform across distributions it can list
- 1:44:34all available networks both wired and
- 1:44:36wireless allow the choice of a wired
- 1:44:39Wireless or mobile broadband Network
- 1:44:41handle passwords and set up virtual
- 1:44:43private networks except for unusual
- 1:44:46situations it's generally best to let
- 1:44:49network manager establish your
- 1:44:51connections and keep track of your
- 1:44:53settings in this section you'll learn
- 1:44:55how to manage network connections
- 1:44:57including wired and wireless connections
- 1:45:00and mobile broadband and VPN
- 1:45:07connections wired connections usually do
- 1:45:09not require complicated or manual
- 1:45:11configuration the hardware interface and
- 1:45:14Signal presence are automatically
- 1:45:16detected and then network manager sets
- 1:45:18the actual network settings via Dynamic
- 1:45:21host configuration protocol or
- 1:45:24DHCP for static configurations that do
- 1:45:28not use DHCP manual setup can also be
- 1:45:31done easily through network manager you
- 1:45:34can also change the Ethernet Mac address
- 1:45:37or media Access Control address if your
- 1:45:40Hardware supports it the MAC address is
- 1:45:42a unique hexadecimal number of your
- 1:45:45network card wireless networks are
- 1:45:47usually not connected by default you can
- 1:45:49view the list of available wireless
- 1:45:51networks and see which one if any you're
- 1:45:55currently connected to by using network
- 1:45:57manager you can then add edit or remove
- 1:46:00known wireless networks and also specify
- 1:46:03which one which ones you want connected
- 1:46:05by default when
- 1:46:11present to configure a wireless network
- 1:46:14in any recent gnome based
- 1:46:16distribution click on the upper right
- 1:46:19corner of the top panel which brings up
- 1:46:21a settings and or Network window while
- 1:46:24the exactic appearance will depend on
- 1:46:26Linux distribution inv verion it will
- 1:46:28always be possible to click on a Wi-Fi
- 1:46:31submenu as long as the hardware is
- 1:46:34present here is an example from a real 8
- 1:46:37System select the wireless network you
- 1:46:40wish to connect to if it's a secure
- 1:46:42network the first time it will request
- 1:46:44that you enter the appropriate password
- 1:46:47by default the password will be saved
- 1:46:49for subsequent connections if you click
- 1:46:53on Wi-Fi settings you will bring up this
- 1:46:56if you click on the gear icon for any
- 1:47:00connection you can configure it in more
- 1:47:02detail older and other Linux
- 1:47:05distributions may look quite a bit
- 1:47:06different in detail but the steps and
- 1:47:08choices are essentially identical as
- 1:47:11they're all running network manager with
- 1:47:13perhaps somewhat different
- 1:47:15clothing let's
- 1:47:17demonstrate how to control wired and
- 1:47:20wireless network connections on a red
- 1:47:22head
- 1:47:24system if I click on the upper right
- 1:47:26hand corner for instance if I want to
- 1:47:28look at the wired connection I can just
- 1:47:30scroll down to the wired connection and
- 1:47:32then wired settings and it asks me for
- 1:47:36my password the root the root password
- 1:47:39because it it
- 1:47:40wants to have a super user only control
- 1:47:44network
- 1:47:45connections and you'll see I have a
- 1:47:47th000 megabit connection if I click on
- 1:47:50the gear icon I can control the settings
- 1:47:53on the details first screen it says it
- 1:47:56connects automatically when the system
- 1:47:57starts and all users can use
- 1:48:00it on identity I give what the name of
- 1:48:03the interface looks like not the name of
- 1:48:05the
- 1:48:06system uh in older systems that would
- 1:48:09have been eth0 eth1 Etc but as we will
- 1:48:13discuss later newer systems have these
- 1:48:16more complex
- 1:48:18names under ipv4 we control the basic
- 1:48:21Internet Protocol system systems
- 1:48:24settings most of the time you'll leave
- 1:48:26it alone at automatic DHCP Dynamic host
- 1:48:30configuration protocol where the system
- 1:48:32figures out its address from the server
- 1:48:36Etc if you understand how the importance
- 1:48:40of manual settings you can specify an
- 1:48:42address a net mask a Gateway you can
- 1:48:45select a particular DNS server and you
- 1:48:48can specify roots to certain addresses
- 1:48:52if you understand understand those
- 1:48:53Concepts this is where you would go to
- 1:48:55control all that we're not changing
- 1:48:57anything so I'll just hit
- 1:48:59cancel now if I want to control Wi-Fi
- 1:49:01settings I could go back to that upper
- 1:49:03right corner or I can just click on the
- 1:49:06Wi-Fi setting here and once again it's
- 1:49:08asking me for the super user password
- 1:49:13these are the different wireless
- 1:49:15networks that have to be that are
- 1:49:17available at the moment they all have
- 1:49:18locks next to them means they require a
- 1:49:21password this is the one that I'm
- 1:49:23actually on Coupe J the first one and if
- 1:49:26I click on the settings there once again
- 1:49:28it's going to ask me for
- 1:49:32um my P my super user password and I see
- 1:49:36essentially the exact same settings I
- 1:49:38had on the wir connection the automatic
- 1:49:42startup as other people use it the
- 1:49:45identity and whether I want to use DHCP
- 1:49:48or set things manually or
- 1:49:50not so that's all there really is in the
- 1:49:53graphical interface to control basic
- 1:49:55network connections it's rather simple
- 1:49:58and it looks the same at all recent
- 1:50:00Linux
- 1:50:07distributions you can set up mobile
- 1:50:09broadband connection with network
- 1:50:10manager which will launch a wizard to
- 1:50:13set up the connection details for each
- 1:50:16connection once the configuration is
- 1:50:18done the network is configured
- 1:50:20automatically each time the broadband
- 1:50:22network is attached network manager can
- 1:50:25also manage manage your VPN connections
- 1:50:29it supports many VPN Technologies such
- 1:50:32as native IPC Cisco open connect via
- 1:50:35either the Cisco client or a native open
- 1:50:37source client Microsoft pptp and
- 1:50:40openvpn you might get support for VPN as
- 1:50:43a separate package from your distributor
- 1:50:47you need to install this package if your
- 1:50:49preferred VPN is not supported
- 1:50:56each package in Linux distribution
- 1:50:59provides one piece of the system such as
- 1:51:01the Linux kernel the C compiler
- 1:51:04utilities for manipulating text or
- 1:51:06configuring the network or for your
- 1:51:08favorite web browsers and email clients
- 1:51:12packages often depend on each other for
- 1:51:14example because your email client
- 1:51:16communicates using ssltls it will depend
- 1:51:19on a package which provides the ability
- 1:51:21to encrypt and decrypt SSL and TLS
- 1:51:25communication and will not install
- 1:51:26unless that package is also installed at
- 1:51:28the same time all systems have a lower
- 1:51:32level utility which handles the details
- 1:51:34of unpacking a package and putting the
- 1:51:36pieces in the right places most of the
- 1:51:39time you will be working with a higher
- 1:51:41level utility which knows how to
- 1:51:43download packages from the internet and
- 1:51:45can manage dependencies and groups for
- 1:51:48you in this section you will learn how
- 1:51:50to install and update software in Linux
- 1:51:53using the dbn packaging system used by
- 1:51:56systems such as Ubuntu as well and RPM
- 1:51:59Packaging Systems which is used by both
- 1:52:02red hat and the Susi family systems
- 1:52:05there are these are the main ones in use
- 1:52:07although there are other ones which work
- 1:52:09well for other distributions which are
- 1:52:11less
- 1:52:15used let's look at the package
- 1:52:18management for the Debian family
- 1:52:21system dpkg is the underlying package
- 1:52:25manager for these systems it can install
- 1:52:28remove and build packages unlike higher
- 1:52:31level packages Management Systems it
- 1:52:34does not automatically download and
- 1:52:35install packages and satisfy their
- 1:52:38dependencies for deviant based systems
- 1:52:41the higher level package management
- 1:52:43system is the advanced package tool or a
- 1:52:49system of utilities generally while each
- 1:52:51distribution with within the devian
- 1:52:53family uses AP it creates its own user
- 1:52:56interface on top of it for example AP
- 1:52:59kit or app kit sympatic uh yuntu
- 1:53:01software Center Etc although apt
- 1:53:04repositories are generally compatible
- 1:53:06with each other the software they
- 1:53:07contain generally is not therefore most
- 1:53:10repositories Target a particular
- 1:53:12distribution like yuntu and often
- 1:53:14software Distributors ship with multiple
- 1:53:17repositories to support multiple
- 1:53:19distributions demonstrations are shown
- 1:53:21later in this section
- 1:53:27Red Hat package manager or RPM is the
- 1:53:30other package management system popular
- 1:53:32on Linux distributions it was developed
- 1:53:34by red hat and adopted by a number of
- 1:53:37other distributions including Susi and
- 1:53:39open Susi uh C OS Oracle Linux and
- 1:53:42others the highlevel package manager
- 1:53:45differs between distributions Red Hat
- 1:53:48Family distributions historically use re
- 1:53:50or SOS and fedora uses dnf while
- 1:53:54retaining good backward compatibility
- 1:53:56with the older yum program Susi family
- 1:53:59distribution such as open Susi also use
- 1:54:01RPM but use the zipper
- 1:54:08interface the yet another setup tool or
- 1:54:11yast software manager is similar to
- 1:54:14other graphical package managers it's an
- 1:54:17RPM based application you can add remove
- 1:54:20or update packages using this
- 1:54:22application very easily to access the
- 1:54:24yes software manager first click
- 1:54:28activities then in the search box type
- 1:54:31yes and click on the yes icon then click
- 1:54:36software management you can also find
- 1:54:38yes by clicking on applications other
- 1:54:41yes which is a strange place to put it
- 1:54:44uh but open su's yes software management
- 1:54:46application is similar to The graphical
- 1:54:49package managers and other distributions
- 1:54:52uh demonstration of the Yas software
- 1:54:54manager is seen later in this
- 1:55:00section we are now going to demonstrate
- 1:55:02software package management from a
- 1:55:04graphical interface using the open Su
- 1:55:08Linux
- 1:55:09distribution the tool we want to use for
- 1:55:12doing this is yast yst and there's two
- 1:55:16different ways I can reach it if I have
- 1:55:18the gnome shell extension installed
- 1:55:21which shows the application s menu which
- 1:55:23doesn't come by default I can go down to
- 1:55:26systems tools and then go down to yes or
- 1:55:30I can always go up to the upper right
- 1:55:33hand corner click on the tool
- 1:55:36icon and then at the bottom here on the
- 1:55:38system click on yes it will want the
- 1:55:41root password CU I'm going to manipulate
- 1:55:44what's installed on the system and so if
- 1:55:47I go to software I can go to software
- 1:55:50management
- 1:55:54now the first thing that yes has to do
- 1:55:57is study the system and get a database
- 1:55:59of every possible
- 1:56:02package so it you can look at the
- 1:56:04packages on the system in different ways
- 1:56:07you can look by what's called RPM groups
- 1:56:11so here's all the games are grouped
- 1:56:14under
- 1:56:14amusements I have applications
- 1:56:17development and all different kinds of
- 1:56:19development
- 1:56:21subcategories tools documentation Etc or
- 1:56:25RPM groups that is rpm groups
- 1:56:30okay yeah pack or I can look at package
- 1:56:33groups which maybe is a little more
- 1:56:34intuitive so I could click on let's say
- 1:56:37multimedia and see all the different
- 1:56:39programs are involved in uh in dealing
- 1:56:41with
- 1:56:42multimedia suppose I want to install
- 1:56:46something or inquire as to where
- 1:56:47something is installed I can click on
- 1:56:50search and type something in here I'll
- 1:56:53type G
- 1:56:56plot and I bring up quickly all the
- 1:56:59different G plot uh pro programs there
- 1:57:03are the main one you see has a check
- 1:57:06mark in the box that means it's already
- 1:57:09installed
- 1:57:11um I will decide to install gup plot do
- 1:57:15doc which is a small documentation
- 1:57:18package and then in order to do the
- 1:57:20install I will click on
- 1:57:23accept and I we go ahead and do it it's
- 1:57:26a pretty small package it doesn't take
- 1:57:28long if you needed some other packages a
- 1:57:30function it would have installed them at
- 1:57:32the same time so now I'll say
- 1:57:36continue and if I can want to remove it
- 1:57:39because I don't really need it I'll type
- 1:57:41it that in the search
- 1:57:44again and then I click on
- 1:57:47here
- 1:57:49um until I get an X for removal
- 1:57:53and then I say
- 1:57:55accept and it's removing it so that's
- 1:57:59all I had to do to do some basic package
- 1:58:02installation and removal under gnome
- 1:58:04software with open Su pretty
- 1:58:14simple experienced Linux administrators
- 1:58:17probably do most of their package
- 1:58:20management from the command line rather
- 1:58:22than from a graphical
- 1:58:24interface however every Linux
- 1:58:26distribution has at least one graphical
- 1:58:29interface for installing upgrading
- 1:58:32removing Etc various software packages
- 1:58:36so let's take a look at a recent Ubuntu
- 1:58:39system uh I can go to Applications and
- 1:58:42then down to system tools and first
- 1:58:45let's look at the one at the bottom here
- 1:58:48which just says
- 1:58:49software this is actually a program
- 1:58:52progr called gnome
- 1:58:54software uh you can always install it if
- 1:58:56it hasn't been installed on your system
- 1:58:58it looks somewhat like an app store or
- 1:59:01Play Store from Android and uh it's
- 1:59:05pretty obvious you can click in any one
- 1:59:07of these to try to install Etc and at
- 1:59:10the bottom you'll see things are grouped
- 1:59:13by category so for instance oh I could
- 1:59:16click on
- 1:59:18utilities and then I'll see a bunch of
- 1:59:20different utilities uh that may or may
- 1:59:22not be installed on your system already
- 1:59:27okay or I could search for various
- 1:59:29things so let me go back to the main
- 1:59:32page and
- 1:59:34um if I click on The Hourglass up in the
- 1:59:37corner here I can search so let's say I
- 1:59:40search on
- 1:59:44Terminal and you'll see it'll come up
- 1:59:46with a number of different things I
- 1:59:47could install you'll see here this
- 1:59:50terminal here is the a gome terminal and
- 1:59:53it says installed in a rather small font
- 1:59:56here uh and if I wanted to install
- 2:00:00something else I could just say for
- 2:00:01instance here I could click on that and
- 2:00:04I would say install and it could just be
- 2:00:07installed or if I want something a
- 2:00:09little more fun let's say I'll look for
- 2:00:12a program called
- 2:00:14cheese which let's you use your um
- 2:00:19webcam to take pictures
- 2:00:22or or make videos Etc and I can say
- 2:00:26remove cuz it turns out it's already
- 2:00:28installed so let me remove
- 2:00:31it and it's going to want a password to
- 2:00:33do this which shouldn't be that priz
- 2:00:38surprising so I type my password and
- 2:00:41it's removing
- 2:00:42it and then uh you know if I want to
- 2:00:46reinstall it which I'll do I'll just say
- 2:00:48install and give the password again
- 2:00:53so this is not a very complex program to
- 2:00:56use uh it's pretty easy to use gome
- 2:00:59software and you notice at the top you
- 2:01:02have a list here of explore which is
- 2:01:05where you are now installed would be all
- 2:01:07your installed packages and if you do
- 2:01:10updates it's telling me the system has
- 2:01:12two sets of updates that I really should
- 2:01:14install but the save time I'll do that
- 2:01:17right
- 2:01:18now so that's one graphical interface
- 2:01:21there's a much older graphical interface
- 2:01:24that's available intu called synaptic so
- 2:01:27let's do that
- 2:01:30one
- 2:01:32uh I thought it was it's under system
- 2:01:36tools there we go synaptic package
- 2:01:43manager and once again this is going to
- 2:01:46ask for a
- 2:01:49password and uh it's an informatory
- 2:01:53message and this is actually a very
- 2:01:55simple easy to use and uh it gives you a
- 2:01:59clear uh vision of exactly where
- 2:02:01everything came from compared to the
- 2:02:04more modern graphical interfaces it's
- 2:02:07pretty straight forward to use um it's
- 2:02:10organized by either sections here I can
- 2:02:13do it in other ways I can do searching
- 2:02:17uh uh Etc so suppose I want to search
- 2:02:20well I'll do the same search your
- 2:02:25terminal and it's going to show me all
- 2:02:27the packages that either have terminal
- 2:02:29in the name or discuss terminal if I
- 2:02:31want to restrict it to ones that have
- 2:02:34only uh in the name I can do
- 2:02:38that and it's pretty straightforward to
- 2:02:41use I won't run through this these are
- 2:02:43already installed because they're in
- 2:02:45green uh I can install any of these
- 2:02:48other ones and I can just click on that
- 2:02:51and then up let's say I want to do QT
- 2:02:54terminal I would say Mark for
- 2:02:57installation and it says in order to
- 2:02:59this to work it has to install these
- 2:03:01other packages too which it depends on
- 2:03:04so we won't bother to do that and that's
- 2:03:07briefly what you can do on a auntu
- 2:03:09system with a graphical software package
- 2:03:13installations and
- 2:03:19removals you have completed Che chapter
- 2:03:225 so let's summarize the key Concepts
- 2:03:25covered you can control basic
- 2:03:28configuration options and desktop
- 2:03:30settings through the system settings
- 2:03:33panel Linux always uses coordinated
- 2:03:36universal time or UTC for its own
- 2:03:38internal timekeeping you can set the
- 2:03:41date and time settings from the system
- 2:03:43settings window the network time
- 2:03:46protocol is the most popular and
- 2:03:47reliable protocol for setting the local
- 2:03:50time via internet server
- 2:03:52the displays panel allows you to change
- 2:03:54the resolution of your display and
- 2:03:57configure multiple
- 2:03:59screens the network manager can present
- 2:04:01available wireless networks it allows
- 2:04:04the choice of a wireless or mobile BRB
- 2:04:06Brad Network handles passwords and sets
- 2:04:10up vpns the dpkg and RPM are the most
- 2:04:14popular package Management Systems used
- 2:04:16on Linux distributions deviant
- 2:04:19distributions use dpkg and AP based
- 2:04:22utilities for package management RPM was
- 2:04:25developed by red hat and adopted by a
- 2:04:28number of other distributions including
- 2:04:31open Susi SOS oracal Linux and
- 2:04:36others by the end of this chapter you
- 2:04:39should be familiar with common Linux
- 2:04:42applications including internet
- 2:04:44applications such as browsers and email
- 2:04:47programs office productivity Suites such
- 2:04:51as Le RA office developer tools such as
- 2:04:54compilers debug debuggers Etc multimedia
- 2:04:58applications such as those for audio and
- 2:05:01video graphic editors such as the
- 2:05:04and other Graphics
- 2:05:09utilities the internet is a Global
- 2:05:11Network that allows users around the
- 2:05:12world to perform multiple tasks such as
- 2:05:15searching for data communicating through
- 2:05:17emails and online shopping obviously you
- 2:05:20need to use Network aware applications
- 2:05:22to take advantage of the internet these
- 2:05:25include web browsers email clients
- 2:05:28streaming media applications Internet
- 2:05:31relay chats and conferencing
- 2:05:36software as discussed in the graphical
- 2:05:39interface chapter Linux offers a wide
- 2:05:41variety of web browsers both graphical
- 2:05:44and text space including Firefox Google
- 2:05:48Chrome chromium epiphany renamed web
- 2:05:53conquer links links w3m and
- 2:06:00Opera email applications allow for
- 2:06:03sending receiving and reading messages
- 2:06:05over the Internet Linux systems offer a
- 2:06:08wide number of email clients both
- 2:06:10graphical and text based in addition
- 2:06:13many users simply use their browsers to
- 2:06:15access their email accounts most email
- 2:06:18clients use the internet message access
- 2:06:21protocol or IMAP or the older pop post
- 2:06:24office protocol to access emails stored
- 2:06:26on a remote mail server most email
- 2:06:29applications always also display HTML
- 2:06:31formatted emails that include objects
- 2:06:34like pictures and hyperlinks Linux
- 2:06:36support the following types of email
- 2:06:39applications graphical email clients
- 2:06:41such as Thunderbird Evolution and Claus
- 2:06:45mail text mode email clients such as mut
- 2:06:48and mail all web browser based client
- 2:06:51cents such as Gmail yah and Office
- 2:06:58365 Linux systems provide many other
- 2:07:01applications for performing internet
- 2:07:03related tasks these include filezilla
- 2:07:06pigeon AA and
- 2:07:11hexchat most day-to-day computer systems
- 2:07:14have productivity applications sometimes
- 2:07:17called office suites available or
- 2:07:19installed each Suite is a a collection
- 2:07:22of closely coupled programs used to
- 2:07:24create and edit different types of files
- 2:07:26such as text spreadsheets presentations
- 2:07:31graphical
- 2:07:32objects most Linux distributions offer
- 2:07:35Libra office an open- source office
- 2:07:37suite that started in 2010 and is
- 2:07:40evolved from open Office while other
- 2:07:42office suites are available as as we
- 2:07:45have listed Libra office is the most
- 2:07:47mature and it's most it's also the most
- 2:07:49widely used and intensely developed
- 2:07:52in addition Linux users have full access
- 2:07:54to internet-based office suites such as
- 2:07:56Google Docs and Microsoft Office
- 2:08:01365 the component applications included
- 2:08:04in Libra office are writer for word
- 2:08:08processing calc for spreadsheets impress
- 2:08:11for presentations draw for creating and
- 2:08:14editing graphics and diagrams the Libra
- 2:08:16office applications can read and write
- 2:08:19non-native document formats such as
- 2:08:22those used by Microsoft Office usually
- 2:08:24Fidelity is maintained quite well but
- 2:08:26complicated documents might have some
- 2:08:28imperfect
- 2:08:33conversions Linux distributions come
- 2:08:35with a complete set of applications and
- 2:08:38tools that are needed by those
- 2:08:40developing or maintaining both user
- 2:08:42applications and the kernel itself these
- 2:08:46tools are tightly integrated and include
- 2:08:49Advanced editors customized for
- 2:08:51programmers needs such as V and emac
- 2:08:54compilers for every computer language
- 2:08:56that has ever existed including very
- 2:08:58popular new ones such as go L and rust
- 2:09:01debuggers such as GDB and various
- 2:09:04graphical front ends to it and other and
- 2:09:06many other debugging tools performance
- 2:09:09measuring and monitoring programs some
- 2:09:11with easy to ous graphical interfaces
- 2:09:14others more Arcane and meant to be used
- 2:09:16only by serious experienced development
- 2:09:19Engineers complete integrated develop
- 2:09:21environments or idees such as eclipse
- 2:09:25and visual studio code that put all
- 2:09:27these tools together on other operating
- 2:09:30systems these tools have to be obtained
- 2:09:32and installed separately often at a high
- 2:09:34cost while in Linux they are all
- 2:09:37available at no cost through standard
- 2:09:39package installation
- 2:09:43systems multimedia applications are used
- 2:09:46to listen to music watch videos Etc as
- 2:09:49well as to present and view text and
- 2:09:51Graphics Linux systems offer a number of
- 2:09:55sound player applications including amck
- 2:09:58audacity and Rhythm box of course Linux
- 2:10:01systems can also connect with commercial
- 2:10:03online music streaming services such as
- 2:10:06Pandora and Spotify through web
- 2:10:12browsers movie and video players can
- 2:10:14portray input from many different
- 2:10:16sources either local to the machine or
- 2:10:18on the Internet Linux systems offer a
- 2:10:21number of movie players including VLC
- 2:10:24imp player Zen
- 2:10:30Totem Movie editors are used to edit
- 2:10:33videos or movies link systems offer a
- 2:10:36number of movie editors including cin
- 2:10:39paint blender CA and
- 2:10:45ffmpeg graphic editors allow you to
- 2:10:48create edit View and organize images of
- 2:10:51various formats the new image
- 2:10:53manipulation program or is a
- 2:10:56feature image retouching and editing
- 2:10:58tool similar to Adobe Photoshop and it's
- 2:11:00available on all Linux distributions
- 2:11:03some features of of are it can
- 2:11:06handle any image format it has many
- 2:11:08special purpose plugins and filters it
- 2:11:11provides extensive information about the
- 2:11:13image such as layers channels and
- 2:11:16histograms in addition to there are
- 2:11:19other Graphics utilities that help
- 2:11:21perform various imag related tasks
- 2:11:25including EOG inkscape convert and
- 2:11:32scribus you have completed chapter six
- 2:11:35let's summarize the key Concepts covered
- 2:11:38Linux offers a wide variety of Internet
- 2:11:41applications such as web browsers email
- 2:11:43clients online media applications and
- 2:11:46others web browsers supported by Linux
- 2:11:49can be either graphic iCal or text based
- 2:11:53such as Firefox Google Chrome Epiphany
- 2:11:55w3m links and other others Linux
- 2:11:58supports graphical email clients such as
- 2:12:02Thunderbird Evolution and Claus mail and
- 2:12:05text mode email clients such as mut and
- 2:12:08mail Linux systems provide many other
- 2:12:10applications for performing internet
- 2:12:12related tasks such as filezilla xchat
- 2:12:16pidgen and others most link
- 2:12:18distributions offer Libra office to
- 2:12:20create an different kinds of documents
- 2:12:23Linux systems offer entire Suites of
- 2:12:26development applications and tools
- 2:12:28including compilers and debuggers Linux
- 2:12:31systems offer a number of sound players
- 2:12:33including amarok audacity and Rhythm box
- 2:12:37Linux systems offer a number of movie
- 2:12:39players including VC M player Zen and
- 2:12:42totem Linux systems offer a number of
- 2:12:44movie editors including Kino cin paint
- 2:12:47blender among
- 2:12:48others the utility is a featur rich
- 2:12:53imagery touching and editing tool
- 2:12:55available on all Linux
- 2:12:56distributions other Graphics utilities
- 2:12:59that help perform various image related
- 2:13:01tasks are EOG inkscape convert and
- 2:13:08scribus by the end of this chapter you
- 2:13:10should be able to use the command line
- 2:13:13to perform operations in Linux search
- 2:13:16for files create and manage files
- 2:13:20install and update
- 2:13:26software Linux system administrators
- 2:13:28spend a significant amount of their time
- 2:13:31at a command line prompt they often
- 2:13:33automate and troubleshoot tasks in this
- 2:13:35text environment there's a saying
- 2:13:38graphical user interfaces make easy
- 2:13:40tasks easier while command line
- 2:13:42interfaces make difficult tasks possible
- 2:13:46Linux relies heavily on the abundance of
- 2:13:48command line tools the command line
- 2:13:50interface provides the following
- 2:13:52advantages no gooey overhead is incurred
- 2:13:55virtually any and every task can be
- 2:13:57accomplished while sitting at the
- 2:13:58command line you can Implement scripts
- 2:14:01for often used or easy to forget tasks
- 2:14:05and series of procedures you can sign
- 2:14:08into remote machines anywhere on the
- 2:14:10internet you can initiate graphical
- 2:14:13applications directly from the command
- 2:14:15line instead of hunting through menus
- 2:14:18while graphical tools may vary among
- 2:14:20Linux distributions the command line
- 2:14:22interface does
- 2:14:28not a terminal emulator program emulates
- 2:14:31or simulates a standalone terminal
- 2:14:33within a window on the desktop by this
- 2:14:35we mean it behaves essentially as if you
- 2:14:37were logging into the machine at a pure
- 2:14:40text terminal terminal with no running
- 2:14:42graphical interface most terminal
- 2:14:45emulators programs support multiple
- 2:14:47terminal sessions by opening additional
- 2:14:49tabs or Windows by default on gnome
- 2:14:52desktop environments The Gnome terminal
- 2:14:55application is used to emulate a text
- 2:14:58mode terminal in window other available
- 2:15:01terminal programs include xterm console
- 2:15:05default on KDE and
- 2:15:12Terminator to open a terminal on any
- 2:15:15system using a recent gnome desktop
- 2:15:17click on applications system tools
- 2:15:20terminals or applications utilities
- 2:15:24terminal if you do not have the
- 2:15:26applications menu you will have to
- 2:15:28install the appropriate gnome shell
- 2:15:30extension package and turn it on with
- 2:15:33gnome
- 2:15:34tweaks on any but some of the most
- 2:15:37recent gnome based distributions you can
- 2:15:40always open a terminal by right clicking
- 2:15:42anywhere on the desktop background and
- 2:15:45selecting open in
- 2:15:47terminal if this does not work you will
- 2:15:50once again need to install and activate
- 2:15:52the appropriate gnome shell package you
- 2:15:55can also hit alt F2 and type in either
- 2:15:58gnome terminal or console whichever is
- 2:16:03appropriate because distributions have
- 2:16:05had a history of bearing opening up a
- 2:16:09command line terminal and the place and
- 2:16:11menus may vary in the desktop guey it is
- 2:16:14a good idea to figure out how to pin the
- 2:16:16terminal icon to the panel which might
- 2:16:19mean adding it to the favorite grouping
- 2:16:21on gnome
- 2:16:26systems there are some basic command
- 2:16:29line utilities that are used constantly
- 2:16:32and it would be impossible to proceed
- 2:16:34further without using some some of them
- 2:16:37in simple forms before we discuss them
- 2:16:39in more detail a short list has to
- 2:16:42include cat used to type out a file or
- 2:16:45combined files head used to show the
- 2:16:49first few lines of a file tail used to
- 2:16:52show the last few lines of a file man
- 2:16:56used to view
- 2:16:58documentation this screenshot shows
- 2:17:00Elementary uses of these programs note
- 2:17:03the use of the pipe symbol the vertical
- 2:17:05line you used to have one program take
- 2:17:08as input the output of another for the
- 2:17:11most part we will only only use these
- 2:17:13utilities and screenshots displaying
- 2:17:15various activities before we discuss
- 2:17:17them in detail
- 2:17:23most input lines entered at the Shell
- 2:17:25prompt have three basic
- 2:17:27elements the command the options and the
- 2:17:32arguments the command is the name of the
- 2:17:35program you are executing it may be
- 2:17:37followed by one or more options or
- 2:17:39switches that modify what the command
- 2:17:42may do options usually start with one or
- 2:17:45two dashes for example- p or-- print in
- 2:17:49order to differentiate them from
- 2:17:51arguments which represent what the
- 2:17:53command operates on however plenty of
- 2:17:56commands have no options no arguments or
- 2:17:59neither in addition other elements such
- 2:18:02as setting environment variables can
- 2:18:04also appear on the command line when
- 2:18:07launching a
- 2:18:12task all the demonstrations created have
- 2:18:15a user configured with pseudo
- 2:18:18capabilities to provide the user with
- 2:18:20administ rative privileges when required
- 2:18:23pseudo allows users to run programs
- 2:18:25using the security privileges of another
- 2:18:28user generally root the super user on
- 2:18:31your own systems you may need to set up
- 2:18:33an enable Pudo to work correctly to do
- 2:18:36this you need to follow some steps that
- 2:18:38will not explain much detail now but you
- 2:18:41will learn about later in this course
- 2:18:44when running on yuntu and some other
- 2:18:46recent distributions pseudo is already
- 2:18:49always set up for you during
- 2:18:52installation on other Linux
- 2:18:53distributions you will likely need to
- 2:18:55set up pseudo to work properly for you
- 2:18:58after the initial
- 2:19:00installation next you will learn the
- 2:19:02steps through setup and run pseudo on
- 2:19:05your
- 2:19:10system if your system does not already
- 2:19:13have pseudo set up in and enabled you
- 2:19:16need to do the following steps you'll
- 2:19:19need to make modific ations to the
- 2:19:21administrative or super user route while
- 2:19:25pseudo will become the preferred method
- 2:19:26of doing this we not have to have it set
- 2:19:29up yet so we you we will use Su which
- 2:19:32we'll discuss later in detail Instead at
- 2:19:35the command line prompt type Su and
- 2:19:37press enter you'll then be prompted for
- 2:19:39the root password so enter it and press
- 2:19:42enter you'll notice that nothing is
- 2:19:44printed this is so so others cannot see
- 2:19:47the password on the screen you should
- 2:19:49end up with a different look prompt
- 2:19:51often ending with a hashmark or a pound
- 2:19:55sign for example Su and then password uh
- 2:19:58now you need to create a configuration
- 2:20:00file to enable your user account to use
- 2:20:02Pudo typically this file is created in
- 2:20:04the
- 2:20:04/c/ Su doers. d/d directory with the
- 2:20:09name of the file as the same as your
- 2:20:11username for example for this demo let's
- 2:20:13say your username is student after doing
- 2:20:16step one you would then create the
- 2:20:18configuration file for student by doing
- 2:20:22this Echo student all equals all all and
- 2:20:27then the the directory here finally some
- 2:20:30Linux distributions will complain if you
- 2:20:33do not also change permissions on the
- 2:20:34file by doing uh chod 440 and then put
- 2:20:38the file name uh that should be it for
- 2:20:41the rest of this course if you use
- 2:20:42pseudo you should be properly set up
- 2:20:46when using pseudo by default you will be
- 2:20:48prompted to give a password you your own
- 2:20:51user password at least the the first
- 2:20:53time you do it within a specified time
- 2:20:56interval it's possible the varant secur
- 2:20:58to configure pseudo to not require
- 2:21:00password or change the time window in
- 2:21:02which the password does not have to be
- 2:21:04repeated with every pseudo
- 2:21:12command the customizable nature of Linux
- 2:21:15allows you to drop the graphical
- 2:21:17interface temporarily or permanently or
- 2:21:20to start up after the system has been
- 2:21:22running most Linux distributions give an
- 2:21:25option during installation or have more
- 2:21:28than one version of the install media to
- 2:21:30choose between desktop with a graphical
- 2:21:32desktop and server usually without one
- 2:21:36Linux production servers are usually
- 2:21:38installed without the guei and even if
- 2:21:40it is installed usually do not launch it
- 2:21:43during the system startup removing the
- 2:21:45graphical interface from a production
- 2:21:47server can be very helpful in
- 2:21:49maintaining a lean system which can be
- 2:21:52easier to support and keep
- 2:21:59secure VT or virtual terminals are
- 2:22:02console sessions that use the entire
- 2:22:03display and keyboard outside of a
- 2:22:05graphical environment such terminals are
- 2:22:07considered virtual because although
- 2:22:10there can be multiple active terminals
- 2:22:12only one terminal remains visible at a
- 2:22:14time a VT is not quite the same as a
- 2:22:17command line terminal window you can
- 2:22:19have many of those visible at once on a
- 2:22:21graphical desktop one virtual terminal
- 2:22:25usually number one or seven is reserved
- 2:22:28for the graphical environment and text
- 2:22:30logins are enabled on the unused VTS
- 2:22:33Ubuntu uses vt7 but s OAS and real and
- 2:22:36openi use vt1 for the graphical display
- 2:22:40an example of a situation where using
- 2:22:41VTS is helpful is when you run into
- 2:22:44problems with the graphical desktop in
- 2:22:46this situation you can switch to one of
- 2:22:48the text VTS and trouble shoot to switch
- 2:22:52between VTS press control alt function
- 2:22:55key for for the VT for example press
- 2:22:58control alt F6 for vt6 actually you only
- 2:23:02have to press the alt F6 key combination
- 2:23:05if you are in a VT and want to switch to
- 2:23:07another
- 2:23:12VT Linux distributions can start and
- 2:23:15stop the graphical desktop in various
- 2:23:17ways the exact method differs from
- 2:23:19distribution and among distribution
- 2:23:21versions for the newer system MD based
- 2:23:24distributions the display manager is run
- 2:23:27as a service you can stop the guey
- 2:23:29desktop with the system control utility
- 2:23:32and most distributions will also work
- 2:23:34with the uh T init command as in pseudo
- 2:23:38system control stop gdm or studo telet 3
- 2:23:43and restart it after logging into the
- 2:23:46console with pseudo system control start
- 2:23:50start gdm Oro pseudo Talent 5 on move to
- 2:23:55versions before 18.04 LTS substitute
- 2:23:58light DM for
- 2:24:03gdm in this section we will discuss how
- 2:24:06to accomplish basic operations from the
- 2:24:08command line these include how to log in
- 2:24:11and log out from the system restart or
- 2:24:14shut down the system locate applications
- 2:24:16access directories identify absolute and
- 2:24:18relative paths and EXP for the file
- 2:24:24system an available text terminal will
- 2:24:27prompt for a user name with the string
- 2:24:29login and password when typing your
- 2:24:32password nothing is displayed on the
- 2:24:34terminal not even a an asri to indicate
- 2:24:37that you typed in something and this is
- 2:24:39to prevent others from seeing your
- 2:24:40password after you've logged into the
- 2:24:42system you can perform basic
- 2:24:45operations once your session is started
- 2:24:47either by logging into a text terminal
- 2:24:50or via a graphical terminal program you
- 2:24:53can also connect and log into remote
- 2:24:55systems by using SSH for example by
- 2:24:59typing SSH student remotes server.com
- 2:25:02SSH would control would connect securely
- 2:25:05to the remote machine or remotes
- 2:25:07server.com and give student that's the
- 2:25:10user a command line terminal window
- 2:25:12either using a password as with regular
- 2:25:15logins or a cryptographic key to sign in
- 2:25:17without providing a password to a
- 2:25:19verified the
- 2:25:25identity the preferred method to shut
- 2:25:27down or reboot the system is to use the
- 2:25:29shutdown command this sends a warning
- 2:25:32message and then prevents further users
- 2:25:34from logging in the init process will
- 2:25:37then control shutting down or rebooting
- 2:25:39the system it's important to always shut
- 2:25:41down properly failure to do so can
- 2:25:44result in damage to the system and or
- 2:25:46loss of data the Halt and power off
- 2:25:50commands issue shutdown DH to Hal the
- 2:25:54system reboot issue shutd down- R and
- 2:25:58causes the machine to reboot instead of
- 2:26:00just shutting down both rebooting and
- 2:26:03shutting down from the command line
- 2:26:05requires super user or root access when
- 2:26:09administering a multi-user system you
- 2:26:12have the option of notifying all users
- 2:26:13prior shutdown as in pseudo shutdown DH
- 2:26:18uh 10:00 shutting down for scheduled
- 2:26:25maintenance depending on the specifics
- 2:26:27of your particular distributions policy
- 2:26:30programs and software packages can be
- 2:26:33installed in various directories in
- 2:26:35general executable programs and scripts
- 2:26:37should live in the SL bin or SL user bin
- 2:26:41or/ sbin or/ user sbin directories or
- 2:26:45somewhere under slop they can also
- 2:26:47appear in the/ user looc /bin or/ user
- 2:26:51locsin or in a directory in a user's
- 2:26:53account space such as slome student /bin
- 2:26:57one way to locate programs is to employ
- 2:27:00the witch utility for example to find
- 2:27:02out exactly where the diff program
- 2:27:04resides on the file system you can do
- 2:27:07which diff SL user bin diff if which
- 2:27:13does not find the program where is is a
- 2:27:15good alternative because it looks for
- 2:27:17packages in a broader range of system
- 2:27:20directories so where is
- 2:27:26diff when you first log into a system or
- 2:27:30open a terminal the default directory
- 2:27:32should be your home directory you can PR
- 2:27:35you can print the exact path of this by
- 2:27:37typing Echo home many Linux
- 2:27:40distributions actually open new
- 2:27:41graphical terminals in the dollar China
- 2:27:43home/ desktop the following commands are
- 2:27:46useful for directory navigation
- 2:27:56let's get some practice navigating among
- 2:27:58directories at the command line so
- 2:28:01suppose I go to the temp directory
- 2:28:05cdmp I do PWD for print working
- 2:28:08directory I'm at TMP I could do go to
- 2:28:11the home directory by doing CD dollar
- 2:28:14home you see PWD now is home student if
- 2:28:18I do cd. dot I go up one level to just
- 2:28:23home another way to navigate is to use
- 2:28:26the push D and pop D commands so I could
- 2:28:28do push
- 2:28:30D
- 2:28:32temp okay and it show me my previous
- 2:28:35history I was at Temp and uh I was at
- 2:28:37home and I go to Temp now if I do pop
- 2:28:41D it puts me back at the home
- 2:28:44directory another thing I can do is CD
- 2:28:48Dash and that takes me to the previous
- 2:28:51directory just like popd did so that's
- 2:28:55some basic day-to-day practices of
- 2:28:57navigating directories that one does all
- 2:28:59the time on a Linux
- 2:29:05system there are two ways to identify
- 2:29:08paths absolute path name which an
- 2:29:11absolute path name begins with the root
- 2:29:13directory and follows the tree branch by
- 2:29:16Branch until it reaches the desired
- 2:29:18directory or file Absolut paths always
- 2:29:20start with a slash or the relative PA
- 2:29:24path name a relative path name starts
- 2:29:26from the present working directory
- 2:29:28relative paths never start with a slash
- 2:29:30multiple slashes between directories and
- 2:29:33files are allowed but all but one slash
- 2:29:36between elements in the path name is
- 2:29:38ignored by the system so if you have a
- 2:29:40bunch of slashes it's valid but it's
- 2:29:42just seen as just having a single slash
- 2:29:44by the system most of the time it's most
- 2:29:47convenient to use relative paths which
- 2:29:50require less typing usually you take
- 2:29:52advantage of the shortcuts provided by
- 2:29:55use dot for present directory do dot for
- 2:29:58Parent Directory or the tilty for your
- 2:30:00home directory for example suppose
- 2:30:02you're currently working in your home
- 2:30:04directory and wish to move to the/ user
- 2:30:07spin directory the following two ways
- 2:30:09will bring you to the same directory
- 2:30:11from your home directory there is the
- 2:30:13absolute path name method and the
- 2:30:15relative path name method in this case
- 2:30:18the absolute path name method requires
- 2:30:20less
- 2:30:24typing traversing up and down the file
- 2:30:27system tree can get tedious the tree
- 2:30:29command is a good way to get a bird's
- 2:30:31eye view of the file system tree use
- 2:30:33tree- D just to view just the
- 2:30:35directories and to suppress listing the
- 2:30:38names the following commands can help in
- 2:30:41exploring the file system
- 2:31:00let's get started with how to explore
- 2:31:02the file system to access SL
- 2:31:06USR
- 2:31:08looc from the/ USR directory using
- 2:31:12absolute path at command prompt type cd/
- 2:31:17USR SL looc
- 2:31:20SL live and press enter go back to/ USR
- 2:31:25directory by typing
- 2:31:27cd/ USR and press enter to access SL USR
- 2:31:34looc from the/ USR directory using
- 2:31:38relative path at command prompt type CD
- 2:31:42local
- 2:31:43/li and press enter get to the root
- 2:31:46directory at the command prompt type the
- 2:31:48cd/ command
- 2:31:51and press enter to get a list of the
- 2:31:53files and directory in the present
- 2:31:54working directory at the command prompt
- 2:31:57type the ls command and press enter to
- 2:32:00get a list of hidden files and hidden
- 2:32:02directories at the command prompt type
- 2:32:05the ls- a command and press enter to get
- 2:32:09a tree view of the file system at the
- 2:32:11command prompt type the tree command and
- 2:32:14press enter to get a treeview of only
- 2:32:17directories in the file system at the
- 2:32:20command prompt type the
- 2:32:22tree-
- 2:32:24d/ command and press
- 2:32:33enter the inutility is used to create
- 2:32:36hard links and with the- s option soft
- 2:32:39links also known as symbolic links or
- 2:32:42Sim links these two kinds of links that
- 2:32:44are very useful in Unix based operating
- 2:32:47systems suppose that file one already
- 2:32:49exists a hard link called file two is
- 2:32:51created with the with this
- 2:32:56command note that two files now appear
- 2:32:59to exist however a closer inspection of
- 2:33:02the file listing shows that this is not
- 2:33:04quite true so we'll do ls- Li file one
- 2:33:08name file two and the- I option to LS
- 2:33:11prints out in the First Column the inode
- 2:33:14number which is a unique quantity for
- 2:33:17each file object this field is the same
- 2:33:19for both these
- 2:33:20so what is really going on here is that
- 2:33:22there's only one file but has more than
- 2:33:24one name associated with it as indicated
- 2:33:26by the two that appears in the ls output
- 2:33:30thus there was already another object
- 2:33:32linked to file one before the command
- 2:33:34was executed hard links are very useful
- 2:33:37and they save space but you have to be
- 2:33:39careful with their use sometimes in
- 2:33:42subtle ways for one thing if you remove
- 2:33:44either file one or file two in the
- 2:33:46example the inode object and the
- 2:33:48remaining file name will remain which
- 2:33:51might be undesirable as it may lead to
- 2:33:53subtle errors later if you recreate a
- 2:33:55file of that name if you edit one of the
- 2:33:58files exactly what happens depends on
- 2:34:01your editor most editors including V and
- 2:34:05gedit will retain the link by default
- 2:34:08but it's possible that modifying one of
- 2:34:10the names may break the link and result
- 2:34:12in the creation of two
- 2:34:18objects soft or symbolic links are
- 2:34:20created with a-s option as in ln- s file
- 2:34:251 file 3 or ls- Li file one file three
- 2:34:29notice file three no longer appears to
- 2:34:31be a regular file and it clearly points
- 2:34:33to file one and has a different enode
- 2:34:36number symbolic links take no extra
- 2:34:38space on the file system unless their
- 2:34:40names are very long they're extremely
- 2:34:42convenient as they can easily be
- 2:34:44modified to point to different places an
- 2:34:47easy way to create a shortcut from your
- 2:34:49home home directory to long path names
- 2:34:52is to create a symbolic link unlike hard
- 2:34:55links soft links can point to objects
- 2:34:58even on different file systems
- 2:35:00partitions and or Diss and other media
- 2:35:03which may or may not be currently
- 2:35:05available or even exist in the case
- 2:35:07where the link does not point to a
- 2:35:09currently available or existing object
- 2:35:11you obtain a dangling
- 2:35:17link the CD command remembers where you
- 2:35:21were last and let you get back there
- 2:35:23with CD dash for remembering more than
- 2:35:26just the last directory visited use push
- 2:35:29D to change the directory instead of CD
- 2:35:32this pushes your starting directory onto
- 2:35:34a list using popd will then send you
- 2:35:37back to those directories walking in
- 2:35:40reverse order the most recent directory
- 2:35:42will be the first one retrieve with popd
- 2:35:45the list of directories is displayed
- 2:35:47with the dur command
- 2:35:53Linux provides many commands that help
- 2:35:55you with viewing the contents of a file
- 2:35:57creating a new file or an empty file
- 2:35:59changing the timestamp of a file and
- 2:36:01moving removing and renaming a file or
- 2:36:04directory these commands help you in
- 2:36:06managing your data and files and and in
- 2:36:09ensuring that the correct data is
- 2:36:11available at the correct location in
- 2:36:13this section you will learn how to
- 2:36:15manage
- 2:36:15files let's get a feel for how to look
- 2:36:18at some of the lines in a given text
- 2:36:21file on your machine so we have on all
- 2:36:25our Linux Foundation virtual machines a
- 2:36:27file called Ready for. sh which I'm
- 2:36:31using word count to show me it has
- 2:36:355,127 lines if I just want to type the
- 2:36:39whole file out I could do that with the
- 2:36:42cat utilities so let me just do
- 2:36:45that but it went very very fast and in
- 2:36:48fact if I do cat
- 2:36:51dasn it shows me the line numbers as it
- 2:36:54goes and it is indeed
- 2:36:575127 the way to page your way through is
- 2:37:01to use the less utility so then I would
- 2:37:03do less
- 2:37:06ready
- 2:37:08forsh and then I get one screen at a
- 2:37:11time if I hit the space bar I see the
- 2:37:14second screen third screen Etc and I can
- 2:37:18keep going all the way through the file
- 2:37:20as fast as I want and by the way I can
- 2:37:23also do the less- capital
- 2:37:26in option and then I also get line
- 2:37:28numbers I did with cat Dash in so
- 2:37:33similar thing now suppose I just want to
- 2:37:35look at the first few lines of the file
- 2:37:38I could do head ready4
- 2:37:43Dosh and you see that only gave me I
- 2:37:45believe 10 lines if I wanted to get 20
- 2:37:48lines I could just give that as an
- 2:37:52argument okay so there we see the first
- 2:37:5420 lines likewise with
- 2:37:58tail by default I get the last 10 lines
- 2:38:01if I wanted to see the last 20
- 2:38:04lines I would do tail
- 2:38:07-20 and if you want to have some fun you
- 2:38:09can use the TAC
- 2:38:12utility where you'll notice that Tac is
- 2:38:16cat
- 2:38:17backwards and that just gives do the
- 2:38:19entire file
- 2:38:21backwards so these are day-to-day
- 2:38:24utilities one uses just to look at the
- 2:38:26contents of text
- 2:38:33files touch is often used to set or
- 2:38:36update the access change and modify
- 2:38:38times of files by default it resets a
- 2:38:41file's timestamp to match the current
- 2:38:43time however you can also create an
- 2:38:46empty file using touch uh like this
- 2:38:49touch and then the file name this is
- 2:38:51normally done to create an empty file as
- 2:38:52a placeholder for a later purpose touch
- 2:38:56provides several useful options for
- 2:38:58example the- T option allows you to set
- 2:39:01the date and timestamp of the file to a
- 2:39:03specific value as in touch DT and then
- 2:39:07we put the value uh and then the file
- 2:39:12name maker is used to create a deck
- 2:39:15directory such as maker samper it
- 2:39:19creates the sample directory named
- 2:39:20samper under the current directory maker
- 2:39:24user samper will create a sample
- 2:39:26directory called samper under SL user
- 2:39:31removing a directory is done with rmd or
- 2:39:34remove directory the directory must be
- 2:39:36empty or the command will fail to remove
- 2:39:39a directory and all of its contents you
- 2:39:41have to do rm-rf
- 2:39:47note that MV B does double duty in that
- 2:39:51it can simply rename a file or move a
- 2:39:55file to another location while possibly
- 2:39:57changing its name at the same
- 2:40:00time if you're not certain about
- 2:40:03removing files that match a pattern use
- 2:40:05Supply it's always good to run RM in
- 2:40:08interactively rm-- I to prompt before
- 2:40:12every
- 2:40:17removal rmd IR Works only on empty
- 2:40:21directories otherwise you get an error
- 2:40:23so while typing rm-- RF is a fast and
- 2:40:26easy way to remove a whole file system
- 2:40:27tree recursively it's extremely
- 2:40:30dangerous and should be used with the
- 2:40:31utmost care especially when used by root
- 2:40:35recall that recursive means drilling
- 2:40:37down through all subdirectories all the
- 2:40:39way down a
- 2:40:44tree the PS1 variable is the character
- 2:40:47string that is displayed as the prompt
- 2:40:49on the command line most distributions
- 2:40:52set PS1 to a known default value which
- 2:40:55is suitable in most cases however users
- 2:40:58may want custom information shown on the
- 2:41:00command line for example some system
- 2:41:04administrators require the user and the
- 2:41:06host system name to show up on the
- 2:41:09command line as in this
- 2:41:13example this could prove useful if
- 2:41:16you're working in multiple roles and
- 2:41:18want to be always reminded of who you
- 2:41:20are and what machine you are on the
- 2:41:22prompt above could be implemented by
- 2:41:25setting the PS1 variable to the
- 2:41:30following for example you could do that
- 2:41:33with this command
- 2:41:37here by convention most systems are set
- 2:41:40up so that the root user has a pound
- 2:41:43sign as their
- 2:41:45prompt let's gain some experience with
- 2:41:47day-to-day basic fire file operations on
- 2:41:50a Centos stream system this would be the
- 2:41:54same on any Linux system so first let's
- 2:41:57create a couple of files uh they could
- 2:41:59be empty or they could be small uh one
- 2:42:02way to do it is to use the echo command
- 2:42:04and just say Echo and direct actually
- 2:42:08nothing into file one another way to do
- 2:42:11it is with the touch command I'll say
- 2:42:13Touch file two then if I do ls- a file
- 2:42:18one and file
- 2:42:192 I see two very small files that are
- 2:42:23both created uh at the same time
- 2:42:26basically uh if I want to rename one of
- 2:42:28them I could rename it with the move
- 2:42:30command like move file one to file
- 2:42:36one new
- 2:42:40name and then if I
- 2:42:42do ls- L star file
- 2:42:46star I see there it is uh it it it it
- 2:42:50has the new name now if I want to remove
- 2:42:53them I can simply say RM File
- 2:42:572 and it just work it's a good idea
- 2:43:00though to always use the eye option for
- 2:43:02interactive when doing removal then I
- 2:43:05would say
- 2:43:06rm- I file one new name and it'll ask me
- 2:43:10if I really want to do it uh many
- 2:43:13distributions will set up the eye option
- 2:43:15to be the default so that you always
- 2:43:17have a chance uh to change your mind
- 2:43:20about removing something before you do
- 2:43:22it now how would I make a directory I
- 2:43:25could do make
- 2:43:26deer uh deer
- 2:43:29one in fact I can make more than one
- 2:43:31directory on the same line I can do make
- 2:43:34deer deer 2 and deer
- 2:43:373 and if I look now I see I have three
- 2:43:40different directories they're all
- 2:43:41actually empty so let me put a couple of
- 2:43:44files in one of the directories so I'll
- 2:43:46do touch deer 2 to file
- 2:43:51one and I'll do touch deer to file
- 2:43:55two so if I do ls- LR just to see
- 2:43:59everything that's there in the directory
- 2:44:02files uh so I'll see deer one is empty
- 2:44:06deer 2 has these two files and deer
- 2:44:09three uh is also empty now the command
- 2:44:12for removing directories is RM deer so
- 2:44:16let's say I just try to remove them all
- 2:44:19with a RM deer deer
- 2:44:23star uh you
- 2:44:25notice it got rid of deer 1 and deer 2
- 2:44:28but it couldn't remove deer deer 1 and
- 2:44:30deer 3 I should say it couldn't get rid
- 2:44:32of deer 2 because there's files in it to
- 2:44:35do that instead of using RM deer I would
- 2:44:37say
- 2:44:38RM RF deer
- 2:44:422 and then that goes and descends into
- 2:44:45the directory and gets rid of all the
- 2:44:46files be very careful with the rm-rf
- 2:44:50uh command because if you give the bad
- 2:44:53argument you could even wipe out your
- 2:44:55whole system but that is the standard
- 2:44:57way to get rid of a whole directory Tre
- 2:45:00so that's just some of the very basic
- 2:45:03commands for renaming files moving them
- 2:45:06creating directories removing them
- 2:45:14Etc when commands are executed by
- 2:45:17default there are three standard file
- 2:45:19streams or descriptors always open for
- 2:45:22use standard
- 2:45:24input standard output and standard error
- 2:45:30usually standard in input is your
- 2:45:32keyboard and standard output and
- 2:45:34standard error are printed on your
- 2:45:35terminal standard error is often
- 2:45:38redirected to an error logging file
- 2:45:41while standard in is supplied by
- 2:45:42directing input to to come from a file
- 2:45:44or from the output of a previous command
- 2:45:46through a pipe standard out is also
- 2:45:49often redirected into a file since
- 2:45:51standard error is where error messages
- 2:45:53are written usually nothing will go
- 2:45:55there in Linux all open files are
- 2:45:58represented internally by what are
- 2:46:00called file descriptors simply put these
- 2:46:03are represented by numbers starting at
- 2:46:05zero standard in is file descriptor zero
- 2:46:08standard out is file descriptor one
- 2:46:10Standard air is file descriptor 2
- 2:46:12typically if other files are opened in
- 2:46:14addition to these three which are open
- 2:46:16by default they will start at the file
- 2:46:18descrip scriptor 3 and increase from
- 2:46:20there in the next section and in the
- 2:46:23chapters ahead you'll see examples which
- 2:46:25alter where a where a running command
- 2:46:28gets its input where it writes its
- 2:46:30output or where it prints diagnostic or
- 2:46:33error
- 2:46:39messages through the command shell we
- 2:46:41can redirect the three standard file
- 2:46:43stream so that we can get input from
- 2:46:45either a file or another command instead
- 2:46:47of from our keyboard and we can write
- 2:46:49output and errors to files or use them
- 2:46:51to provide input for subsequent
- 2:46:54commands for example if we have a
- 2:46:57program called do something that reads
- 2:46:59from standard in and writes to standard
- 2:47:03out and standard error we can change its
- 2:47:06input source by using the less than sign
- 2:47:09followed by the name of the file to be
- 2:47:11consumed for input data here's an
- 2:47:16example if you want to send the output
- 2:47:18to a file use the greater than sign as
- 2:47:21in this
- 2:47:23example because standard error is not
- 2:47:25the same as standard out air messages
- 2:47:28will still will still be seen on the
- 2:47:30terminal windows in the above example if
- 2:47:33you want to redirect standard error to a
- 2:47:35separate file you use standard errors
- 2:47:38file descriptor number two the greater
- 2:47:41than sign followed by the name of the
- 2:47:43file you want to hold everything the
- 2:47:45running command writes to standard error
- 2:47:48so here's how you would do that a
- 2:47:51special shorthand notation can send
- 2:47:53anything written to file descriptor 2
- 2:47:55standard erir to the same place as file
- 2:47:58descriptor one standard out you can do
- 2:48:00it like
- 2:48:02this bash perits an easier Syntax for
- 2:48:05the above which is like
- 2:48:13so the unix/linux philosophy is to have
- 2:48:16many simple and short programs or
- 2:48:19commands cooperate together to produce
- 2:48:22quite complex results rather than have
- 2:48:24one complex program with many possible
- 2:48:27options and modes of operation in order
- 2:48:30to accomplish this extensive use of
- 2:48:32pipes is made you can pipe the output of
- 2:48:35one Commander program into another as
- 2:48:37its input in order to do this we use the
- 2:48:40vertical bar pipe symbol between
- 2:48:43commands as in this example
- 2:48:47here this represents what we often call
- 2:48:49a pipeline and allows Linux to combine
- 2:48:52the actions of several commands into one
- 2:48:54this is extraordinary efficient because
- 2:48:57Command 2 and command 3 do not have to
- 2:48:59wait for the previous pipeline commands
- 2:49:02to complete before they can begin
- 2:49:04hacking at the data in their input
- 2:49:06streams on multiple CPU or core systems
- 2:49:10the available computing power is much
- 2:49:12better utilized and things get done
- 2:49:14quicker furthermore there is no need to
- 2:49:16save output in temporary files between
- 2:49:19the stages in the pipeline which saves
- 2:49:22disk space and reduces reading and
- 2:49:23writing from disk which is often the
- 2:49:26slowest bottleneck in getting something
- 2:49:32done being able to quickly find the
- 2:49:35files you are looking for will save you
- 2:49:37time and enhance productivity you can
- 2:49:39search for files in both your home
- 2:49:41directory space or in any other
- 2:49:43directory or system or or location on
- 2:49:46the system the main tools for doing this
- 2:49:48are the locate and find utilities we'll
- 2:49:51also show how to use wild cards and Bash
- 2:49:55in order to specify any file which
- 2:49:57matches a given generalized
- 2:50:02request the locate utility program
- 2:50:05performs a search taking advantage of a
- 2:50:07previously constructed database of files
- 2:50:10and directories on your system matching
- 2:50:13all entries that contain a specified
- 2:50:15character string this can sometimes
- 2:50:17result in a very long list to get a
- 2:50:20shorter and possibly more relevant list
- 2:50:23we can use the grep program as a filter
- 2:50:26grep will print only the lines that
- 2:50:28contain one or more specified string as
- 2:50:31in this example which will list all the
- 2:50:33files and directories with both zip and
- 2:50:36Bin in their name we'll cover grap in
- 2:50:39much more detail later notice the use of
- 2:50:42the pipe or the vertical line to pipe
- 2:50:44the two commands together locate
- 2:50:47utilizes a database base created by a
- 2:50:49related utility update DB most Linux
- 2:50:53systems run this automatically once a
- 2:50:56day however you can update it at any
- 2:50:58time by just running update DB from the
- 2:51:00command line as the root user let's get
- 2:51:03some practice with locating and finding
- 2:51:06files on an Ubuntu system so suppose I
- 2:51:10want to find all files that have the
- 2:51:12string lfs 300 in them so I could do
- 2:51:15locate lfs 300
- 2:51:19and it finds indeed just one file that's
- 2:51:21in the home student directory on the
- 2:51:24subd directory there and I could also
- 2:51:28find it by doing find dot meaning the
- 2:51:32current directory name lfs 300
- 2:51:35star and then I'll see it finds it and
- 2:51:39if I want to find out a little more I
- 2:51:41can give the ls option which will show
- 2:51:43me who owns it what group they're in the
- 2:51:46length of the file the iode the date
- 2:51:50Etc now if I create another
- 2:51:53file just by doing Echo into lfs 300 so
- 2:51:57it creates essentially an empty file the
- 2:52:00find command will find the new file as
- 2:52:03well as the old one but the locate
- 2:52:07command will not because I need to
- 2:52:10update the database that uh that the
- 2:52:14locate command uses and I do that by
- 2:52:16running as roots so I need SU do as you
- 2:52:19do update
- 2:52:22DB and that was pretty quick uh and then
- 2:52:26I say locate it now it finds both files
- 2:52:30okay and um just to get rid of the file
- 2:52:33I didn't really need I'll remove it I
- 2:52:36run update DB
- 2:52:38again well I need it to be root so I
- 2:52:41have to say s you do and then once again
- 2:52:44locate fs300 won find this new file now
- 2:52:48I can configure update DB and locate to
- 2:52:51do a bunch of things so if I go to the
- 2:52:53ETC directory you'll see there's a file
- 2:52:57called update
- 2:53:01db.
- 2:53:04com and it controls where update DB does
- 2:53:08not look where locate does not look so
- 2:53:11for instance under prun task it says
- 2:53:13don't look in these places like the temp
- 2:53:15directory because they're temporary and
- 2:53:17you don't want to keep TR of what's
- 2:53:19there particularly and prun Fs these are
- 2:53:22file systems really pseudo file systems
- 2:53:25that are not real file systems that you
- 2:53:28shouldn't look in because they're also
- 2:53:30the uh contents change every time you
- 2:53:32boot let's say uh so for instance you
- 2:53:34don't look in the proc directory or the
- 2:53:36CIS FS directory or the dev directory uh
- 2:53:41well Dev FS directory because these
- 2:53:43things disappear every time you
- 2:53:45reboot uh and so that's pretty easy to
- 2:53:48configure there's some other things you
- 2:53:50can do which you can learn by looking at
- 2:53:51the documentation on your
- 2:53:57system you can search for a file name
- 2:54:00containing specific characters using
- 2:54:02wild cards to search for files using the
- 2:54:06question mark Wild Card replace each
- 2:54:08unknown character with question mark for
- 2:54:11example if you know only the first two
- 2:54:13letters are ba of a three-letter file
- 2:54:16name without an extension you can type
- 2:54:19this to search for files using the Wild
- 2:54:22Card replace the unknown string with the
- 2:54:25aster for example if you remember only
- 2:54:28that the extension was out type LS as.
- 2:54:34out let's get some experience using wild
- 2:54:37cards on an auntu system so I've gone to
- 2:54:40the VAR log directory and let me just do
- 2:54:42an LS to see what's there so for
- 2:54:46instance uh let me use the DU or dis
- 2:54:49usage utility which tells me all the
- 2:54:51bytes that are being used by a given
- 2:54:54file or subdirectory I could do
- 2:54:56something like
- 2:55:00D.S H uh
- 2:55:03AAR and you'll see these are all the
- 2:55:06different things under a uh some are
- 2:55:09directories like app the others are just
- 2:55:11files if I only wanted to look at ones
- 2:55:15which have log in the name I could do du
- 2:55:18s s h a star log star and so only ones
- 2:55:23that have log and their names if I only
- 2:55:25wanted to look at the ones that start
- 2:55:29from the letter P or later in the
- 2:55:31alphabet I could do du.
- 2:55:34sh a and then I could say uh square
- 2:55:40brackets p through
- 2:55:43Z Star you see it neglected the
- 2:55:47alternative one
- 2:55:49uh which would have done that if I just
- 2:55:51want to look at uh ones which have a
- 2:55:54certain character in them I could do
- 2:55:56something like
- 2:55:58duar
- 2:55:59do uh one character do star so those are
- 2:56:05all the ones that have a substring in
- 2:56:08them with one character uh here it's
- 2:56:10always a number but it wouldn't have to
- 2:56:12be um surrounded by periods on both
- 2:56:15sides now you have to be careful with
- 2:56:17wild cards that the system doesn't quote
- 2:56:20glob what you are doing the string that
- 2:56:23you are putting in so to give you an
- 2:56:24example uh you'll notice there's a bunch
- 2:56:27of different files here that start with
- 2:56:29the name VMware well they're all over in
- 2:56:31the right column here so suppose I try
- 2:56:34to do uh uh
- 2:56:37appg install VMware star and I should
- 2:56:40make that Su
- 2:56:44do well it's actually looking for
- 2:56:46packages with all these names like
- 2:56:48VMware Network one VM VSC Route 2 that
- 2:56:53log and there are of course no packages
- 2:56:55with silly names like that but I could
- 2:56:57do something like this now let me put
- 2:57:00the VMware star in
- 2:57:04quotes and you see it actually uh did
- 2:57:06find things it found two packages VMware
- 2:57:09NSX common VMware manager and it wants
- 2:57:14to install them and it needs these other
- 2:57:15Utilities in order for them to work
- 2:57:18uh I'm not going to do this because I
- 2:57:20don't need these guys so I'll just say
- 2:57:22no so when you put something in quotes
- 2:57:26it says don't look in the current
- 2:57:28directory to like fill out the names to
- 2:57:30expand what you're doing uh instead
- 2:57:32looking in this case in the database of
- 2:57:35packages um so you have to be careful
- 2:57:38and you'll often see people use quotes
- 2:57:40even when there's no need for them just
- 2:57:42to be safe so that's a little bit of
- 2:57:44demonstration of the use of wild cards
- 2:57:51find is an extremely useful and often
- 2:57:54used utility program in the daily life
- 2:57:56of a Linux system administrator it
- 2:57:59recurses down the file system tree from
- 2:58:02any particular directory or set of
- 2:58:04directories and locates files that match
- 2:58:06specified conditions the default path
- 2:58:09name is always the present working
- 2:58:11directory for example administrators
- 2:58:14sometimes scan for potentially large
- 2:58:16core files which contain diagnostic
- 2:58:19information after a program fails
- 2:58:21they're more than several weeks old in
- 2:58:23order to remove them it's also common to
- 2:58:26remove files that are not essential or
- 2:58:29that are outdated in the/ TMP directory
- 2:58:34especially those that have not been
- 2:58:35accessed recently many Linux
- 2:58:38distributions use shell scripts that run
- 2:58:40periodically through cron to perform
- 2:58:43such house cleaning
- 2:58:49when no arguments are given find list
- 2:58:52all files in the current directory and
- 2:58:54all of its subdirectories commonly used
- 2:58:56options to shorten the list include -
- 2:58:59name which only list files with a
- 2:59:01certain pattern in their name - iame
- 2:59:04also ignore the case of the file names
- 2:59:06and dash type which will restrict the
- 2:59:09results to files of a certain specifi
- 2:59:11type such as D for directory L for
- 2:59:15symbolic link or F for a regular file
- 2:59:18here's how you can search for files and
- 2:59:19directories named
- 2:59:21GCC here's how to search only for
- 2:59:23directories named GCC here's how to
- 2:59:26search for only for regular files named
- 2:59:33GCC another good use of find is being
- 2:59:36able to run commands on the files that
- 2:59:39match your search criteria the dash EXA
- 2:59:42option is used for this purpose to find
- 2:59:45and remove all files that end with s swp
- 2:59:49you can use
- 2:59:51this the squiggly brackets are a
- 2:59:54placeholder that will be filled with all
- 2:59:56the file names that result from the find
- 2:59:58expression and the proceeding command
- 3:00:01will be run on each one
- 3:00:03individually please note that you have
- 3:00:05to end the command with either a
- 3:00:08semicolon including the single quote or
- 3:00:11a SL semicolon both forms are fine one
- 3:00:15can also use the- okay option which
- 3:00:18behaves the same as- exact except that
- 3:00:22fine will prompt you for permission
- 3:00:24before executing the command this makes
- 3:00:27it a good way to test your results
- 3:00:30before blindly executing any potentially
- 3:00:33dangerous
- 3:00:38commands it is sometimes the case that
- 3:00:40you wish to find files according to
- 3:00:43attributes such as when they were
- 3:00:46created last used or based on their size
- 3:00:49it's easy to perform such searches to
- 3:00:52find files based on time you can use
- 3:00:55this here- C time is when the enode
- 3:00:59metadata or the the file in ownership
- 3:01:01that permissions last change it's often
- 3:01:04but not necessarily when the file was
- 3:01:06first created you can also search files
- 3:01:08based on when they were accessed or last
- 3:01:10read or based on when they were modified
- 3:01:12or last written the number is the number
- 3:01:15of days and can be expressed in either a
- 3:01:18number n that means exactly that Value
- 3:01:21Plus n which means greater than the
- 3:01:23number or minus n which means less than
- 3:01:26that number there are similar options
- 3:01:28for times and minutes as in the- cmen D
- 3:01:32aen and DM Min to find files based on
- 3:01:37sizes you can do
- 3:01:38this note that the size here is in 52
- 3:01:42byte blocks by default you can also
- 3:01:44specify bytes kilobytes megabytes
- 3:01:47gigabytes Etc as with the time numbers
- 3:01:50above file sizes can also be exact
- 3:01:52numbers for details consult the man page
- 3:01:54to finded for example to find files
- 3:01:57greater than 10 megabytes in size and
- 3:01:59running a command on those files you can
- 3:02:02use this
- 3:02:05command let's gain some experience using
- 3:02:08a very powerful find utility on a
- 3:02:11nobuntu system and I'll work in the VAR
- 3:02:14log directory so suppose I wanted to see
- 3:02:17every file here that's uh underneath our
- 3:02:21log and let me do it as Su do because
- 3:02:24otherwise it will give me error messages
- 3:02:26about not having permissions to look at
- 3:02:28some files so do s you do find Dot and I
- 3:02:32get a very long list of every single
- 3:02:35file and directory that's underneath
- 3:02:37here if I wanted to restrict it just to
- 3:02:39directories I would do type
- 3:02:43D and you'll see this just shows me the
- 3:02:46directories and subdirectories
- 3:02:48okay cuz like some of them like live
- 3:02:50vert have multiple directories if I add
- 3:02:52to that another parameter
- 3:02:56Max Def
- 3:03:00One you see it suppressed the
- 3:03:02subdirectories here I only see live ver
- 3:03:04now so I only went down a depth of one
- 3:03:07and actually I could do two three or
- 3:03:09whatever is necessary though here it
- 3:03:11doesn't go that deep anyway now you can
- 3:03:13always add commands um to
- 3:03:18any fine command so I could do fine DOT
- 3:03:24type
- 3:03:26f and then I can say exact grip DH uh
- 3:03:32log and I put in that parentheses uh
- 3:03:36pair there and then let's say
- 3:03:39slash
- 3:03:40um semicolon you can also do a single
- 3:03:43Dash semicolon single
- 3:03:45Dash and it search to every single file
- 3:03:48that had the word log in it and printed
- 3:03:50out all the different things that were
- 3:03:53there or to keep it a little simpler I
- 3:03:55could have done
- 3:03:57exec just ls-
- 3:04:02L and it would give me listings of all
- 3:04:04these files okay now there actually is a
- 3:04:08LS
- 3:04:09option built into find so I didn't
- 3:04:12really have to do that and it will just
- 3:04:14show me that kind of information there's
- 3:04:17other things things I can do like
- 3:04:19find size
- 3:04:22zero it's finding all the files I should
- 3:04:26have done Su do but all the files that
- 3:04:28have a size of zero and if I want to
- 3:04:31verify that I'll add the ls option you
- 3:04:34see these are all files of the name with
- 3:04:37size zero uh you can also do things like
- 3:04:40find uh let's say I want to find
- 3:04:42everything that's newer than this file
- 3:04:45BM here I could do something like Su do
- 3:04:50find. uh
- 3:04:54newer B
- 3:04:56temp and it show me everything that's
- 3:04:58been done since then there's a million
- 3:05:01options to find you can be used on a lot
- 3:05:03of complicated ways you can negate any
- 3:05:07parameter you want to put in by saying
- 3:05:09not uh you can combine uh different
- 3:05:13search criteria and I recommend heavily
- 3:05:16that you really read up on mind if
- 3:05:18you're going to use it CU it's a little
- 3:05:20hard to describe in a few seconds but
- 3:05:22there's a million things you can do with
- 3:05:28it the core parts of a Linux
- 3:05:30distribution and most of its add-on
- 3:05:32software are installed via the package
- 3:05:35management system each package contains
- 3:05:38the files and other instructions needed
- 3:05:41to make one software component work well
- 3:05:43and cooperate with the other components
- 3:05:46that comprise the entire system system
- 3:05:48packages can depend on each other for
- 3:05:50example a package for a web-based
- 3:05:53application written in PHP can depend on
- 3:05:56the PHP package there are two broad
- 3:05:59families of packages package managers
- 3:06:02those based on Debian and those which
- 3:06:04use RPM as their low-level package
- 3:06:06manager the two systems are incompatible
- 3:06:09but broadly speaking provide the same
- 3:06:11features and satisfy the same needs
- 3:06:14there are some other systems used by
- 3:06:16more specialized Linux distributions in
- 3:06:18this section you will learn how to
- 3:06:20install remove or search for packages
- 3:06:23from the command line using these two
- 3:06:25package Management
- 3:06:31Systems both package Management Systems
- 3:06:33operate on two distinct levels a
- 3:06:36low-level tool such as dpkg or RPM takes
- 3:06:40care of the details of unpacking
- 3:06:42individual packages running scripts
- 3:06:45getting the software installed correctly
- 3:06:47while a highle tool such as aptg dnf yum
- 3:06:51or zipper works with groups of packages
- 3:06:54downloads packages from the vendor and
- 3:06:56figures out
- 3:06:58dependencies most of the time users need
- 3:07:01to work only with the highlevel tool
- 3:07:03which will take care of calling the
- 3:07:05low-level tool as needed dependency
- 3:07:08resolution is a particularly important
- 3:07:11feature of the highlevel tool as it
- 3:07:13handles the details of finding and
- 3:07:15installing each dependency for you
- 3:07:18be careful however as installing a
- 3:07:20single package could result in many
- 3:07:22dozens or even hundreds of dependent
- 3:07:24packages being
- 3:07:30installed the advanced packaging tool
- 3:07:32apt is the underlying package management
- 3:07:35system that manages software on Deviant
- 3:07:37based systems while it forms the back
- 3:07:40end for graphical package managers such
- 3:07:42as the yuntu software Center and
- 3:07:44synaptic its native user interface is at
- 3:07:47the command line with programs that
- 3:07:50include apt or appg and apt cach dnf is
- 3:07:55the op Source command line package
- 3:07:57management utility for the RPM
- 3:07:59compatible Linux systems that belongs to
- 3:08:01the red hat family dnf has both command
- 3:08:05line and graphical user interfaces
- 3:08:08Fedora and real 8 replaced the older yum
- 3:08:11utility with dnf thereby eliminating a
- 3:08:13lot of historical baggage as well as
- 3:08:15introducing many nice new cap abilities
- 3:08:18dnf is pretty much backwards compatible
- 3:08:21with yum for day-to-day commands zipper
- 3:08:24is the package management system for the
- 3:08:26Susi or open Susi family and it's also
- 3:08:29based on RPM zipper also allows you to
- 3:08:32manage repositories from the command
- 3:08:35line zipper is fairly straightforward to
- 3:08:37use and resembles dnf or yum quite
- 3:08:41closely to learn the basic package
- 3:08:43commands take a look at these basic
- 3:08:46packaging commands
- 3:09:05let's get some practice with the basic
- 3:09:07low-level command for the Debian
- 3:09:09packaging system
- 3:09:12dpkg or D package so to get a list of
- 3:09:16all the pack packages on the system I
- 3:09:18can simply type
- 3:09:21dpkg
- 3:09:25d-list and I'll just pipe that into list
- 3:09:28because it's a long
- 3:09:29list okay actually if I don't use list
- 3:09:33for some reason it's more
- 3:09:35compact okay so there are a lot of
- 3:09:37different packages on the
- 3:09:39system now if I want to see some
- 3:09:42information just about a particular
- 3:09:44package I could just grap let's say bzip
- 3:09:482 to see what's going on with bzip 2 and
- 3:09:51that's the information about bzip 2 that
- 3:09:53tells us the version number the
- 3:09:56architecture which here is
- 3:09:58amd64 and it's description as a
- 3:10:00highquality block sorting file
- 3:10:02compressor utility so it's a more
- 3:10:05advanced program with better compression
- 3:10:08than gzip or the oldfashioned zip
- 3:10:11program if I want to see what's actually
- 3:10:15contained in that package I can do DP
- 3:10:19kg list files and then the name of it
- 3:10:24and then I'll go slower by putting it
- 3:10:26into
- 3:10:27less and you'll see there's the
- 3:10:29executables in the bin directory and
- 3:10:32then what's under user is basically
- 3:10:35documentation under user share doc user
- 3:10:38sh man
- 3:10:42Etc if I try to remove the package let's
- 3:10:46see what happens
- 3:10:48so do su do
- 3:10:50dpkg I of course have to have root
- 3:10:52privilege to remove the
- 3:10:55package so I'm removing bzip 2 D package
- 3:10:58remove bzip
- 3:11:002 and it's telling me I cannot do this
- 3:11:04because I need the develop in package
- 3:11:07dpkg-dev that would be headers and stuff
- 3:11:10for programs which use uh this in a
- 3:11:14library version and firew raller with
- 3:11:17which is a archive extraor that's common
- 3:11:19on Linux systems so I would have to
- 3:11:22remove all three of them we'll see later
- 3:11:24when we use tools like appg it's easier
- 3:11:26to deal with these
- 3:11:31dependencies but now get some practice
- 3:11:34using the low-level RPM command in order
- 3:11:37to look at a package try to remove it
- 3:11:40Etc so we're going to type RPM dqa for
- 3:11:43query and look at all packages on the
- 3:11:46system and then then we're going to grip
- 3:11:48to look for the package bzip
- 3:11:512 okay and you see there's actually two
- 3:11:54RPM packages which have bzip 2 in there
- 3:11:58names the actual bzip 2 program and then
- 3:12:01bzip 2 lives which is libraries that
- 3:12:04depend on bzip
- 3:12:072
- 3:12:08so let's take a look more at information
- 3:12:12about bzip 2 if I do
- 3:12:15RPM if I do RP m-q for query I for
- 3:12:20information and then L for a list of
- 3:12:22files and that's a lot so I'll pipe it
- 3:12:24through
- 3:12:26less oops I forgot to give the name of
- 3:12:28the package so bzip
- 3:12:332 you see the name is bzip 2 you see
- 3:12:36it's version
- 3:12:381.06 um we see it's Source RPM here we
- 3:12:44see when it was released in November
- 3:12:462015
- 3:12:47at of sos.org
- 3:12:50and then a description of what it does
- 3:12:53it's a freely available patent-free
- 3:12:55highquality data compressor Etc and then
- 3:12:58a list of the files that are part of
- 3:13:00bzip
- 3:13:012 if I want to get a little bit more
- 3:13:04detailed look at what's in there I could
- 3:13:07do something a little fancier like
- 3:13:10RPM that Q L be zip 2 we just list the
- 3:13:16files and then uh I'll make that a shell
- 3:13:19command and substitute for it and do an
- 3:13:22ls- LF on that so this will give me a
- 3:13:25detailed listing and then I'll pipe it
- 3:13:27into
- 3:13:29less and these are actual files that are
- 3:13:32in the package in a little bit more
- 3:13:33detail like their length and what type
- 3:13:35of files you'll notice for instance B
- 3:13:38unzip 2 and bzip 2 are really the same
- 3:13:41file it's just a symbolic link and the
- 3:13:45system knows what to do or I should say
- 3:13:47the application knows what to do whether
- 3:13:50to zip or unzip depending on how it's
- 3:13:55called now let's see what happens if I
- 3:13:58try to remove the
- 3:14:00package so I I would should be a root to
- 3:14:03do that so do an Su do and then I'll do
- 3:14:06RPM d e for erase and then just to be
- 3:14:10extra careful I'll use the dash dash
- 3:14:12test which means it won't actually do
- 3:14:14anything with this option it'll just see
- 3:14:16if it could do it bzip 2 so I try to
- 3:14:20remove it and it's telling me that I
- 3:14:23can't do that because it's need by those
- 3:14:25following three packages as well as the
- 3:14:28file roller program uh which is an
- 3:14:32archiving program present on basically
- 3:14:35all Linux
- 3:14:36distributions and then I can get a
- 3:14:38little more information in a different
- 3:14:40way with RPM
- 3:14:42dq--
- 3:14:44what provides BZ zip
- 3:14:482 and you'll see it's the bzip 2
- 3:14:53package and if I do what
- 3:15:00requires I get the same information
- 3:15:03about the three packages that would like
- 3:15:06that need to have bzip 2 installed for
- 3:15:09them to behave properly and not crash or
- 3:15:13anything a little bit later we're going
- 3:15:15to discuss yum and zipper and also dnf
- 3:15:19which are higher level programs that can
- 3:15:21handle dependencies in robust fashion
- 3:15:23RPM is really designed for individual
- 3:15:27packages which are listed on the command
- 3:15:30line or groups of packages listed on the
- 3:15:32command
- 3:15:37line let's get some practice using dnf
- 3:15:40from the command line on a recent Fedora
- 3:15:42system so in order to do that first
- 3:15:45we'll have to bring up the command line
- 3:15:47so I'll do that with activities and I'll
- 3:15:48click on the terminal icon at the bottom
- 3:15:50and I got a nice command line terminal
- 3:15:53and I'll make it a little bit bigger
- 3:15:55because the the fonts bigger that is
- 3:15:57because uh it's hard to see with the
- 3:15:59smaller fonts and then first let's get a
- 3:16:02list of all
- 3:16:04packages that have the string bzip 2 in
- 3:16:08their
- 3:16:09name so I'll do that with dnf list and
- 3:16:13the first packages that will come up
- 3:16:15will be the ones that are already
- 3:16:17installed so let me scroll up a little
- 3:16:19because there's a really long list here
- 3:16:21so there I have the actual program bc2 a
- 3:16:25development package in case I want to
- 3:16:28write code that uses bzip 2 in
- 3:16:31internally and then uh bzip 2 lives
- 3:16:34would be used by programs that have bzip
- 3:16:362 in already built into them the two I'm
- 3:16:40going to be interested in installing
- 3:16:42here are the lb
- 3:16:44zip2 packages
- 3:16:47bzip 2 is a parallel version of bzip 2
- 3:16:50that can separate the amount of work
- 3:16:52into a number of pieces that can be done
- 3:16:54simultaneously so for instance if you
- 3:16:57had four processors or cores you could
- 3:16:59split the work up into four pieces and
- 3:17:02do them all at the same time and then
- 3:17:03merge them at the end and in theory it
- 3:17:06could run almost four times as quickly
- 3:17:09so let's try to install the utilities
- 3:17:12package I'll do su do dnf install
- 3:17:17Live bzip
- 3:17:222 yeah I guess it's lb zip2 bzip 2
- 3:17:31utils and you'll see yes it's happy to
- 3:17:34do that but it also needs the lb zip 2
- 3:17:36package which it depends on so I say yes
- 3:17:39I'll just type
- 3:17:41Y and it will install the two
- 3:17:44packages um I probably have a program
- 3:17:47now called lb zip 2 but let's check if
- 3:17:50that's the
- 3:17:51case with
- 3:17:57which and yes I do so I could go ahead
- 3:18:00and use it now if I wanted if I don't
- 3:18:03really want these install and I want to
- 3:18:05clean up with them I could do um
- 3:18:07something like Su do dnf remove lb zip 2
- 3:18:16and you notice it's happy to remove it
- 3:18:18but it's telling me that because lb zip
- 3:18:212 utils depends on lb zip 2 if I remove
- 3:18:25lb zip 2 I better remove them both
- 3:18:28otherwise I'll have an unsatisfied
- 3:18:29dependency so I'll just say
- 3:18:32yes so that's just a really simple uh
- 3:18:36example of using dnf in the command line
- 3:18:39unfortunately recent redhead based
- 3:18:41systems do not have a really good
- 3:18:43graphical package management utility
- 3:18:46pedora has something called dnf Dragon
- 3:18:49but it can be rather slow to load and a
- 3:18:52little bit buggy and there's nothing at
- 3:18:54all for Red Hat 8 or Centos S8 so
- 3:18:58experienced developers will just always
- 3:19:00tend to do things from the command
- 3:19:06line let's demonstrate some basic
- 3:19:09package management functions on an open
- 3:19:12Su system using the zipper utility so
- 3:19:16first first let's look for all packages
- 3:19:19with
- 3:19:20zipper search that have the string new
- 3:19:23clot in
- 3:19:25them and we see a number of packages
- 3:19:28let's concentrate on the documentation
- 3:19:30package so suppose I try to install that
- 3:19:33and for that I have to be a super user
- 3:19:36for an installation so I do su do zipper
- 3:19:40install new
- 3:19:41plot
- 3:19:44Dot and you notice it's telling me I not
- 3:19:47only have to install new plot. do I
- 3:19:50would have to install new plot which is
- 3:19:52the actual program that new plot.
- 3:19:56do-to uh documents so I'll say sure
- 3:20:03yes and it's been done successfully if I
- 3:20:06want to get some information about the
- 3:20:09package I can do RPM
- 3:20:11dqi new plot dto and for this once again
- 3:20:15I do not have to be root
- 3:20:18and it's telling me the name the version
- 3:20:20the size all sorts of things and under
- 3:20:23the purpose it's telling me it concludes
- 3:20:25the man and the info Pages for this
- 3:20:28rather useful plotting program now
- 3:20:31suppose I want to remove this package I
- 3:20:34can do
- 3:20:35zipper remove G
- 3:20:38new plot let's say I try to remove gplot
- 3:20:41not not new plot. th
- 3:20:46and it's telling me that if I remove new
- 3:20:49plot I also have to remove new plot. do-
- 3:20:53do because otherwise there would be
- 3:20:54unmet dependency so say yes for
- 3:20:57sure and now both of them are gone so
- 3:21:00that's basic steps you would take to
- 3:21:04look for package install it get some
- 3:21:07information about it and remove it using
- 3:21:15zipper so let's do some basic package
- 3:21:19Management on an auntu system using
- 3:21:21Debian packaging we're going to use the
- 3:21:24high level utilities which understand
- 3:21:27dependencies app cash and
- 3:21:29appg so first let's look for all
- 3:21:34packages that contain the
- 3:21:38string W get 2 so we do that with app
- 3:21:41cash search W
- 3:21:44get2 and it comes up with WG 2 and W
- 3:21:47get2 Dev this is uh an enhancement to
- 3:21:51the standard W get utility which is used
- 3:21:54for recursive downloading of the content
- 3:21:57of a website or some other kinds of uh
- 3:22:01resources so let's just try and install
- 3:22:03so I do su
- 3:22:05do get install W get2
- 3:22:11ddev and it's telling me it also needs
- 3:22:14to install W live W get 0 and W get 2 it
- 3:22:19shouldn't be that
- 3:22:21surprising that you need to install the
- 3:22:24base packages on which the development
- 3:22:26packag is built on and it will download
- 3:22:30264 kilobytes of archives but once
- 3:22:33everything's installed it will expand
- 3:22:35out to 805 kilobytes so let's just say
- 3:22:39yes I'll type
- 3:22:41Y and it quickly goes ahead and does all
- 3:22:44that now suppose I want
- 3:22:47remove W get to Dev well more
- 3:22:51interesting let's try to
- 3:22:54remove W
- 3:22:56get uh
- 3:23:00itself so what does it doing oh I
- 3:23:04shouldn't have removed W get I meant W
- 3:23:06get two w get I do not want to remove so
- 3:23:09I'll type it again with the
- 3:23:11two and you see it wants to remove W
- 3:23:14get to Dev as well because without W get
- 3:23:19W get2 Dev isn't have much meaning okay
- 3:23:22and we no longer need live W get
- 3:23:25zero um it's sort of offened out but
- 3:23:29we'll leave it there for now so I'll
- 3:23:31just say
- 3:23:34yes and I have removed things from my
- 3:23:37system so that's the most basic
- 3:23:40operations you would need to do on an
- 3:23:43Ubuntu system using Debbie and packaging
- 3:23:53you have completed chapter 7 let's
- 3:23:54summarize the key Concepts we covered
- 3:23:57virtual terminals or VT and Linux are
- 3:24:00consoles or commandline terminals that
- 3:24:03use the connected Monitor and keyboard
- 3:24:06different Linux distributions start and
- 3:24:09stop the graphical desktop in different
- 3:24:11ways a terminal emulator program on the
- 3:24:15graphical desktop works by emulating a
- 3:24:17terminal within a window on the desktop
- 3:24:20the Linux system allows you to either
- 3:24:23log in via text terminal or remotely via
- 3:24:26the console when typing your password
- 3:24:29nothing is printed to the terminal not
- 3:24:31even a generic symbol to indicate that
- 3:24:34you typed the preferred method to shut
- 3:24:37down or reboot the system is to use the
- 3:24:40shutdown
- 3:24:41command there are two types of path
- 3:24:44names absolute and relative an absolute
- 3:24:48path name begins with the root directory
- 3:24:50and follows the tree branch by Branch
- 3:24:52until it reaches the desired directory
- 3:24:54or file a relative path name starts with
- 3:24:57the present working directory using hard
- 3:25:01and soft symbolic links is extremely
- 3:25:03useful in Linux CD remembers where you
- 3:25:07were last and lets you get back there
- 3:25:09with CD Dash locate performs a database
- 3:25:13search to find all file names that match
- 3:25:16a given pattern find locates files
- 3:25:19recursively from a given directory or
- 3:25:21set of directories find is able to run
- 3:25:24commands on the files that it lists when
- 3:25:27used with the DX exec options touch is
- 3:25:31used to set the access change and edit
- 3:25:33time to files as well as to create empty
- 3:25:36files the advanced package tool
- 3:25:39packaging tool AP this package
- 3:25:41management system is used to manage
- 3:25:43installed software on dbm based such
- 3:25:46systems you can use the dnf command line
- 3:25:49package development utility for the RPM
- 3:25:52based Red Hat Family Linux
- 3:25:55distributions the zipper package
- 3:25:57management system is based on RPM and
- 3:26:00used for open
- 3:26:05Susi by the end of this chapter you
- 3:26:08should be able to use different sources
- 3:26:11of documentation use the Man pages
- 3:26:15access the new info system use the help
- 3:26:19command and the d-el option use other
- 3:26:22documentation
- 3:26:27sources whether you are an inexperienced
- 3:26:30user or a veteran you'll not always know
- 3:26:32or remember the proper use of various
- 3:26:35Linux programs and utilities what is the
- 3:26:38command to type what options does it
- 3:26:40take Etc you'll need to consult help
- 3:26:42documentation regularly because Linux
- 3:26:44based systems draw from from a large
- 3:26:46variety of sources there are numerous
- 3:26:49reservoirs of documentation and ways of
- 3:26:51getting help Distributors consolidate
- 3:26:53this material and present it in a
- 3:26:55comprehensive and easy to use manner
- 3:26:58important Linux documentation sources
- 3:27:01include the Man pages short for manual
- 3:27:04pages new info the help command and Das
- 3:27:08Das help option other documentation
- 3:27:11sources like the ginu handbook
- 3:27:17The Man pages are the most often used
- 3:27:19source of Linux documentation they
- 3:27:22provide in-depth documentation about
- 3:27:24many programs and utilities as well as
- 3:27:26other topics including configuration
- 3:27:28files and programming apis for system
- 3:27:31calls library library routines and the
- 3:27:34kernel they are present on all Linux
- 3:27:36distributions and are always at your
- 3:27:38fingertips the M Pages infrastructure
- 3:27:40was first introduced in the early Unix
- 3:27:43versions in the beginning of the 1970s
- 3:27:46the name man is just an abbreviation for
- 3:27:48manual typing man with a topic name as
- 3:27:51an argument retrieves the information
- 3:27:52stored in the Topic's Man pages the man
- 3:27:55program searches formats and displays
- 3:27:58the information contained in the man
- 3:27:59page system because many topics have
- 3:28:02copious amounts of relevant information
- 3:28:04output is piped through a pager program
- 3:28:08such as less to be viewed one page at a
- 3:28:10time at the same time the information is
- 3:28:13formatted for a good visual display a
- 3:28:16given topic may have multiple Man pages
- 3:28:19associated with it and there is a
- 3:28:21default order determining which one is
- 3:28:22displayed when no options or section
- 3:28:25number is specified to list all pages on
- 3:28:27the topic use the- f option to list all
- 3:28:30pages that discuss a specific topic even
- 3:28:33if the specified topic is not present in
- 3:28:35the name use the d-k
- 3:28:38option let's use the Manu ility to get
- 3:28:40some information about sockets on our
- 3:28:43system if I just type man socket
- 3:28:47I get chapter
- 3:28:49two of the Linux programmers
- 3:28:52manual I get the page in there in
- 3:28:54chapter two that has to do with sockets
- 3:28:56and this is a pretty General page that
- 3:28:59tells me a lot of information about
- 3:29:01sockets and different protocols that
- 3:29:03they can
- 3:29:04use if I want to get a list of all the
- 3:29:08pages that are called socket I do man-
- 3:29:11focket you'll see there's actually five
- 3:29:13of them in different chapters that by
- 3:29:16the way is exactly the same as saying
- 3:29:18what is
- 3:29:19Socket so man DF and apropo are the same
- 3:29:24if I want to see a particular page say
- 3:29:26chapter 7 I can do man 7 socket and I'm
- 3:29:30getting the man page in chapter
- 3:29:347 which is rather detailed if I want to
- 3:29:38see them all at once I can see man- a
- 3:29:41socket for all I
- 3:29:43guess and I can space my way through
- 3:29:46through this one if I hit Q it's telling
- 3:29:49me if I hit return I'll see the next one
- 3:29:513p so let's do
- 3:29:53that I'll hit Q again you see if I want
- 3:29:56to get out rather than going through the
- 3:29:58rest of them the next one would be seven
- 3:30:00I can hit contrl Ctrl D would just skip
- 3:30:03the next one if I want to see all Man
- 3:30:07pages that have the word socket in their
- 3:30:09Des basic
- 3:30:11description I do that with man- K and
- 3:30:15it's a rather list because sockets are
- 3:30:17pretty basic and involve all sorts of
- 3:30:20things on your system man- K is exactly
- 3:30:23the same just type it appropo socket and
- 3:30:27I get the exact same thing so that's
- 3:30:30just some basic day-to-day functioning
- 3:30:33of using man to get information you
- 3:30:35should play around with different Man
- 3:30:37pages and look at the real contents in
- 3:30:40them and see how they differ from page
- 3:30:41to page
- 3:30:47the next source of Linux documentation
- 3:30:49is the new info system this is the new
- 3:30:52project standard documentation format
- 3:30:54which it prefers as an alternative to
- 3:30:57man the info system is basically free
- 3:31:00form and supports linked subsections
- 3:31:03functionally info resembles man in many
- 3:31:05ways however topics are connected using
- 3:31:07links even though its design predates
- 3:31:10the worldwide web information can be
- 3:31:12viewed through either a command line
- 3:31:14interface a graphical help utility
- 3:31:17printed or viewed online typing info
- 3:31:20with no arguments in a terminal window
- 3:31:22displays an index of available topics
- 3:31:25you can browse through the topic list
- 3:31:27using the regular movement Keys arrows
- 3:31:29page up and page down you can view help
- 3:31:32for a particular topic by typing info
- 3:31:34topic name the system then searches for
- 3:31:37the topic in all available info files
- 3:31:40some useful keys are Q to quit a for
- 3:31:42help and enter to select a menu item
- 3:31:48the topic which you view in an info page
- 3:31:50is called a node this table lists the
- 3:31:52basic keystrokes for moving between
- 3:31:54nodes nodes are essentially sections and
- 3:31:57subsections in the documentation you can
- 3:31:59move between nodes or view each node
- 3:32:02sequentially each node may contain menus
- 3:32:04and links subtopics or items items
- 3:32:08function like browser links and are
- 3:32:10identified by an aster at the beginning
- 3:32:13of the item name named items side menu
- 3:32:16are identified with double colons at the
- 3:32:19end of the item name items can refer to
- 3:32:21other nodes within the file or to other
- 3:32:25files let's gain some experience using
- 3:32:28the info command for
- 3:32:30documentation so suppose I type info
- 3:32:33make I will get information about the
- 3:32:35make utility used by all
- 3:32:39programmers and this takes me to the top
- 3:32:42of the info page or the head node if I
- 3:32:45want to look for a particular topic I
- 3:32:47can hit slash and you'll see at the
- 3:32:49bottom it's prompting me for search so
- 3:32:51I'll say
- 3:32:53example and it brought me down here to
- 3:32:55rule
- 3:32:57example if I just hit
- 3:33:00return I get that page now at the top
- 3:33:03you'll
- 3:33:04notice it says the not is root example
- 3:33:07the next one is Rule syntax so if I hit
- 3:33:10an
- 3:33:11N I get the rule syntax it says the next
- 3:33:14one is prere quisite types if I hit n
- 3:33:17again I get prerequisite
- 3:33:19types if I hit P I will go back to the
- 3:33:22previous one so I hit beat rule syntax
- 3:33:25if I want to look again for example I
- 3:33:28can just hit the slash again and it it's
- 3:33:31prompting me for the same string so I'll
- 3:33:34just hit return and I'm finding a later
- 3:33:37example about wild card examples and if
- 3:33:39I hit return I find out above that if I
- 3:33:42want to go all the way up I can hit a u
- 3:33:46it takes me to the top of section
- 3:33:494.4 I hit you again I'm at chapter 4 I
- 3:33:53hit youu again I'm at the very top of
- 3:33:55everything if I want to get information
- 3:33:58on the various key stroke bindings I can
- 3:34:01hit an H for help and you'll see in the
- 3:34:03bottom window where the focus is shifted
- 3:34:06to it lists all the possible key strokes
- 3:34:09and what they can
- 3:34:11do so that's basically how I would use
- 3:34:14info if I hit Q I am out of it and the
- 3:34:18rest you can learn by navigating within
- 3:34:21the info page of any topic that
- 3:34:23interests
- 3:34:28you another important source of Linux
- 3:34:30documentation is the use of the --el
- 3:34:33option most commands have an available
- 3:34:35short description which can be viewed
- 3:34:37using the --el or the DH option along
- 3:34:40with the command or application for
- 3:34:43example to learn more about the man
- 3:34:45command you can type man- dhel the d-el
- 3:34:49option is useful as a quick reference
- 3:34:51and it displays information faster than
- 3:34:53the man or info
- 3:34:58pages when running within a bash command
- 3:35:01shell some popular commands such as Echo
- 3:35:04and CD actually run especially built-in
- 3:35:07bash versions of the commands rather
- 3:35:09than the usual binaries found on the
- 3:35:11file system it's more efficient to do so
- 3:35:13as execution is faster because as fewer
- 3:35:16resources are used one should note that
- 3:35:18there can be some usually small
- 3:35:21differences in the two versions of the
- 3:35:23command to view a synopsis of these
- 3:35:26built-in commands you can simply type
- 3:35:29help as shown in this screenshot for
- 3:35:32these built-in commands help performs
- 3:35:34the same basic function as the DH and
- 3:35:37--el arguments perform for Standalone
- 3:35:44programs in addition to the Man pages
- 3:35:46the new info system and the help command
- 3:35:49there are other sources of Linux
- 3:35:51documentation some of some examples of
- 3:35:54which include desktop help system
- 3:35:56package documentation and online
- 3:36:03resources you have completed chapter 8
- 3:36:06let's summarize the key Concepts covered
- 3:36:09the main sources of Linux documentation
- 3:36:12are the Man pages new info and the help
- 3:36:15option and commands and a rich variety
- 3:36:17of online documentation sources the man
- 3:36:21utility searches formats and displays
- 3:36:24Man pages The Man pages provide in-depth
- 3:36:27documentation about programs and other
- 3:36:30topics about the system including
- 3:36:32configuration files system calls Library
- 3:36:36routines and the kernel the new info
- 3:36:39system was created by the new project as
- 3:36:42a as its standard documentation it's
- 3:36:45robust and it's accessible via command
- 3:36:47line web and graphical tools short
- 3:36:51descriptions for commands are usually
- 3:36:52displayed with the -8 or d-el argument
- 3:36:56you can type help at the command line to
- 3:36:58display a synopsis of built-in commands
- 3:37:01there are many other help resources both
- 3:37:03on your system and on the
- 3:37:09Internet by the end of this chapter you
- 3:37:11should be able to describe what a
- 3:37:14process is and distinguish between types
- 3:37:16of processes enumerate process
- 3:37:19attributes manage processes using PS and
- 3:37:23top understand the use of load averages
- 3:37:26and other process metrics manipulate
- 3:37:29processes by putting them in background
- 3:37:32and restoring them to foreground use at
- 3:37:35cron and sleep to schedule processes in
- 3:37:38the future or pause
- 3:37:42them a process is simply an instant of
- 3:37:45one or more related tasks threads
- 3:37:48executing on your computer it's not the
- 3:37:50same as a program or a command a single
- 3:37:53command may actually start several
- 3:37:55processes
- 3:37:56simultaneously some processes are
- 3:37:59independent of each other and others are
- 3:38:01related a failure of one process may or
- 3:38:04may not affect the others running on the
- 3:38:07on the system processes use many system
- 3:38:09resources such as memory CPU cycles and
- 3:38:13peripheral devices such as network cards
- 3:38:16hard drives printers and displays the
- 3:38:19operating system especially the kernel
- 3:38:21is responsible for allocating a proper
- 3:38:23share of these resources to each process
- 3:38:26and ensuring overall optimized system
- 3:38:32utilization a terminal window one kind
- 3:38:35of command shell is a process that runs
- 3:38:37as long as needed it allows users to
- 3:38:40execute programs and access resources in
- 3:38:42an interactive environment you can also
- 3:38:45run programs in the background which
- 3:38:47means they become detached from the
- 3:38:49shell processes can be of different
- 3:38:51types according to the task being
- 3:38:54performed here are some different
- 3:38:56process types along with their descript
- 3:38:58descriptions and
- 3:39:11examples a critical kernel function
- 3:39:14called the scheduler consistently shifts
- 3:39:16processes on and off the CPU sharing
- 3:39:18time according to the relative priority
- 3:39:21how much time is needed and how much has
- 3:39:23already been granted to a task when a
- 3:39:26process is in a so-called running state
- 3:39:29it means it's either currently executing
- 3:39:31instructions on a CPU or it's waiting to
- 3:39:33be granted a share of time a Time slice
- 3:39:36so it can execute all processes in this
- 3:39:39state reside on what is called a run que
- 3:39:42and on a computer with multiple CPUs or
- 3:39:44cores the there's a run que on each CPU
- 3:39:47or core however sometimes processes go
- 3:39:50into what is called a sleep State
- 3:39:53generally when they're waiting for
- 3:39:54something to happen before they can
- 3:39:56resume perhaps for the user to type
- 3:39:59something in this condition a process is
- 3:40:02said to be sitting in a weight queue
- 3:40:04there are some other less frequent
- 3:40:06process States especially when a process
- 3:40:08is terminating sometimes a child process
- 3:40:11completes but its parent process has not
- 3:40:14asked about its state amusingly such a
- 3:40:16process is said to be called a said to
- 3:40:18be in a zombie State it's not really
- 3:40:21alive but still shows up in the
- 3:40:22systems's list of
- 3:40:27processes at any given time there are
- 3:40:29always multiple processes being executed
- 3:40:32the operating system keeps track of them
- 3:40:34by assigning each of each a unique
- 3:40:36process ID or p number the p is used to
- 3:40:40track process State CPU usage me memory
- 3:40:43use precisely where resource are located
- 3:40:46in memory and other characteristics new
- 3:40:49PS are usually assigned in ascending
- 3:40:51order as processes are born thus P1
- 3:40:55denotes the init process and and su su
- 3:40:58succeeding processes are gradually
- 3:41:00assigned higher numbers the table
- 3:41:03explains the P ID types and their
- 3:41:05descriptions
- 3:41:16at some point one of your applications
- 3:41:18may stop working properly how do you
- 3:41:21eliminate it to terminate a process you
- 3:41:24can type kill Das Sig kill P ID or K-9
- 3:41:28PID note however you can only kill your
- 3:41:31own processes those belonging to another
- 3:41:33user are off limits unless you're
- 3:41:39root many users can access a system
- 3:41:42simultaneously and each user can run
- 3:41:45multiple processes the operating system
- 3:41:47identifies the user who starts the
- 3:41:49process by the real user ID or the ru ID
- 3:41:53assigned to the user the user who
- 3:41:55determines the access rights for the
- 3:41:57users is identified by the effective uid
- 3:42:01the euid the euid may or may not be the
- 3:42:04same as the
- 3:42:06ruid users can be categorized into
- 3:42:09various groups each group is identified
- 3:42:12by the real group ID or the RG ID the
- 3:42:15access rights of the group are
- 3:42:16determined by the effective group ID the
- 3:42:19EG ID each user can be a member of one
- 3:42:22or more groups most of the time we
- 3:42:25ignore these details and just talk about
- 3:42:27the user ID the U ID and the group ID
- 3:42:34GID at any given time many processes are
- 3:42:37running on the system however a CPU can
- 3:42:40actually accommodate only one task at a
- 3:42:43time just like a car can have only one
- 3:42:45driver at a time some processes are more
- 3:42:49important than others so Linux allows
- 3:42:50you to set and manipulate process
- 3:42:52priority higher priority processes get
- 3:42:55preferential access to the CPU the
- 3:42:58priority for a process can be set by
- 3:43:00specifying a nice value or niceness for
- 3:43:04the process for the the lower the nice
- 3:43:07value the higher the priority low values
- 3:43:09are assigned to important processes
- 3:43:11while high values are assigned to
- 3:43:13processes that can wait longer a process
- 3:43:15with a high nice value simply allows
- 3:43:17other processes to be executed first in
- 3:43:20Linux a nice value of -20 represents the
- 3:43:23highest priority and positive 19
- 3:43:25represents the lowest while this may
- 3:43:27sound backwards this convention goes
- 3:43:30back to the earliest days of Unix you
- 3:43:33can also assign a so-called realtime
- 3:43:35priority to time sensitive tasks such as
- 3:43:38controlling machines through a computer
- 3:43:40or collecting incoming data this is just
- 3:43:43a very high priority and is not to be
- 3:43:45confused with what is called hard real
- 3:43:48time which is conceptually different and
- 3:43:50has more to do with making sure a job
- 3:43:52gets completed within a very well-
- 3:43:54defined time
- 3:43:56window so now let's
- 3:43:59show how to see what the niceness or
- 3:44:02priority of a process is and how you can
- 3:44:04change it with the rice command or how
- 3:44:07you can do it actually from a graphical
- 3:44:09user
- 3:44:10interface so let's look at the uh
- 3:44:14processes and current screen with the PS
- 3:44:16command which we will discuss in detail
- 3:44:19later and we see this current bash shell
- 3:44:22is
- 3:44:243077 to see the priority I can run PS
- 3:44:27with the options
- 3:44:29LF and there you see
- 3:44:323077
- 3:44:34here is is uh here is the bash command
- 3:44:39and the niceness is zero so let's try to
- 3:44:42change the niess I can do rece
- 3:44:46um + 5
- 3:44:513077 and you see it did change the
- 3:44:54priority to five which I can see once
- 3:44:56again with the PS command it has made it
- 3:44:59five here notice that the child process
- 3:45:02I ran off there the command pslf also
- 3:45:05has a niess of five is there anything
- 3:45:08else I create in this shell will have
- 3:45:10that new
- 3:45:11niceness so this is a lower priority
- 3:45:14remember in inreasing the NCIS lowers
- 3:45:16the priority so now suppose I try to
- 3:45:20increase the priority by decreasing the
- 3:45:22NCIS to Minus
- 3:45:255 you notice it says I can't do that
- 3:45:28that's because only the super user or
- 3:45:30root is allowed to increase the priority
- 3:45:32of a process but if I type the same
- 3:45:35command over again with
- 3:45:37Su it work just fine and I can verify
- 3:45:40that once again with
- 3:45:42pslf and there you see it's set up to be
- 3:45:46minus5 now as well as the new
- 3:45:49um the new uh PS command that I issued
- 3:45:53now if I want to do this from a
- 3:45:54graphical utility I can run gnome system
- 3:45:57monitor I'll start from the command line
- 3:46:00here though I could get it uh from a
- 3:46:03menu and uh this is on the first
- 3:46:07possible screen here on
- 3:46:09processes so if I hear that was process
- 3:46:1330 uh that was process is 3077 it's
- 3:46:16right here and you notice it says
- 3:46:18priority High I could rightclick on
- 3:46:22there and I can go to change
- 3:46:24priority and I can just say
- 3:46:27low and now you see that it's low and if
- 3:46:31I get out of the graphical utility and I
- 3:46:35look at the niess
- 3:46:37again you see now the priority has come
- 3:46:40up to
- 3:46:42five I not the the niess of five so that
- 3:46:45means it's low priority
- 3:46:46again so that's how you can manipulate
- 3:46:49the priority of a process from the
- 3:46:51command line or from a graphical
- 3:46:56utility the load average is the average
- 3:46:59of the load number for a given period of
- 3:47:01time it takes into account processes
- 3:47:03that are actively running on a CPU
- 3:47:07considered runnable but waiting for a
- 3:47:09CPU to become available or sleeping I.E
- 3:47:12waiting for some kind of resource to
- 3:47:14become available the load average can be
- 3:47:16viewed by running W top or uptime the
- 3:47:20load average is displayed using three
- 3:47:22numbers such as 0.45 0.17 and 0.12 in
- 3:47:27this screenshot assuming our system is a
- 3:47:30single CPU system the three load average
- 3:47:32numbers are interpreted as follows 0.45
- 3:47:36means for the last minute the system has
- 3:47:38been 45% utilized on average .17 means
- 3:47:42for the last 5 minutes utilization has
- 3:47:44been 17% and 12 is for the last 15
- 3:47:48minutes utilization has been 12% if we
- 3:47:51saw a value of 1 in the second position
- 3:47:54that would imply the single CPU system
- 3:47:56was 100% utilized on average over the
- 3:47:58past 5 minutes this is good if we want
- 3:48:01to fully use a system value over one for
- 3:48:04a single CPU system implies that the
- 3:48:05system was over utilized there were more
- 3:48:08processes needing CPU than CPU was
- 3:48:11available if we had more than one CPU
- 3:48:13say a quad CP CPU system we would divide
- 3:48:16the load average numbers by the number
- 3:48:18of CPUs in this case for example seeing
- 3:48:21a 1 minute load average of 4.0 implies
- 3:48:24that the system as a whole was 100% 4id
- 3:48:28by 4 utilized during the last minute
- 3:48:30short-term increases are usually not a
- 3:48:33problem a high peak you see is likely a
- 3:48:35burst of activity not a new level for
- 3:48:38example at start up many processes start
- 3:48:40and then act and then activity settles
- 3:48:42down the high peak is seen in the five
- 3:48:45and 15 minute load averages it may be
- 3:48:47caused for
- 3:48:51concern Lin supports background and
- 3:48:54foreground job processing a job in this
- 3:48:57context is just a command launched from
- 3:48:59a terminal window foreground jobs run
- 3:49:02directly from the shell and when one
- 3:49:04foreground job is running other jobs
- 3:49:06need to wait for Shell access at least
- 3:49:09in that terminal window if using the the
- 3:49:11guey until it's completed this is fine
- 3:49:14when when jobs complete quickly but this
- 3:49:16can have an adverse effect if the
- 3:49:18current job is going to take a long time
- 3:49:21even several hours to complete in such
- 3:49:23cases you can run the job in the
- 3:49:25background and free the shell for other
- 3:49:28tasks the background job will be
- 3:49:30executed at lower priority which in turn
- 3:49:33will allow smooth execution of the
- 3:49:34interactive tasks and you can type other
- 3:49:37commands in the terminal window while
- 3:49:39the background job is running by default
- 3:49:42all jobs are executed in the foreground
- 3:49:44you can put a job in the background by
- 3:49:46suffixing and or the Amper sand to the
- 3:49:49command for example update DB Amper sand
- 3:49:52you can either use contrl Z to suspend a
- 3:49:55foreground job or contrl C to terminate
- 3:49:58a foreground job and you can always use
- 3:50:00the BG and FG commands to run a process
- 3:50:04in the background and foreground
- 3:50:09respectively the job utility displays
- 3:50:12all jobs running in the background the
- 3:50:15display shows the job ID State and
- 3:50:18command name as shown here jobs- L
- 3:50:21provides the same information as jobs
- 3:50:23and adds the P ID of the background jobs
- 3:50:27the background jobs are connected to the
- 3:50:30terminal window so if you log off the
- 3:50:33job utility will not show the one
- 3:50:34started from that
- 3:50:39window PS provides information about
- 3:50:42currently running processes keyed by P
- 3:50:44ID if you want a repetitive update of
- 3:50:47this status you can use top or other
- 3:50:50commonly installed variants such as htop
- 3:50:53or aop from the command line or invoke
- 3:50:56your distributions graphical system
- 3:50:58monitor application PS has many options
- 3:51:01for specifying exactly which tasks to
- 3:51:04examine what information to display
- 3:51:06about them and precisely what output
- 3:51:08format should be used without options PS
- 3:51:11will display all processes running under
- 3:51:14the current shell you can use the dasu
- 3:51:17option to display information of
- 3:51:19processes for a specified username the
- 3:51:22command ps- EF displays all the
- 3:51:25processes in the system in full detail
- 3:51:28the command ps- EF goes one step further
- 3:51:32and displays one line of information for
- 3:51:34every thread remember a process can
- 3:51:36contain multiple
- 3:51:40threads PS has another style of option
- 3:51:44specification
- 3:51:45which stems from the BSD variety of Unix
- 3:51:48where options are specified without
- 3:51:50proceeding dashes for example the
- 3:51:52command PS Au displays all processes of
- 3:51:55all users the command PS axo allows you
- 3:51:59to specify which attributes you want to
- 3:52:01view this screenshot shows a stample
- 3:52:03output of PS with the aux and axo
- 3:52:07qualifiers the PS utility is used very
- 3:52:10often at the command line to gather
- 3:52:12information about what is running on on
- 3:52:14the system about the various processes
- 3:52:17and tasks which were running what
- 3:52:19resource they were using what
- 3:52:21relationship they have to each other Etc
- 3:52:24if I just type PS without any arguments
- 3:52:27I get the processes which have been
- 3:52:30launched underneath this particular
- 3:52:32terminal window and uh in order to make
- 3:52:35it more interesting I have a background
- 3:52:37processes running I have a cat a aulus
- 3:52:40which is the file manager and Evin which
- 3:52:43is the PDF viewer I can get more
- 3:52:45information if I type ps-
- 3:52:48f which you see now also tells me the
- 3:52:52parent process ID so you notice bash has
- 3:52:57a process ID of
- 3:52:592942 and that's the parent process for
- 3:53:02both the cat and the Nautilus which I
- 3:53:04launched directly out of the shell as
- 3:53:07well as the PS command
- 3:53:09itself uh the evince command is actually
- 3:53:13has something else as a pair for
- 3:53:15complicated reasons having to do with
- 3:53:17how the gnome shell runs if I want to
- 3:53:20get a different piece of information I
- 3:53:22can do ps-
- 3:53:26L and now uh I am also seeing
- 3:53:30information in these two columns about
- 3:53:32the priority and the niceness which on
- 3:53:36most Linux systems is just a a a
- 3:53:38numerical shift okay from uh a neutral
- 3:53:42niess of zero means the default priority
- 3:53:45of 80 which is what all normal processes
- 3:53:48start out
- 3:53:49with okay now I can do more than this if
- 3:53:53I want to give additional arguments so I
- 3:53:55do
- 3:53:57ps-
- 3:53:59EF uh this will tell me about all
- 3:54:02processes on a system and let me type it
- 3:54:05into less so it doesn't go too quickly
- 3:54:08so you can see this is everything which
- 3:54:09is actually running on my system you'll
- 3:54:12notice that the first bunch processes uh
- 3:54:15in this rather long list all have these
- 3:54:17square brackets around them that means
- 3:54:20they were not started by a user program
- 3:54:23they're running inside the kernel to do
- 3:54:25various kinds of uh background tasks
- 3:54:29that run in the kernel all the time
- 3:54:30handle moving things from one CPU to
- 3:54:33another for instance and all kinds of
- 3:54:35other things uh and you see they have
- 3:54:39different priorities uh they minus 20
- 3:54:42here uh minus 20 there that means
- 3:54:45they're higher priorities okay it's kind
- 3:54:48of backwards the lower the priority
- 3:54:50number here the higher the priorities is
- 3:54:53if I page down to the bottom I will
- 3:54:55eventually get to tests which are not
- 3:54:58running inside the kernel which are uh
- 3:55:01running for instance uh under my name
- 3:55:04here Coupe and so you see these are the
- 3:55:07actual user processes and uh they
- 3:55:09they're quite a bit different now one
- 3:55:12reason the PS command can be a little
- 3:55:15confusing is that there are different
- 3:55:18kinds of options those which have a dash
- 3:55:20and which those which do not so for
- 3:55:22instance ps- e is different than PS
- 3:55:26space e uh one commonly set of options
- 3:55:30is PS aux without a dot
- 3:55:33dash and there you see uh one nice
- 3:55:37additional piece of information is the
- 3:55:39percentage of CPU being used and of
- 3:55:42course uh there isn't much going on in
- 3:55:44the system right now so that tends to be
- 3:55:47zero so you can customize what the
- 3:55:51output of the PS command is uh if you
- 3:55:55look at the man page for PS you'll see
- 3:55:57there's ways to have it print out only
- 3:55:59the columns that you want if you want to
- 3:56:01produce some customized reports Etc but
- 3:56:04a standard Linux system administrator
- 3:56:07probably uses PS every day for one thing
- 3:56:09or another
- 3:56:14PS3 displays the processes running on
- 3:56:17the system in the form of a tree diagram
- 3:56:19showing the relationship between a
- 3:56:21process and its parent process and any
- 3:56:24other processes that it created repeated
- 3:56:26entries of a process are not displayed
- 3:56:29and threads are displayed in curly
- 3:56:34braces while a static view of what the
- 3:56:37system is doing is useful monitoring the
- 3:56:40system performance live over time is
- 3:56:42also valuable one of option would be to
- 3:56:45run PS at regular intervals say every
- 3:56:48few seconds a better alternative is to
- 3:56:51use top to get constant realtime updates
- 3:56:54until you exit by typing q. toop this
- 3:56:58clearly highlights which processes are
- 3:57:00consuming the most CPU cycles and memory
- 3:57:03using appropriate commands from within
- 3:57:06top the first line of the top output
- 3:57:08displays a quick summary of what is
- 3:57:10happening in the system including how
- 3:57:13long the system has been up how many
- 3:57:15users are logged on and what is the load
- 3:57:19average the load average determines how
- 3:57:21busy the system is load average of 1.0
- 3:57:25per CPU indicates a fully subscribed but
- 3:57:27not overloaded system if the load
- 3:57:29average goes above the value it
- 3:57:31indicates that the processes are
- 3:57:32competing for CPU time if the load
- 3:57:35average is very high it might indicate
- 3:57:37that the system is having a problem such
- 3:57:39as a runaway process a process in a
- 3:57:42nonresponding state the second line of
- 3:57:45the top output displays the total number
- 3:57:48of processes the number of running
- 3:57:51sleeping stopped and zombie processes
- 3:57:54comparing the number of running
- 3:57:56processes with the load average helps
- 3:57:58determine if the system has reached its
- 3:58:01capacity or perhaps a particular user is
- 3:58:04running too many processes the stopped
- 3:58:07processes should be examined to see if
- 3:58:09everything is running correctly the
- 3:58:11third line of the top output indic
- 3:58:14indicates how the CPU time is being
- 3:58:16divided between the users and the kernel
- 3:58:19by displaying the percentage of CPU time
- 3:58:21used for each the percentage of user
- 3:58:24jobs running at a lower priority
- 3:58:27niceness dni is then listed idle mode or
- 3:58:32ID should be low if the load average is
- 3:58:34high and vice versa the percentage of
- 3:58:36jobs waiting wa for Io is listed
- 3:58:39interrupts include the percentage of
- 3:58:42Hardware or hi vers software interrupts
- 3:58:45SI steel time St is generally used with
- 3:58:49virtual machines which has some of its
- 3:58:51idle CPU time taken for other uses the
- 3:58:55fourth and fifth lines of the top output
- 3:58:58indicate memory usage which is divided
- 3:59:01in two categories physical memory or Ram
- 3:59:06displayed on line 4 and swap space
- 3:59:09displayed on line five both categories
- 3:59:12display total memory used memory and
- 3:59:15free space you need to monitor memory
- 3:59:19usage very carefully to ensure good
- 3:59:21system performance once the physical
- 3:59:24memory is exhausted the system starts
- 3:59:27using swap space or temporary storage
- 3:59:30space on the hard drive as an extended
- 3:59:33memory pool and since accessing disk is
- 3:59:36much slower than access accessing memory
- 3:59:39this will negatively affect the system
- 3:59:41performance if the system starts using
- 3:59:44swap often you can add more swap space
- 3:59:47however adding more physical memory
- 3:59:49should also be considered each line in
- 3:59:52the process list of the top output
- 3:59:55displays information about a process by
- 3:59:57default processes are ordered by highest
- 4:00:00CPU usage the following information
- 4:00:03about each process is displayed process
- 4:00:05identification number P ID process owner
- 4:00:09the user priority PR and nice values ni
- 4:00:14virtual physical and shared memory
- 4:00:17status s a percentage of CPU and memory
- 4:00:22used execution time the time plus and
- 4:00:26command besides reporting information
- 4:00:28top can be utilized interactively for
- 4:00:31monitoring and controlling processes
- 4:00:33while top is running in a terminal
- 4:00:35window you can enter single letter
- 4:00:37commands to change its behavior for
- 4:00:39example you can view the top ranked
- 4:00:41processes based on CPU or memory usage
- 4:00:45if needed you can alter the priorities
- 4:00:47of running processes or you can stop or
- 4:00:50kill a process this table lists what
- 4:00:53happens when pressing various Keys when
- 4:00:55running
- 4:01:01top the top utility is used to
- 4:01:04interactively monitor what processes and
- 4:01:07tests are doing on your system to start
- 4:01:10it up all you have to do is type top
- 4:01:14and it will refresh itself at some
- 4:01:17interval of I think by default two or 3
- 4:01:19seconds it's easily changed uh it shows
- 4:01:23you standard information about each
- 4:01:25process similar to what you get with the
- 4:01:27PS command such as the process ID the
- 4:01:30user the priority and niceness some
- 4:01:33information about how the memory is
- 4:01:35being used by the process U the state as
- 4:01:38being meaning sleeping for instance and
- 4:01:41by default it is sorted by CPU time and
- 4:01:45then there's also memory the total time
- 4:01:47and what the actual command is the lines
- 4:01:50at the top are are have been designed
- 4:01:53over the years to convey a lot of
- 4:01:54information so in the first one you see
- 4:01:56how long the system has been up how many
- 4:01:59users there are the load average or uh
- 4:02:02or rolling averages of how much time has
- 4:02:04been spent in the last I believe 1
- 4:02:07minute 5 minutes Etc there are currently
- 4:02:10295 tasks running on the system but
- 4:02:13really only one is is running the others
- 4:02:14are
- 4:02:15sleeping um and this shows you the CPU
- 4:02:19time percentages used by the user
- 4:02:21processes by the system by so-called
- 4:02:24nice
- 4:02:25processes um and then uh
- 4:02:28idle and uh how many would be waiting
- 4:02:31how many are high priority and and and
- 4:02:33some other details like that then you
- 4:02:35have basic information about the memory
- 4:02:37such how much is being used how much
- 4:02:39swap there is available being used how
- 4:02:42much is in cash Etc if I type the letter
- 4:02:45one I get statistics for each CPU
- 4:02:49instead of uh just The Amalgamated total
- 4:02:52and that can be rather useful one will
- 4:02:55take it back again if I hit H I get a
- 4:02:59listing of what the possible keys I can
- 4:03:02hit are and what they do uh I wouldn't
- 4:03:04make sense to try to run through much of
- 4:03:06that here but I highly recommend that
- 4:03:08you run top and play with these
- 4:03:10different keys and try to understand
- 4:03:12what kind of information you can
- 4:03:14extract well top is how you can do it
- 4:03:17from the command line and if you hit q
- 4:03:19that will kill the program you can get
- 4:03:22similar information by going to your
- 4:03:23menus and finding system
- 4:03:26monitor and then uh let me drag that
- 4:03:28over to this
- 4:03:30screen uh the processes paint on here is
- 4:03:33pretty much the same as tops got the
- 4:03:35same information it's easier to do
- 4:03:37things that could Resort because I could
- 4:03:39just click on memory and get it sorted
- 4:03:41by how much memory is used by clicking
- 4:03:43again I'll get it in descending order uh
- 4:03:47priorities CPU Etc you can also once
- 4:03:51again change the priority of processes
- 4:03:53you can kill them Etc so uh you can do a
- 4:03:56lot and if you want to see the graph
- 4:03:58just click on resources you can see
- 4:04:00what's going with a constantly redrawn
- 4:04:03graph and with file systems you can see
- 4:04:06um how much of your file systems on the
- 4:04:08computer are actually full uh where
- 4:04:11they're mounted Etc so that's a brief
- 4:04:14explanation of top and some related
- 4:04:20issues suppose you need to perform a
- 4:04:22task on a specific day sometime in the
- 4:04:24future however you know you will be away
- 4:04:26from the machine on that day how will
- 4:04:29you perform the task you can use the at
- 4:04:32utility program to execute any
- 4:04:34non-interactive command at a specified
- 4:04:37time as Illustrated in this screenshot
- 4:04:44Kon is a time-based scheduling utility
- 4:04:47program it can launch routine background
- 4:04:50jobs at specific times and or days on an
- 4:04:54ongoing basis KRON is driven by a
- 4:04:57configuration file called the cron table
- 4:05:01which contains the various shell
- 4:05:02commands that need to be run at the
- 4:05:05properly scheduled times there are both
- 4:05:07systemwide cron tab files and individual
- 4:05:11user-based ones each line of the Chron
- 4:05:13tab file represents a job and is
- 4:05:15composed of a so-called Chron expression
- 4:05:18followed by a shell command to execute
- 4:05:21typing Chron t-e will open the Chron tab
- 4:05:24Editor to edit existing jobs or to
- 4:05:26create new jobs each line of the cron
- 4:05:28tab file will contain six
- 4:05:36fields and here are some examples
- 4:05:53sometimes a command or job must be
- 4:05:54delayed or suspended suppose for example
- 4:05:57an application has read the and process
- 4:06:00the contents of a data file and then
- 4:06:02needs to save a report on a backup
- 4:06:05system if the backup system is currently
- 4:06:07busy or not available the application
- 4:06:10can be made to sleep or wait until it
- 4:06:13can complete its work such a delay might
- 4:06:16might be to mount the backup device and
- 4:06:18prepare it for writing sleep suspends
- 4:06:21execution for at least the specified
- 4:06:23period of time which can be given as the
- 4:06:25number of seconds the default minutes
- 4:06:28hours or days after that time has passed
- 4:06:32or an interrupting signal has been
- 4:06:33received execution will resume the
- 4:06:36syntax is sleep and the number and then
- 4:06:38the suffix where the suffix may be S for
- 4:06:41seconds the default m for minutes H for
- 4:06:44hours or D for days sleep and at or at
- 4:06:49are quite different sleep delays
- 4:06:51execution for a specific period while at
- 4:06:55starts execution at a later
- 4:07:01time youve completed chapter nine let's
- 4:07:04summarize the key Concepts covered
- 4:07:07processes are used to perform various
- 4:07:09tasks on the system processes can be
- 4:07:12single-threaded or multi-threaded
- 4:07:15processes can be of different types such
- 4:07:17as interactive and
- 4:07:19non-interactive every process has a
- 4:07:21unique identifier the PID to enable the
- 4:07:23operating system to keep track of it the
- 4:07:26nice value or niess can be used to set
- 4:07:29priority PS provides information about
- 4:07:32the currently running processes you can
- 4:07:35use top to get constant real time
- 4:07:37updates about overall system performance
- 4:07:40as well as information about the
- 4:07:41processes running on the system
- 4:07:44load average indicates the amount of
- 4:07:46utilization the system is under at
- 4:07:49particular times Linux supports
- 4:07:51background and foreground processing for
- 4:07:54a job at executes any non-interactive
- 4:07:58command at a specified time KRON is used
- 4:08:02to schedule tasks that need to be
- 4:08:03performed at regular
- 4:08:09intervals by the end of this chapter you
- 4:08:11should be able to explore explore the
- 4:08:14file system and its hierarchy explain
- 4:08:17the file system architecture compare
- 4:08:19files and identify different file types
- 4:08:22and backup and compress
- 4:08:27data in Linux and all Unix like
- 4:08:30operating systems it is often said
- 4:08:32everything is a file or at least at
- 4:08:35least it's treated as such this means
- 4:08:38whenever you are dealing with normal
- 4:08:39data files and documents or with devices
- 4:08:42such as sound card cards and printers
- 4:08:44you interact with them through the same
- 4:08:46kind of input output operations this
- 4:08:49simplifies things you open a file and
- 4:08:51perform normal operations like reading
- 4:08:53the file and writing on it which is one
- 4:08:56reason why text editors which you will
- 4:08:57learn about in in an upcoming section
- 4:08:59are so important on many systems
- 4:09:02including Linux the file system is
- 4:09:05structured like a tree the tree is
- 4:09:07usually portrayed as inverted and starts
- 4:09:10at what is most often called the root
- 4:09:12directory
- 4:09:13which marks the beginning of the
- 4:09:15hierarchial file system and is also
- 4:09:18sometimes referred to as the trunk or
- 4:09:20simply denoted by a slash the root
- 4:09:23directory is not the same as the root
- 4:09:25user the hierarchial file system also
- 4:09:28contains other elements in the path or
- 4:09:30directory names which are separated by
- 4:09:32forward slashes as in user
- 4:09:35Spinx where the last element is the
- 4:09:38actual file name in this section you
- 4:09:40will learn about some basic concepts
- 4:09:42including the file system hierarchy as
- 4:09:45well as about disk
- 4:09:50partitions Linux supports a number of
- 4:09:53native file system types expressly
- 4:09:56created by Linux developers such as ext3
- 4:10:01ext4 uh squash fs and
- 4:10:04btrfs it also offers implementations of
- 4:10:07file systems used on other alien
- 4:10:10operating systems such as those from
- 4:10:12Windows SGI IBM or Mac OS many older
- 4:10:17Legacy file systems such as fat are also
- 4:10:25supported each file system on a Linux
- 4:10:28system occupies a disk partition
- 4:10:31partitions help to organize the contents
- 4:10:33of diss according to the kind and use of
- 4:10:36the data contained for example important
- 4:10:38programs required to run the system are
- 4:10:40often kept on a separate partition known
- 4:10:44as root or slash this is a separate
- 4:10:47partition than the one that contains
- 4:10:48files owned by regular users of the
- 4:10:50system in slome in addition temporary
- 4:10:53files created and destroyed during the
- 4:10:55normal operation of Linux may be located
- 4:10:58on dedicated partitions one advantage of
- 4:11:01this kind of isolation by type and
- 4:11:03variability is that when all available
- 4:11:06space on a particular partition is
- 4:11:08exhausted the system may still operate
- 4:11:11normally this picture shows the use of
- 4:11:14the G parted utility which displays the
- 4:11:16partition layout on a system which has
- 4:11:18four operating systems on it R eight8 C
- 4:11:21os7 Ubuntu and
- 4:11:26Windows before you can start using a
- 4:11:29file system you need to mount it on the
- 4:11:31file system tree at the mount point this
- 4:11:34is simply a directory which may or may
- 4:11:36not be empty where the file system is to
- 4:11:38be grafted on sometimes you may need to
- 4:11:41create the directory if if it does not
- 4:11:43already exist but keep in mind this
- 4:11:46warning if you mount a file system on a
- 4:11:48non-empty directory the former contents
- 4:11:50of that directory are covered up and not
- 4:11:53accessible until the file system is
- 4:11:55unmounted thus Mount points are usually
- 4:11:58empty
- 4:11:59directories the mount command is used to
- 4:12:01attach a file system which can be local
- 4:12:04to the computer or on a network
- 4:12:06somewhere within the file system tree
- 4:12:09the basic arguments are the device node
- 4:12:12and the mount point for example studo
- 4:12:15Mount or /dev sda5 slome will attach the
- 4:12:19file system contained in the dis
- 4:12:21partition associated with the /dev sda5
- 4:12:24device node into the file system tree at
- 4:12:27the /home mount point there are other
- 4:12:30ways to specify the partition other than
- 4:12:32the device node such as using the dis
- 4:12:33label or The UU ID to unmount the
- 4:12:36partition the command would be pseudo
- 4:12:38umount slome note the command is umount
- 4:12:42not unmount
- 4:12:43only a root user has the privilege to
- 4:12:46run these commands unless the system has
- 4:12:48been otherwise configured if you want it
- 4:12:51to be automatically available every time
- 4:12:53the system starts up you need to edit
- 4:12:55the /c/ fstab accordingly looking at
- 4:12:59this file will show you the
- 4:13:00configuration of all preconfigured file
- 4:13:03systems man fstab will display how this
- 4:13:06file is used and how to configure it
- 4:13:08executing Mount without any arguments
- 4:13:10will show all presently mounted file
- 4:13:12system systems the command df- th dis
- 4:13:16free will display information about
- 4:13:17mounted file systems including the file
- 4:13:19system type and usage statistics about
- 4:13:22currently used and available
- 4:13:27space it's often necessary to share data
- 4:13:29across physical systems which may be
- 4:13:32either in the same location or anywhere
- 4:13:34that can be reached by the internet a
- 4:13:36network or distributed file system may
- 4:13:40have all data on one machine or have it
- 4:13:42spread out out on more than one network
- 4:13:44node a variety of different file systems
- 4:13:47can be used locally on the individual
- 4:13:50machines a network file system can be
- 4:13:52thought of as a grouping of lower level
- 4:13:55file systems of varying types many
- 4:13:58system administrators Mount remote users
- 4:14:00home directories on a server in order to
- 4:14:02give them access to the same files and
- 4:14:04configuration files across multiple
- 4:14:06client systems this allows the users to
- 4:14:09log into different computers you still
- 4:14:11have access to the same files and
- 4:14:13resources the most common such file
- 4:14:15systems is named simply NFS the network
- 4:14:18file system it has a very long history
- 4:14:21and was first developed by Sun
- 4:14:22Microsystems another common
- 4:14:24implementation is cifs also termed Samba
- 4:14:28which has Microsoft
- 4:14:33roots in this section you will learn to
- 4:14:35identify and differentiate between the
- 4:14:37most important directories found in
- 4:14:39Linux we start with ordinary users home
- 4:14:42directory space each user has a home
- 4:14:45directory usually placed under the slome
- 4:14:48the/ root directory on Modern Linux
- 4:14:51systems is no more than the home
- 4:14:53directory of the root user or super user
- 4:14:56or system administrator account on
- 4:14:58multi-user systems the slome directory
- 4:15:01infrastructure is often mounted as a
- 4:15:04separate file system on its own
- 4:15:05partition or even exported remotely on a
- 4:15:08network through NFS sometimes you may
- 4:15:11group users based on their department or
- 4:15:13function you can then create
- 4:15:15subdirectories under the slome directory
- 4:15:17for each of these groups for example a
- 4:15:20school May organized slome with
- 4:15:22something like the following slome facty
- 4:15:25slome staff slome students the /bin and
- 4:15:28SL sbin
- 4:15:32directory the /bin directory contains
- 4:15:35executable binaries essential commands
- 4:15:38used to boot the system and essential
- 4:15:40commands required by all system users
- 4:15:42such as cat CP LS MV PS and RM likewise
- 4:15:46the/ sbin directory is intended for
- 4:15:49essential binaries related to system
- 4:15:51administration such as FSS and IP to
- 4:15:55view of list of these programs you can
- 4:15:56type
- 4:15:58lsbs spin commands that are not
- 4:16:00essential for the system to boot or
- 4:16:03operate in single user mode are placed
- 4:16:05in the/ user bin and/ userin directories
- 4:16:10historically this was done so/ user
- 4:16:12could be mounted as a separate file
- 4:16:14system that could be mounted at a later
- 4:16:15stage of system startup or even over a
- 4:16:17network however nowadays most find this
- 4:16:20distinction is obsolete in fact many
- 4:16:23distributions have been discovered to be
- 4:16:24unable to boot with this separation as
- 4:16:27this modality had not been used or
- 4:16:30tested for a long time thus on some of
- 4:16:32the newest Linux distributions sluser
- 4:16:35spin and/ spin are actually just
- 4:16:38symbolically linked together as are/
- 4:16:41userin and/ spin
- 4:16:46certain file systems like the one
- 4:16:48mounted at slpr are called pseudo file
- 4:16:51systems because they have no permanent
- 4:16:53presence anywhere on the disk the slpr
- 4:16:56file system contains virtual files files
- 4:16:59that only exist in memory that permit
- 4:17:01viewing constantly changing kernel data
- 4:17:04slpr contains files and directories that
- 4:17:06mimic kernel structures and
- 4:17:08configuration information it does not
- 4:17:11contain real files but onetime system
- 4:17:13information IG system memory devices
- 4:17:16mounted Hardware configuration Etc some
- 4:17:19important entries in SL proc are the
- 4:17:23following slpr has subdirectories as
- 4:17:26well including the following the first
- 4:17:29example shows there is a directory for
- 4:17:32every process running on a system which
- 4:17:34contains Vital Information about it the
- 4:17:37second example shows a virtual directory
- 4:17:40that contains a lot of information about
- 4:17:42the entire system in particular its
- 4:17:44hardware and configuration the slpr file
- 4:17:48system is very useful because the
- 4:17:50information it reports is gathered only
- 4:17:52as needed and never needs storage on the
- 4:17:58dis the /dev directory contains device
- 4:18:01nodes a type of pseudo file used by most
- 4:18:05hardware and software devices except for
- 4:18:08network devices this directory is empty
- 4:18:10on the dis partition when it's not
- 4:18:12mounted and also contains entries which
- 4:18:14are created by the UDF system which
- 4:18:17creates and manages device nodes on
- 4:18:19Linux creating them dynamically when
- 4:18:22devices are found the /dev directory
- 4:18:25contains items such as /dev sda1 the
- 4:18:29first partition on the first hard disk
- 4:18:31/d lp1 the second printer SL da random a
- 4:18:35source of random
- 4:18:39numbers the SL ofar directory contains
- 4:18:42files that are expected to change in
- 4:18:44size and content as the system is
- 4:18:46running VAR stands for a variable such
- 4:18:49as the entries in the following
- 4:18:50directories system log files /ar log and
- 4:18:54packages and database files like slf
- 4:18:56farli print cues /ar SLS poool and
- 4:19:00temporary files /var TMP the /var
- 4:19:03directory may be put on its own file
- 4:19:06system so that growth of the files can
- 4:19:08be accommodated and any exploding file
- 4:19:10sizes do not fatally affect the system
- 4:19:13network service directories such asfar
- 4:19:16FP the FTP Service inar www the HTTP web
- 4:19:22service are also found under SLB
- 4:19:27bar the SLC directory is the home for
- 4:19:31system config configuration files it
- 4:19:34contains no binary programs although
- 4:19:36there are some executable scripts for
- 4:19:38example /c/ resolve. conf tells the
- 4:19:41system where to go on the network to
- 4:19:43obtain host to IP address mappings DNS
- 4:19:47files like password Shadow and group for
- 4:19:49managing user accounts are found in the
- 4:19:51SLC directory well some distributions
- 4:19:54have historically had their own
- 4:19:55extensive infrastructure under
- 4:19:58SLC with the Adent of system MD there's
- 4:20:01much more uniformity among distributions
- 4:20:03today note that/ Etc is for systemwide
- 4:20:06configuration files and only the super
- 4:20:08user can modify files there user
- 4:20:11specific configuration files are always
- 4:20:13found under their home
- 4:20:18directory the SL boot directory contains
- 4:20:20the few essential files needed to boot
- 4:20:22the system for every alternative kernel
- 4:20:24installed on the system there are these
- 4:20:26four files VM Li nuz which is the
- 4:20:29compressed Linux kernel required for
- 4:20:32booting in it Ram FS which is the
- 4:20:34initial Ram file system required for
- 4:20:36booting sometimes called init Rd not
- 4:20:39init Ram fs and then config the kernel
- 4:20:42configuration file only used for
- 4:20:44debugging and bookkeeping and finally
- 4:20:46system.map which is the kernel symbol
- 4:20:49table only used for debugging each of
- 4:20:51these files has a kernel version
- 4:20:53appended to its name the grub files such
- 4:20:56as boot SLG grub grub.com orboot grub2
- 4:21:01grub2 CFG are also found under the/ boot
- 4:21:05directory this screenshot shows an
- 4:21:07example listing of the/ boot directory
- 4:21:09taken from the real system that has
- 4:21:11multiple installed kernels including
- 4:21:14both distribution supplied and custom
- 4:21:16compiled ones names will vary and things
- 4:21:19will tend to look somewhat different on
- 4:21:21a different
- 4:21:25distribution SL Li contains libraries
- 4:21:28which is which are common code shared by
- 4:21:30applications and needed for them to run
- 4:21:32it contains libraries for essential
- 4:21:34programs in SLB and slin these Library
- 4:21:38file names either start with LD or lib
- 4:21:41here's an example
- 4:21:43most of these are what is known as
- 4:21:45dynamically loaded libraries also known
- 4:21:48as shared libraries or shared objects on
- 4:21:51some Linux distributions there exist a
- 4:21:53SL lib64 directory containing 64-bit
- 4:21:56libraries while SL lib contains 32-bit
- 4:21:59versions on re recent Linux
- 4:22:02distributions you can find this just
- 4:22:05like for /bin and/ sbin the directories
- 4:22:08just point to the those under SL user
- 4:22:11kernel modules or colel code often
- 4:22:13device drivers that can be loaded and
- 4:22:15unloaded without restarting the system
- 4:22:18are located in/ li/ modules SL and then
- 4:22:22the kernel version
- 4:22:26number one often uses removable media
- 4:22:29such as USB driv CDs and DVDs to make
- 4:22:32the material accessible through the
- 4:22:33regular file system it has to be mounted
- 4:22:36at a convenient location most Linux
- 4:22:38systems are configured so any removable
- 4:22:40media are automatically mounted when the
- 4:22:42system notices something has been
- 4:22:44plugged in while historically this was
- 4:22:46done under the/ media directory modern
- 4:22:49Linux distributions place these Mount
- 4:22:51points under the/ run directory for
- 4:22:54example a USB pin drive with a label my
- 4:22:57USB drive for a usern named student will
- 4:23:00be mounted atrun media studenty USB
- 4:23:03drive the SL Mount directory has been
- 4:23:06used since the early days of Unix for
- 4:23:08temporarily mounting file systems these
- 4:23:11can be those on removal able media but
- 4:23:13more often they might be Network file
- 4:23:15systems which are not normally mounted
- 4:23:17or these can be temporary partitions or
- 4:23:19so-called loop back file systems which
- 4:23:22are files which pretend to be
- 4:23:27partitions here are some additional
- 4:23:29directories to be found under the root
- 4:23:40directory the SL user directory tree
- 4:23:43contains theoretically non-essential
- 4:23:45programs and scripts in the sense that
- 4:23:47they should not be needed to initially
- 4:23:49boot the system and has at least the
- 4:23:51following subdirectories shown
- 4:24:00here now that you know about the file
- 4:24:03system and its structure let's learn how
- 4:24:05to manage files and directories diff is
- 4:24:08used to compare files and directories
- 4:24:11this often used utility program has many
- 4:24:14useful options including the ones you
- 4:24:16see
- 4:24:21here to compare two files at the command
- 4:24:23prompt type diff and options file name
- 4:24:27one file name two diff is meant to be
- 4:24:29used for text files for binary files one
- 4:24:32can use CMP in this section you will
- 4:24:34learn additional methods for comparing
- 4:24:36files and how to apply patches to files
- 4:24:43you can compare three files at once
- 4:24:45using diff 3 which uses one file as the
- 4:24:47reference basis for the other two for
- 4:24:50example suppose you and a coworker both
- 4:24:52have made modifications to the same file
- 4:24:54working at the same time independently
- 4:24:57diff 3 can show the differences based on
- 4:25:00the common file you both started with
- 4:25:03here's the Syntax for diff
- 4:25:053 this graphic shows the use of diff 3
- 4:25:09many modifications to source code and
- 4:25:11configuration files are distributed
- 4:25:13utilizing patches which are applied not
- 4:25:16surprisingly with the patch program a
- 4:25:18patch file contains the Deltas or
- 4:25:20changes required to update an older
- 4:25:22version of a file to the new one the
- 4:25:25patch files are actually produced by
- 4:25:26running diff with the correct options as
- 4:25:29in this command Distributing just the
- 4:25:32patch is more concise and efficient than
- 4:25:34Distributing the entire file for example
- 4:25:36if only one line needs to change in a
- 4:25:39file that contains 1,000 lines the patch
- 4:25:41file will be just a few a few lines long
- 4:25:44to apply a patch you can just do either
- 4:25:46of these two methods the first usage is
- 4:25:49more common as it's often used to apply
- 4:25:51changes to an entire directory tree
- 4:25:54rather than just one file as in the
- 4:25:56second example to understand the use of
- 4:25:58the- P1 option and many others see the
- 4:26:01man page for
- 4:26:05patch in Linux a file's extension often
- 4:26:08does not categorize it the way it might
- 4:26:10in other operating system systems one
- 4:26:13cannot assume that a file name file.txt
- 4:26:15is a text file and not an executable
- 4:26:18program in Linux a file name is
- 4:26:20generally more meaningful to the user of
- 4:26:22the system than the system itself in
- 4:26:24fact most applications directly examine
- 4:26:26a file's contents to see what kind of
- 4:26:28app object it is rather than relying on
- 4:26:31an extension this is very different from
- 4:26:33the way Windows handles file names where
- 4:26:35a file name ending in. exe for example
- 4:26:39represents an executable binary file the
- 4:26:41real nature nature of a file can be
- 4:26:43determined by using the file utility for
- 4:26:46the file names given as arguments it
- 4:26:48examines the contents and certain
- 4:26:51characteristics to determine whether the
- 4:26:53files are plain text shared libraries
- 4:26:56executable programs scripts or something
- 4:27:02else there are many ways you can back up
- 4:27:04data or even your entire system basic
- 4:27:06ways to do so include the use of simple
- 4:27:09coping with CP and use of the more
- 4:27:11robust rsync both can be used to
- 4:27:14synchronize entire directory trees
- 4:27:17however our sync is more efficient
- 4:27:18because it checks if the file being
- 4:27:20copied already exists if the file exists
- 4:27:24and there is no change in size or
- 4:27:26modification time our sync will avoid an
- 4:27:28unnecessary copy and save time
- 4:27:31furthermore because R sync copies only
- 4:27:33the parts of the file that have actually
- 4:27:34changed it can be very fast CP can only
- 4:27:38copy files two and from destinations on
- 4:27:40the local machine but rsync can also be
- 4:27:43used to copy files from one machine to
- 4:27:45another locations are designated in the
- 4:27:48Target colon path form where Target can
- 4:27:51be the form of someone at host and the
- 4:27:54someone at part is optional and used if
- 4:27:56the remote user is different from the
- 4:27:58local user our sync is very efficient
- 4:28:01when recursively copying One Directory
- 4:28:03tree to another because only the
- 4:28:05differences are transmitted over the
- 4:28:07network one often synchronizes the
- 4:28:10destination directory tree with with the
- 4:28:12origin using the dasr option to
- 4:28:15recursively walk down the directory tree
- 4:28:17copying all files and directories below
- 4:28:19the one listed as the
- 4:28:24source our sync is a very powerful
- 4:28:26utility for example a very useful way to
- 4:28:29back up a project directory might be to
- 4:28:31use this
- 4:28:35command note that rsync can be very
- 4:28:38destructive accidental misuse can do a
- 4:28:41lot of harm to data and programs by
- 4:28:43inadvertently copying changes to where
- 4:28:45they are not wanted take care to specify
- 4:28:48the correct options and paths it's
- 4:28:50highly recommended that you first test
- 4:28:52your rsync command using the dash
- 4:28:54dry-run option to ensure that it
- 4:28:57provides the results that you want to
- 4:28:59use rsync at the command prompt type
- 4:29:01rsync source file destination file where
- 4:29:04either file can be on the local machine
- 4:29:06or on a network machine the contents of
- 4:29:09source file will be copied to
- 4:29:10destination file a good combination of
- 4:29:13options is shown
- 4:29:16here the file data is often compressed
- 4:29:19to save dis space and reduce the time it
- 4:29:21takes to transmit files over networks
- 4:29:24Linux uses a number of methods to
- 4:29:26perform this compression including
- 4:29:32these these techniques vary in the
- 4:29:35efficiency of the compression or how
- 4:29:37much space is saved and how long they
- 4:29:39take to compress generally the more
- 4:29:41efficient techniques take longer
- 4:29:43decompression time does not vary as much
- 4:29:46across different
- 4:29:50methods you have completed chapter 10
- 4:29:54let's summarize the key Concepts covered
- 4:29:57the file system tree of starts at what
- 4:30:00is often called the root directory or
- 4:30:01trunk or slash the file system
- 4:30:04hierarchial standard FHS provides Linux
- 4:30:07developers and system administrators a
- 4:30:10standard directory structure for the the
- 4:30:12file system partitions help to segregate
- 4:30:15files according to usage ownership and
- 4:30:18type file systems can be mounted
- 4:30:20anywhere on the main file system tree at
- 4:30:23a mount Point automatic file systems
- 4:30:26mounting can be set up by editing Etc
- 4:30:29FST tab NFS or network file system is a
- 4:30:32useful method for sharing files and data
- 4:30:34through the network systems file systems
- 4:30:37like slpr are called studo file systems
- 4:30:40because they exist only in memory
- 4:30:42SL root is the home directory for the
- 4:30:45root user /var may be put in its own
- 4:30:49file system so that growth can be
- 4:30:51contained and not fatally affect the
- 4:30:53system/ boot contains the basic files
- 4:30:56needed to boot the system patch is a
- 4:30:59very useful tool in Linux many
- 4:31:01modifications to source code and
- 4:31:02configuration files are distributed with
- 4:31:04patch files as they contain the Deltas
- 4:31:07or changes to go from an old version of
- 4:31:09a file to the new version of a file file
- 4:31:12extensions in Linux do not necessarily
- 4:31:14mean that a file is of a certain type CP
- 4:31:18is used to copy files on the local
- 4:31:20machine while rsync can be all can be
- 4:31:23used to copy files from one machine to
- 4:31:25another as well as synchronized
- 4:31:30contents by the end of this chapter you
- 4:31:32should be familiar with how to create
- 4:31:35and edit files using the available Linux
- 4:31:37text editors Nano a simple text based
- 4:31:41editor gedit a simple graphical editor
- 4:31:44VI and emac two Advanced editors with
- 4:31:47both text based and graphical
- 4:31:53interfaces at some point you will need
- 4:31:55to manually edit text files you might be
- 4:31:58composing an email offline writing a
- 4:32:00script to be used for bash or other
- 4:32:02command interpreters altering a system
- 4:32:05or application configuration file or
- 4:32:07developing source code for a programming
- 4:32:10language such as C python or Java Linux
- 4:32:13administrators May sidestep using a text
- 4:32:15editor instead employing graphical
- 4:32:17utilities for creating and modifying
- 4:32:19system configuration files however this
- 4:32:22can be more laborous than directly using
- 4:32:24a text editor and be more limited in
- 4:32:27capability note that word processing
- 4:32:29applications including those that are
- 4:32:31part of common Office application Suites
- 4:32:34are not really basic text editors they
- 4:32:37add a lot of extra usually invisible
- 4:32:39formatting information that will
- 4:32:41probably render system administration
- 4:32:44configuration files unusable for their
- 4:32:46intended purpose so knowing how to
- 4:32:49confidently use one or more text editors
- 4:32:51is really an essential skill to have for
- 4:32:54Linux by now you have certainly realized
- 4:32:57Linux is packed with choices when it
- 4:32:59comes to text editors there are many
- 4:33:02choices ranging from quite simple to
- 4:33:05very complex including Nano gedit VI or
- 4:33:10emac in this section we learn first
- 4:33:13about the Nano and gedit editors which
- 4:33:16are relatively simple and easy to learn
- 4:33:18and then later the more complicated
- 4:33:20choices VI and emac before we start
- 4:33:24let's take a look at some cases where an
- 4:33:26editor is not
- 4:33:31needed sometimes you may want to create
- 4:33:33a short file and don't want to bother
- 4:33:35invoking a full text editor in addition
- 4:33:38doing so can be quite useful when used
- 4:33:41from within scripts even when creating
- 4:33:43longer files you'll no doubt find
- 4:33:45yourself using this method when you
- 4:33:47start on the later chapters that cover
- 4:33:49shell skip scripting if you want to
- 4:33:51create a file without using an editor
- 4:33:53there are two standard ways to create
- 4:33:54one from the command Lin and fill it
- 4:33:57with content the first one is to use
- 4:33:59Echo repeatedly like shown here note
- 4:34:03that while a single greater than sign
- 4:34:06will send the output of a command to a
- 4:34:08file two of them will appin the new out
- 4:34:11output to an existing file the second
- 4:34:14way is to use cat combined with
- 4:34:17redirection uh as in this example here
- 4:34:21both techniques produce a file with the
- 4:34:24following lines in it line one line two
- 4:34:27line three and are extremely useful when
- 4:34:30employed by
- 4:34:34scripts there are some text editors that
- 4:34:37are pretty obvious they require no
- 4:34:39particular experience to learn and are
- 4:34:41actually quite capable even robust
- 4:34:43particularly easy to use one is the text
- 4:34:46terminal based editor Nano just invoke
- 4:34:49Nano by giving a file name as an
- 4:34:51argument all the help you need is
- 4:34:53displayed at the bottom of the screen
- 4:34:54and you should be able to proceed
- 4:34:56without any problem as a graphical
- 4:34:59editor gedit is part of the gnome
- 4:35:01desktop system kri is associated with
- 4:35:04KDE the gedit and kri editors are very
- 4:35:08easy to use and are extremely capable
- 4:35:10they're also very configured
- 4:35:12they look a lot like notepad and windows
- 4:35:14other variants such as Kate are also
- 4:35:17supported by KDE Nano is easy to use and
- 4:35:20requires very little effort to learn to
- 4:35:22open a file type Nano and then the file
- 4:35:24name and press enter if the file does
- 4:35:27not exist it will be created Nano
- 4:35:29provides a two-line shortcut at the
- 4:35:32bottom of the screen that lists the
- 4:35:34available commands some of these
- 4:35:35commands are contrl G display the help
- 4:35:38screen crl o WR to a file contrl X ex
- 4:35:43exit a file contrl R insert contents
- 4:35:45from another file to the current buffer
- 4:35:48or contrl C show the cursor position
- 4:35:51zedit is a simpl to ous graphical editor
- 4:35:55that can only be run within a graphical
- 4:35:58desktop environment it is visually quite
- 4:36:01similar to the notepad text editor in
- 4:36:03Windows but it's actually far more
- 4:36:05capable and very configurable and has a
- 4:36:07wealth of plugins available to extend
- 4:36:09its capabilities further to open a new
- 4:36:12file find the program in your desktop's
- 4:36:15menu system or from the command line
- 4:36:17type gedit and then the file name if the
- 4:36:20file does not exist it will be created
- 4:36:23using gedit is pretty straightforward
- 4:36:25and does not require much training it's
- 4:36:27interface is composed of quite familiar
- 4:36:33elements developers and administrators
- 4:36:37experienced in working on Unix like
- 4:36:39systems almost always use one of the two
- 4:36:42vable editing options VI and emac both
- 4:36:46are present or easily available on all
- 4:36:48distributions and are completely
- 4:36:50compatible with the versions available
- 4:36:52on other operating systems both VI and
- 4:36:55emac have a basic purely text-based form
- 4:36:58that can run in a non-graphical
- 4:37:00environment they also have one or more
- 4:37:03graphical interface forms with extended
- 4:37:06capabilities these may be friendlier for
- 4:37:08a less experienced user while VI and
- 4:37:11Emil Max can have significantly steep
- 4:37:13learning curves for new users they're
- 4:37:15extremely efficient when when one has
- 4:37:16learned how to use them usually the
- 4:37:18actual program installed on your system
- 4:37:20is vim which stands for Vi improved and
- 4:37:25is Alias to the name VI even if you
- 4:37:28don't want to use VI it's good to gain
- 4:37:31some familiarity with it it's a standard
- 4:37:33tool installed on virtually all Linux
- 4:37:35distributions and Mac OS indeed there
- 4:37:38may be times when there is no other
- 4:37:40editor available on the system
- 4:37:42and remember VI and them are going to be
- 4:37:44very similar gome extends VI with a
- 4:37:47graphical interface known as gvm and KDE
- 4:37:50offers km either of these may be easier
- 4:37:52to use at first when using VI all
- 4:37:55commands are entered through the
- 4:37:57keyboard you don't need to keep moving
- 4:37:58your hands to use a pointer device such
- 4:38:01as a mouse or touchpad unless you want
- 4:38:03to do so when using one of the graphical
- 4:38:05versions of the editor typing Vim tutor
- 4:38:09launches a short but very comprehensive
- 4:38:11tutorial for those who want to learn
- 4:38:13their first VI commands even though it
- 4:38:16provides only an introduction and just
- 4:38:18seven lessons it has enough material to
- 4:38:20make you a very proficient VI user
- 4:38:23because it covers a large number of
- 4:38:25commands after learning these basic ones
- 4:38:28you can look up new tricks to
- 4:38:29incorporate into your list of VI
- 4:38:32commands because there are always more
- 4:38:34optimal ways to do things in VI with
- 4:38:36less typing VI provides three modes as
- 4:38:40described in this table here here it's
- 4:38:42vital to not lose track of which mode
- 4:38:44you're in many keystrokes and commands
- 4:38:46have quite different behave quite
- 4:38:48differently in different
- 4:38:55modes this table describes the most
- 4:38:57important commands used to start exit
- 4:39:00read and write files in VI the enter key
- 4:39:03needs to be pressed after all of these
- 4:39:08commands and this table describes the
- 4:39:10most important keystrokes used when
- 4:39:13changing cursor positions in VI line
- 4:39:16mode commands those following a colon
- 4:39:19require the enter key to be pressed
- 4:39:21after the command is
- 4:39:25typed let's get started on using modes
- 4:39:27and cursor movements in VI open VI by
- 4:39:31typing VI followed by the file name VI
- 4:39:35opens in command mode type I to enter
- 4:39:38insert mode VI's insert mode is
- 4:39:41displayed type the following sentences
- 4:39:44the quick brown fox jumped over the lazy
- 4:39:47dog nobody expects the Spanish
- 4:39:50Inquisition to exit insert mode and
- 4:39:52switch to command mode press escape to
- 4:39:56exit VI and save the file type colon WQ
- 4:40:00and press
- 4:40:02enter open the recently saved file and
- 4:40:05place the cursor on the letter k in the
- 4:40:07word quick in the first sentence to move
- 4:40:10the cursor four characters to the left
- 4:40:13type h four times the cursor is moved to
- 4:40:16letter Q of the word quick to move the
- 4:40:19cursor to the next line type J to move
- 4:40:23the cursor to the beginning of the next
- 4:40:24word type w the cursor is moved to the
- 4:40:28beginning of the word expects to move
- 4:40:31the cursor to the end type the dollar
- 4:40:33sign the cursor is moved to the end of
- 4:40:36the second sentence type I to enter
- 4:40:39insert mode VI insert mode is displayed
- 4:40:42to insert text at the end of the second
- 4:40:44sentence type A and type history the
- 4:40:48word history is displayed to the end of
- 4:40:50the sentence to exit insert mode and
- 4:40:52switch to command mode press escape to
- 4:40:56exit VI and save the file type colon WQ
- 4:41:00and press enter here you can see the
- 4:41:03most important commands used when
- 4:41:05searching for text in VI the enter key
- 4:41:08should be pressed after typing the
- 4:41:10search pattern
- 4:41:12this table describes the most important
- 4:41:14keystrokes used when searching for text
- 4:41:17in VI and this table describes the most
- 4:41:20important keystrokes used when changing
- 4:41:22adding and deleting text in
- 4:41:38VI typing the sh command opens an
- 4:41:41external command shell when you exit the
- 4:41:43shell you will resume your editing
- 4:41:45session typing exclamation point
- 4:41:48executes a command from within VI the
- 4:41:51command follows the exclamation point
- 4:41:53this technique is best suited for
- 4:41:55non-interactive commands such as
- 4:41:58exclamation point WC percentage typing
- 4:42:00this will run the word count command on
- 4:42:02the file the character the percentage
- 4:42:04represents the file currently being
- 4:42:07edited let's get started on using
- 4:42:09external commands saving and closing in
- 4:42:12Vim editor open VI editor by typing VI
- 4:42:16followed by the file name VI opens in
- 4:42:19command mode type I to enter insert mode
- 4:42:23VI's insert mode is displayed type the
- 4:42:26following sentences nobody expects the
- 4:42:29Spanish Inquisition nobody expects the
- 4:42:322020 Revolution to exit insert mode and
- 4:42:35switch to command mode press escape to
- 4:42:37write and quit the file type colon WQ
- 4:42:41the file is updated with the changes and
- 4:42:44closed open VI by typing VI followed by
- 4:42:48the file name to count the words in the
- 4:42:50current file type colon exclamation WC
- 4:42:55percent the word count is displayed
- 4:42:59press enter to continue editing to quit
- 4:43:01if no edits were made in the file type
- 4:43:04colon Q the file is closed open VI by
- 4:43:07typing VI followed by file name to quit
- 4:43:11without saving the file type colon Q
- 4:43:14exclamation the file is closed without
- 4:43:17saving the
- 4:43:21changes the emac editor is a popular
- 4:43:23competitor for Vi unlike VI it does not
- 4:43:26work with modes emac is highly
- 4:43:29customizable and includes a large number
- 4:43:30of features it was initially designed
- 4:43:32for use on a console but was soon
- 4:43:34adopted to work with a guy as well emac
- 4:43:38has many other capabilities other than
- 4:43:40simple text Ting for example it can be
- 4:43:42used for email debugging and many other
- 4:43:44things rather than having different
- 4:43:47modes for command and insert like VI
- 4:43:50emac uses the control and meta or alt or
- 4:43:53Escape keys for special commands here
- 4:43:56you can see some of the most important
- 4:43:58key combinations that are used when
- 4:44:01starting exiting reading and writing
- 4:44:03files in
- 4:44:06emac but emac tutorial is a good place
- 4:44:08to start learning basic commands it's
- 4:44:11available anytime when in emac by simply
- 4:44:14typing control h for help and then the
- 4:44:16letter t for tutorial we will now
- 4:44:20demonstrate some of the operations you
- 4:44:22can do with emac in your daily work so
- 4:44:25first let's get a file to edit so
- 4:44:27working in the TMP directory let's get a
- 4:44:30copy of Etc password and bring it over
- 4:44:34here and then in order to work on it I
- 4:44:37just have to say emac pass and the name
- 4:44:40of the file
- 4:44:42Now the default font here is a little
- 4:44:44small so I'll play a trick and hit
- 4:44:46control and the middle button of the
- 4:44:49mouse to control the size of the
- 4:44:51font and then I'll make the window a
- 4:44:54little
- 4:44:55bigger Okay so we've done that now
- 4:44:58suppose I want to look for a certain
- 4:44:59string let's say FTP I would hit contrl
- 4:45:03s and type in the very bottom window the
- 4:45:07very bottom line here FTP so you can see
- 4:45:10down here and you'll see it brought me
- 4:45:12to
- 4:45:13FTP I'll go back to the beginning of the
- 4:45:15line by hitting control a and then let's
- 4:45:19say I want to change all occurrences of
- 4:45:21the string FTP to something else I hit
- 4:45:24Escape percent Mark and then I'll say
- 4:45:27FTP again on the bottom line and then
- 4:45:31let's just do it backwards in capitals
- 4:45:34PTF and you see I hit space it does the
- 4:45:37first one space it does the second one
- 4:45:41space it does the third one if I had hit
- 4:45:43an exclamation point it would have done
- 4:45:45all of them in the entire
- 4:45:49file suppose I want to remove a a line I
- 4:45:52can just hit contrl K and it's gone
- 4:45:54contrl K is gone again suppose I want to
- 4:45:58remove a range of lines I hit control
- 4:46:01space and then
- 4:46:03I go down a few lines uh with either the
- 4:46:07arrow key or crln I hit contrl w
- 4:46:12and they're gone if I want to move them
- 4:46:14further on in the file I go down a few
- 4:46:17lines and I hit control y for
- 4:46:19yank and they're back in there one nice
- 4:46:23thing I can do with emac is open up
- 4:46:25multiple windows at the same time so let
- 4:46:28me hit crl
- 4:46:30X2 and now I've got two windows and I
- 4:46:33can switch to the bottom window by
- 4:46:35hitting crl XO for other and then I hitr
- 4:46:39XF I can put a different file in that
- 4:46:42buffer so let's say I put in
- 4:46:44ETC
- 4:46:48group okay and once again I'll make the
- 4:46:50font a little bigger by hitting control
- 4:46:52in the middle button on the
- 4:46:54mouse okay and you'll notice the bottom
- 4:46:57line is actually uh right protected so I
- 4:47:01can't really delete anything because it
- 4:47:03belongs to root if I try to delete this
- 4:47:05line it won't let me do it it says
- 4:47:07buffer is read only but in general I if
- 4:47:10I had two files with the same
- 4:47:12permissions I could cut and paste and go
- 4:47:14from one to the other to get back to
- 4:47:17just one I can do control X1 and I have
- 4:47:21only this but if I really wanted the
- 4:47:23other window I could can hit control
- 4:47:25XB and I'm back in the password file if
- 4:47:29I want to rewrite it uh I can hit
- 4:47:31control
- 4:47:33xw contr X control W and that would let
- 4:47:36me write it as a different name so I'll
- 4:47:38say p WD
- 4:47:42revised and it's there if I want to
- 4:47:45terminate the program I sayr
- 4:47:47XS to make sure things have been saved
- 4:47:50and then controll
- 4:47:51XC and I'm done so you can see we used
- 4:47:55the control key quite a bit in neac the
- 4:47:58position most keyboards put it in these
- 4:48:00days is a little unnatural all the way
- 4:48:03at the bottom left or right so veteran
- 4:48:07emac users tend to remap the keyboard so
- 4:48:09that the caps lock key also works as
- 4:48:12control so that's some of the basic
- 4:48:14operations you would do in day-to-day
- 4:48:16use of
- 4:48:23emac you have completed chapter 11 let's
- 4:48:27summarize the key Concepts covered text
- 4:48:30editors rather than word processing
- 4:48:32programs are used quite often in Linux
- 4:48:35for tasks such as creating or modifying
- 4:48:37system configuration files writing
- 4:48:39scripts developing sour code and more
- 4:48:42Nano is an easyto use text based editor
- 4:48:45that utilizes onscreen prompts gedit is
- 4:48:48a graphical editor very similar to
- 4:48:50notepad and windows the vi editor is
- 4:48:53available on all Linux systems and is
- 4:48:55very widely used graphical extension
- 4:48:58versions of VI are widely available as
- 4:49:01well emac is available on all Linux
- 4:49:03systems as a popular alternative to VI
- 4:49:06emac can support both a graphical user
- 4:49:08interface and a text mode interface to
- 4:49:11access the vi tutorial typee Vim tutor
- 4:49:14at a command line window to access the
- 4:49:16emac tutorial typ contrl H in then T
- 4:49:19from within emac VI has three modes
- 4:49:22command insert and line emac has only
- 4:49:26one but requires use of special keys
- 4:49:28such as control and Escape both editors
- 4:49:31use various combinations of key strokes
- 4:49:33to accomplish tasks the learning curve
- 4:49:36to master these can be long but once
- 4:49:39mastered using either editor is
- 4:49:41extremely
- 4:49:45efficient by the end of this chapter you
- 4:49:47should be able to use and configure user
- 4:49:50accounts and user groups use and set
- 4:49:54environment variables use the previous
- 4:49:56shell command
- 4:49:58history use keyboard
- 4:50:00shortcuts use and Define
- 4:50:03aliases use and set file permissions and
- 4:50:06ownership
- 4:50:11as you know Linux is a multi-user
- 4:50:13operating system meaning more than one
- 4:50:16user can log on at the same time to
- 4:50:20identify the current user type who am I
- 4:50:23to list the currently logged on users
- 4:50:25type who giving who the- a option will
- 4:50:28give more detailed
- 4:50:33information in Linux the command shell
- 4:50:36program generally bash uses one or more
- 4:50:39startup files to configure the user
- 4:50:41environment files in the /c directory
- 4:50:44define global settings for all users
- 4:50:47while initialization files in the user's
- 4:50:49home directory can include and or
- 4:50:51override the global settings the startup
- 4:50:54files can do anything the user would
- 4:50:56like to do in every command shell such
- 4:50:59as customizing The Prompt defining
- 4:51:03command line shortcuts and aliases
- 4:51:06setting the default text editor setting
- 4:51:09the path for where to find executable
- 4:51:12Pro or setting the path for where to
- 4:51:14find executable
- 4:51:18programs the standard prescription is
- 4:51:21that when you first log into Linux /c/
- 4:51:24profile is read and evaluated after
- 4:51:27which the following files are searched
- 4:51:29if they exist in this order bash profile
- 4:51:33bash
- 4:51:34loginprofile where the squiggly line/ do
- 4:51:38denotes the user's home directory the
- 4:51:40Linux login shell evaluates whatever
- 4:51:42startup file that it comes across first
- 4:51:45and ignores the rest this means that if
- 4:51:47it finds bash profile it ignores bash
- 4:51:51login and profile different
- 4:51:54distributions may use different startup
- 4:51:56files however every time you create a
- 4:51:59new shell or terminal window you do not
- 4:52:02have to perform a full system login only
- 4:52:05a file name bashrc file is read and
- 4:52:08evaluated although this file is not read
- 4:52:10in evaluated along with the login shell
- 4:52:12most distributions and or users include
- 4:52:15the bashrc file from within one of the
- 4:52:18three user owned startup files most
- 4:52:21commonly users only fiddle with the bash
- 4:52:24RC as it is it is invoked every time a
- 4:52:27new command line shell initiates or
- 4:52:29another program is launched from a
- 4:52:31terminal window while the other files
- 4:52:33are read and executed only when the user
- 4:52:36first logs on to the system recent
- 4:52:39distributions sometimes do not even have
- 4:52:42bash profile and or bash login and some
- 4:52:45just do little more than include bash
- 4:52:52RC you can create customized commands or
- 4:52:55modify the behavior of already existing
- 4:52:57ones by creating aliases most often
- 4:53:01these aliases are placed in your bash RC
- 4:53:03file so they're available to any command
- 4:53:06shell you create on Alias removes an
- 4:53:09alias typ tying Alias with no argument
- 4:53:12will list currently defined
- 4:53:14aliases please note that there should
- 4:53:16not be any spaces on either side of the
- 4:53:19equal sign and the Alias definition
- 4:53:21needs to be placed within either single
- 4:53:24or double quotes if it contains any
- 4:53:30spaces all Linux users are assigned a
- 4:53:33unique user ID uid which is just an
- 4:53:36integer normal users start with a uid of
- 4:53:381,000 or greater Linux uses groups for
- 4:53:41organizing users groups are collections
- 4:53:43of accounts with certain shared
- 4:53:45permissions control of group membership
- 4:53:48is administered through the slcg group
- 4:53:51file which shows a list of groups and
- 4:53:53their members by default every user
- 4:53:56belongs to a default or primary group
- 4:53:58when a user logs in the group membership
- 4:54:00is set for their primary group and all
- 4:54:02the members enjoy the same level of
- 4:54:04access and privilege permissions on
- 4:54:07various files and directories can be
- 4:54:09modified as the group level users also
- 4:54:12have one or more group IDs GID including
- 4:54:16a default one which is the same as the
- 4:54:18user ID these numbers are associated
- 4:54:20with names through the files SLC
- 4:54:23password and slcg group groups are used
- 4:54:26to establish a set of users who have
- 4:54:29common interests for the purpose of
- 4:54:31access rights Privileges and security
- 4:54:34considerations access rights to files
- 4:54:37and devices are granted on the basis of
- 4:54:39the user and the group they belong
- 4:54:44to distributions have straightforward
- 4:54:47graphical interfaces for creating and
- 4:54:49removing users and groups and
- 4:54:52manipulating group membership however
- 4:54:55it's often useful to do it from the
- 4:54:57command line or from within shell
- 4:54:59scripts only the root user can add and
- 4:55:02remove users and groups adding a new
- 4:55:05user is done with user ad and removing
- 4:55:07an existing user is done with user Dell
- 4:55:09and the simplest form and account for
- 4:55:11the new user BJ moose would be done with
- 4:55:14pseudo user ad BJ moose which by default
- 4:55:18sets the home directory to slome BJ
- 4:55:20moose populates it with some basic files
- 4:55:23copied from SLC skll and adds a line to
- 4:55:27the SLC password such as this and sets
- 4:55:31the default shell to /bin/bash removing
- 4:55:34a user account is as easy as typing user
- 4:55:37Dell BJ moose however this will leave
- 4:55:40slh home/ BJ moous directory intact this
- 4:55:43might be useful if it's a temporary
- 4:55:45inactivation to remove the home
- 4:55:47directory while removing the account one
- 4:55:48needs to use the- R option to user Dell
- 4:55:53typing ID with no arguments gives gives
- 4:55:55information about the current user as in
- 4:55:59this ID if given the name of another
- 4:56:02user as an argument ID will report
- 4:56:05information about that other user let's
- 4:56:08get some experience with creating
- 4:56:11modifying and removing a new user
- 4:56:13account we will do this on Ubuntu
- 4:56:161704 there are some variations between
- 4:56:20distributions about what exactly is
- 4:56:22created when a new account is is created
- 4:56:26and exactly which files are there Etc
- 4:56:30this is mostly controlled by a file
- 4:56:32under Etc default user ad appropriately
- 4:56:37named so you can see for example in here
- 4:56:40here the default shell is set to be
- 4:56:42Shell bsh B
- 4:56:45bsh now on some distributions such as
- 4:56:48red hat this file is rather short and
- 4:56:50not very well documented on auntu it's
- 4:56:53rather long so let's create the account
- 4:56:56so Su do uh user ad and I'll say- M to
- 4:57:02make sure it creates a home directory
- 4:57:05some uh some distributions do not do
- 4:57:08that by default
- 4:57:10two does not for instance and neither
- 4:57:11does open Su I'll give the full name to
- 4:57:15be Eric
- 4:57:19dolphy I'll specify the default shell to
- 4:57:22be bin bash with the S
- 4:57:24option and here's the name e d o l p y e
- 4:57:29DOI now I still have to pass a specify a
- 4:57:33password so I'll do that with s do pass
- 4:57:36wde e d o l py
- 4:57:40and then I type
- 4:57:41[Music]
- 4:57:42something and now the accounts exists
- 4:57:45and I can verify that by making sure
- 4:57:48entries were
- 4:57:49made uh in the
- 4:57:53ETC password file and Etc group and
- 4:57:58there we go notice it is now user
- 4:58:011001 remember normal user start at 1,000
- 4:58:05and student is user 1000 and so that's
- 4:58:08appropriate
- 4:58:10and also the other information I
- 4:58:12specified is there such as the full
- 4:58:14username and the shell bin
- 4:58:17bash and the group is set to be
- 4:58:21101 which is the same ID as the user all
- 4:58:24users are created with at least one
- 4:58:26group that has the same number as their
- 4:58:30username now let's actually try to log
- 4:58:32into that account and I'll do that with
- 4:58:35SSH and e d o l py at Local Host
- 4:58:41and I'll give the
- 4:58:44password and I succeeded just fine so
- 4:58:48let's see what's actually in that
- 4:58:51directory and you'll see there isn't
- 4:58:53much but these are files that all new
- 4:58:55users
- 4:58:56get um and let me log out now and that's
- 4:59:00controlled by whatever is in the ETC
- 4:59:03skel directory anything you put in there
- 4:59:07let me uh do the a option anything you
- 4:59:09put in there
- 4:59:10will show up in any new
- 4:59:14users uh
- 4:59:16account so let's just clean up and I'll
- 4:59:19do that with
- 4:59:20user
- 4:59:22d-r uh e
- 4:59:25doy and the r is necessary to make sure
- 4:59:30removes the home
- 4:59:33directory you know I get a warning
- 4:59:35message about uh not having created a m
- 4:59:37spool file that's harmless and if we do
- 4:59:40LSL on home now we see the account is
- 4:59:43gone so we're all cleaned
- 4:59:50up adding a new group is done with group
- 4:59:53AD so you can use pseudo usergroup add a
- 4:59:58new group the group can be removed with
- 5:00:01studo userin group Dell a new group
- 5:00:06adding a user to an already existing
- 5:00:08group is done with user mod for example
- 5:00:11when you would first look at what groups
- 5:00:13the user already belongs
- 5:00:17to and then add the new group pseudo
- 5:00:21userin user- a-g a new group rjs
- 5:00:26squirrel RJ squirrel and then groups RJ
- 5:00:29squirrel will show the new group these
- 5:00:31utilities update the /c/ group as
- 5:00:34necessary make sure you use the- a
- 5:00:37option for aend so as to avoid removing
- 5:00:39r existing groups group mod can be used
- 5:00:42to change group properties such as the
- 5:00:45group ID with the dasg option or name
- 5:00:48with the with the dash in option
- 5:00:51removing a user from the group is
- 5:00:53somewhat trickier the dasg option to
- 5:00:56user mod must give a complete list of
- 5:00:58groups thus if you do
- 5:01:01pseudo user sbin ususer mod DG RJ
- 5:01:06squirrel RJ squirrel and then do groups
- 5:01:09RJ squirrel you'll see that only the RJ
- 5:01:12squirrel group will be
- 5:01:17left the root account is very powerful
- 5:01:20and has full access to the system other
- 5:01:22operating systems often call this the
- 5:01:24administrator account in Linux it's
- 5:01:26often called the super user account you
- 5:01:29must be extremely cautious before
- 5:01:31granting full rot access to a user it's
- 5:01:33rarely if ever Justified external
- 5:01:36attacks often consists of tricks used to
- 5:01:38elevate the root account however you can
- 5:01:40use pseudo to assign more limited
- 5:01:43privileges to user accounts but only do
- 5:01:46it on a temporary basis and only for a
- 5:01:48specific subset of
- 5:01:53commands when assigning elevated
- 5:01:56privileges you can use the command Su
- 5:02:00the switch or substitute user to launch
- 5:02:02a new shelf running as another user you
- 5:02:05must type the password of the user you
- 5:02:07are becoming most often this user is
- 5:02:10root and the new shell allows the use of
- 5:02:13elevated privileges until it's until it
- 5:02:15is exited it's almost always a bad
- 5:02:18practice to use S Su to become root
- 5:02:22resulting errors can include deletion of
- 5:02:24vital files from the system and security
- 5:02:27breaches granting privileges using
- 5:02:30pseudo is less dangerous and is
- 5:02:33preferred by default studo must be
- 5:02:35enabled on a per user basis however some
- 5:02:38distributions such as BTU enable it by
- 5:02:41default for at least one main user or
- 5:02:43give this as an installation
- 5:02:49option to temporarily become the super
- 5:02:52user for a series of commands you can
- 5:02:54type Su and then be prompted for the
- 5:02:57root
- 5:02:58password to execute just one command
- 5:03:01with root privileges type pseudo and
- 5:03:04then the command when the command is
- 5:03:06complete you will return to being a
- 5:03:09normal un privileged user pseudo
- 5:03:12configuration files are stored in the
- 5:03:14/c/ pseudo file and in the SLC sudoers
- 5:03:19DOD directory by default the pseudo s.d
- 5:03:23directory is empty and whenever you talk
- 5:03:26about pseudo in a course or article
- 5:03:29you're basically required to show this
- 5:03:31web comic by
- 5:03:38XKCD and environment variables are
- 5:03:41quantities that have specific values
- 5:03:43which may be utilized by the command
- 5:03:45shell such as bash or other utilities
- 5:03:48and applications some environment
- 5:03:50variables are given preset values by the
- 5:03:53system which can usually be overridden
- 5:03:55While others are set directly by the
- 5:03:57user either at the command line or
- 5:03:59within startup and other scripts an
- 5:04:02environment variable is actually just a
- 5:04:04character string that contains
- 5:04:06information used by one or more
- 5:04:08applications there are a number of ways
- 5:04:11to view the values of currently set
- 5:04:13environment variables one can type set
- 5:04:16EMV or export depending on the state of
- 5:04:19your system set May print out many more
- 5:04:22lines than the other two
- 5:04:27methods by default variables created
- 5:04:29within a script are only available to
- 5:04:31the current shell child processes
- 5:04:34subshells will not have access to values
- 5:04:37that have been set or modified allowing
- 5:04:39child processes to see the values
- 5:04:41requires use of the export
- 5:04:50command you can also set environment
- 5:04:53variables to be fed as a one shot to a
- 5:04:56command as in the following this feeds
- 5:04:59the values of the S dur and kroot
- 5:05:03environment variables to the command
- 5:05:05make modules install
- 5:05:10home is an environment variable that
- 5:05:13represents the home or login directory
- 5:05:16of the user CD without arguments will
- 5:05:18change the current working directory to
- 5:05:20the value of Home note the ti character
- 5:05:24is often used as an abbreviation for
- 5:05:27home thus CD home and CD with utility
- 5:05:31are completely equivalent statements
- 5:05:46path is an ordered list of directories
- 5:05:48the path which is scanned when a command
- 5:05:51is given to find the appropriate program
- 5:05:54or script to run each directory in the
- 5:05:57path is separated by colons a null or
- 5:06:00empty directory name or slash indicates
- 5:06:03the current directory at any given time
- 5:06:05so in this example there is a null
- 5:06:07directory before the first call
- 5:06:10similarly for this there is a null
- 5:06:12directory between path 1 and path 2 to
- 5:06:16prefix a private bin directory to to
- 5:06:19your path you can use this
- 5:06:27command the environment variable shell
- 5:06:30points to the user's default command
- 5:06:33shell the program that is handling
- 5:06:35whatever you type in a command window
- 5:06:37usually bash and it contains the Full
- 5:06:40path name to the
- 5:06:44Shell prompt statement or Ps is used to
- 5:06:47customize your prompt string in your
- 5:06:50terminal Windows to display the
- 5:06:52information you want PS1 is the primary
- 5:06:55prompt variable which controls what your
- 5:06:58command line prompt looks like the
- 5:07:00following special characters can be
- 5:07:03included in
- 5:07:07PS1 they must be surrounded in in single
- 5:07:10quotes when they are used as in this
- 5:07:21example bash keeps track of previously
- 5:07:24entered commands and statements in a
- 5:07:26history buffer you can recall previously
- 5:07:29used commands simply by using the up and
- 5:07:31down cursor keys to view the list of
- 5:07:34previously executed commands you can
- 5:07:36just type history at the command line
- 5:07:40this list of commands is displayed with
- 5:07:42the most recent command appearing last
- 5:07:45in the list this information is stored
- 5:07:47in the sl- bash history if you have
- 5:07:51multiple terminals open the commands
- 5:07:53typed in each session are not saved
- 5:07:55until the session
- 5:07:59terminates several Associated
- 5:08:01environment variables can be used to get
- 5:08:04information about the history pile his
- 5:08:07file is the location of the history file
- 5:08:09his file size is the maximum number of
- 5:08:12lines in the history file default 500
- 5:08:15his size is the maximum number of
- 5:08:17commands in the history file hist
- 5:08:20control is how commands are stored hist
- 5:08:24ignore is which which command lines can
- 5:08:27be unsaved for a complete description of
- 5:08:30the the use of these environment
- 5:08:31variables see the man page and
- 5:08:36Bash there are specific keys to per
- 5:08:39perform various tasks if you want to
- 5:08:42recall a command in the history list but
- 5:08:44do not want to press the arrow key
- 5:08:46repeatedly you can press controlr to do
- 5:08:49a reverse intelligent search as you
- 5:08:51start typing the search goes back in
- 5:08:53reverse order to the First Command that
- 5:08:55matches the letters you have typed by
- 5:08:57typing more successive letters you make
- 5:09:00the match more and more
- 5:09:05specific you can use keyboard shortcuts
- 5:09:07to perform different tasks quick quickly
- 5:09:10this table lists some of these keyboard
- 5:09:12shortcuts and their uses note the case
- 5:09:15of the hot key does not matter meaning
- 5:09:18doing control a is the same as doing
- 5:09:20control capital
- 5:09:27A in Linux and other Unix Bas operating
- 5:09:30systems every file is associated with a
- 5:09:32user who is the owner every file is also
- 5:09:35associated with a group a subset of all
- 5:09:37users which has an interest in the file
- 5:09:40and certain rights or permissions read
- 5:09:42write and execute the following utility
- 5:09:45programs involve user and group
- 5:09:47ownership and permission
- 5:09:56settings files have three kinds of
- 5:09:59permissions read write and execute these
- 5:10:02are generally represented as
- 5:10:05rwx these permissions affect the three
- 5:10:08groups of owners owner user owner group
- 5:10:12and others as a result you have the
- 5:10:15following three groups of three
- 5:10:17permissions there are a number of
- 5:10:19different ways to use CH mod for
- 5:10:21instance to give the owner and others
- 5:10:22execute permission and remove the group
- 5:10:24write permission you can do this where
- 5:10:28the U stands for user or owner o stands
- 5:10:31for other world and G stands for group
- 5:10:35this kind of syntax can be difficult to
- 5:10:37type and remember so what often uses a
- 5:10:39short hand which lets you set all the
- 5:10:42permissions in one step this is done
- 5:10:44with a simple algorithm and a single
- 5:10:47digit suffices to specify all three
- 5:10:49permission bits for each entity this
- 5:10:52digit is the sum of four if read
- 5:10:54permission is desired two if write
- 5:10:56permission is desired one if execute
- 5:10:59permission is is desired so seven means
- 5:11:02read write execute six means read write
- 5:11:05five means read execute when you apply
- 5:11:08this to the the chod command you have to
- 5:11:12give three digits for each degree of
- 5:11:14Freedom such as chod 755 Su
- 5:11:24file now let's see an example of
- 5:11:27changing file ownership using CH own as
- 5:11:30shown in this
- 5:11:32screenshot first we create two empty
- 5:11:35files using
- 5:11:37touch notice it requires pseudo to
- 5:11:39change the owner of file 2 to rout the
- 5:11:42second CH own command changes both owner
- 5:11:44and group at the same time finally only
- 5:11:47the super user can remove the files now
- 5:11:50let's see an example of changing the
- 5:11:52group ownership using
- 5:12:01chgrp you have completed chapter 12
- 5:12:04let's summarize the key Concepts covered
- 5:12:07Linux is a multi user system to find the
- 5:12:11currently logged on users you can use
- 5:12:13the who command to find the current user
- 5:12:16ID you can use the who am I
- 5:12:19command the root account has full access
- 5:12:22to the system it's never sensible to
- 5:12:25Grant full root access to a user you can
- 5:12:28assign root privileges to regular user
- 5:12:30accounts on a temporary basis using the
- 5:12:33pseudo command the shell program or bash
- 5:12:37uses multiple startup files to create
- 5:12:38the user environment each file affects
- 5:12:41the interactive environment in a
- 5:12:43different way
- 5:12:45/c/ profile provides the global
- 5:12:48settings advantages of startup files
- 5:12:50include that they customize the user's
- 5:12:52prompt set the user's terminal type set
- 5:12:55the command line shortcuts and aliases
- 5:12:58and set the default text editor an
- 5:13:01environment variable is a character
- 5:13:03string that contains data used by one or
- 5:13:05more applications the built-in shell
- 5:13:07variables can be customized to suit your
- 5:13:10requirements the history command recalls
- 5:13:13a list of previous commands which can be
- 5:13:16edited and recycled in Linux various
- 5:13:19keyboard shortcuts can be used at the
- 5:13:21command prompt instead of long actual
- 5:13:24commands you can customize commands by
- 5:13:27creating aliases adding an alias to the
- 5:13:31sl. bashrc file will make it available
- 5:13:34for other shells file permissions can be
- 5:13:36changed by typing chod permission in the
- 5:13:39file name file ownership is changed by
- 5:13:42typing CH own then the owner and the
- 5:13:44file name file group ownership is
- 5:13:47changed by typing chgrp then the group
- 5:13:50then the file
- 5:13:54name by the end of this chapter you
- 5:13:56should be able to display and append to
- 5:14:00file contents using cat and Echo edit
- 5:14:03and print file content contents using
- 5:14:05SED and awk search for patterns using GP
- 5:14:10use multiple other utilities for file
- 5:14:12and text
- 5:14:16manipulation irrespective of the role
- 5:14:18you play with Linux such as system
- 5:14:20administrator developer or user you
- 5:14:23often need to browse through and parse
- 5:14:25text files Andor extract data from them
- 5:14:28these are file manipulation operations
- 5:14:31thus it's essential for the Linux user
- 5:14:33to become Adept at performing certain
- 5:14:35operations on files most of the time
- 5:14:38such file manipulation is done at the
- 5:14:40command line which allows users to
- 5:14:42perform tasks more efficiently than
- 5:14:44while using a guey furthermore the
- 5:14:47command line is more suitable for
- 5:14:49automating often executed tasks indeed
- 5:14:52experienced system administrators write
- 5:14:54customized scripts to accomplish such
- 5:14:56repetitive tasks standardized for each
- 5:14:59particular environment we'll discuss
- 5:15:01such scripting later in much detail in
- 5:15:04this section we'll concentrate on
- 5:15:06command line file and text manipulation
- 5:15:08related U
- 5:15:12utilities cat is short for concatenate
- 5:15:16and is one of the most frequently used
- 5:15:18Linux command line utilities it's often
- 5:15:20used to read and print files as well as
- 5:15:22for simply viewing file contents to view
- 5:15:25a file use the following command cat and
- 5:15:28then the file name for example cat
- 5:15:31readme.txt will display the contents of
- 5:15:33readme.txt on the terminal however the
- 5:15:36main purpose of cat is often to combine
- 5:15:39or concatenate multiple files together
- 5:15:42you can perform the actions listed in
- 5:15:45this table using
- 5:15:50cat the TCH command or cat spelled
- 5:15:53backwards prints the lines of a file in
- 5:15:56reverse order each line Remains the Same
- 5:15:58but the order of lines is inverted the
- 5:16:00syntax of TAC is exactly the same as for
- 5:16:02cat as in the
- 5:16:06following cat can be used to read from
- 5:16:08standard input such as the terminal
- 5:16:10window if no files are specified you can
- 5:16:13use the greater than operator to create
- 5:16:15and add new lines to the file and the
- 5:16:17double greater than operator to append
- 5:16:19lines or files to an existing file to
- 5:16:22create a new file at the command prompt
- 5:16:24type cat greater than file name and
- 5:16:27press the enter key this command creates
- 5:16:30a new file and waits for the user to
- 5:16:32edit or enter the text after you finish
- 5:16:35typing the required text press contrl D
- 5:16:38at the beginning of the next line to
- 5:16:39save and exit the
- 5:16:41editing let's demonstrate some of the
- 5:16:44basic operations you can performed with
- 5:16:47the cat utility where the word cat
- 5:16:49stands for concatenate it's typically
- 5:16:53used to copy files combine them Etc so
- 5:16:56first we will need a couple of simple
- 5:16:58text files to play with let's create one
- 5:17:01using a text editor let's say Nano so
- 5:17:04Nano file one.
- 5:17:06text and I will just type in a couple of
- 5:17:13lines actually three lines with a PL one
- 5:17:16at the end I hit contr X for exit I say
- 5:17:20yes I want to save the modified buffer
- 5:17:22and I keep the name so now I can look at
- 5:17:25the the file created with cat so do cat
- 5:17:28file what.
- 5:17:29text perfect now let's create another
- 5:17:32one interactively using cat itself as we
- 5:17:35talked about earlier so I can say cat
- 5:17:39in Direction with eof and I'll put it
- 5:17:42into file 2.
- 5:17:44text and here is a second file with a
- 5:17:49few lines and then I just type eof on a
- 5:17:55line and that closes the input phase and
- 5:17:59I can say c for l2.
- 5:18:03text it's there if I want to see them
- 5:18:06both together I can say C file one. text
- 5:18:10file 2. text I see it combined or I
- 5:18:14could send it into a third file file 3.
- 5:18:18text and then clear the screen I can say
- 5:18:22cat file
- 5:18:233. text and I see they
- 5:18:27combined two files in a third file so
- 5:18:30this is how we use CAD it's an everyday
- 5:18:32operation you rarely do anything that
- 5:18:34much more complicated with it
- 5:18:42system administrators need to work with
- 5:18:44configuration files text files
- 5:18:46documentation files and log files some
- 5:18:49of these files may be larger or become
- 5:18:51quite large as they accumulate data with
- 5:18:53time these files will require both
- 5:18:55viewing and administrative updating in
- 5:18:58this section you will learn how to
- 5:19:00manage such large files for example a
- 5:19:02banking system might maintain one simple
- 5:19:05large log file to record details of all
- 5:19:07of One day's ATM transactions due to a
- 5:19:10security attack or a malfunction the
- 5:19:13administrator might be forced to check
- 5:19:14for some data by navigating within the
- 5:19:17file in such cases directly opening the
- 5:19:20file in an editor will cause issues due
- 5:19:22to high memory utilization as an editor
- 5:19:25will usually try to read the whole file
- 5:19:27into memory first however one can use
- 5:19:30less to view the contents of such a
- 5:19:32large file scrolling up and down Page by
- 5:19:35Page without the system having to place
- 5:19:37the entire file in memory before
- 5:19:39starting this is much faster than using
- 5:19:42a text editor viewing some file can be
- 5:19:45done by typing either of the two
- 5:19:46following commands less sum file or cat
- 5:19:50Su file pipe less by default Man pages
- 5:19:53are sent through the less command you
- 5:19:56may have encountered the older more
- 5:19:57utility which has some basic
- 5:19:59functionality but fewer capabilities I.E
- 5:20:01less is
- 5:20:06more head reads the first few lines of
- 5:20:08each named file Tim by default and
- 5:20:11displays it on standard output you can
- 5:20:13give a different number of lines in an
- 5:20:15option for example if you want to print
- 5:20:18the first five lines from Etc default
- 5:20:21scrub we can use this command head- in
- 5:20:24and then Etc deault scrub you can also
- 5:20:27just do this head- 5 Etc deault
- 5:20:34scrub tail prints the last few lines of
- 5:20:37each named file and displays it on
- 5:20:40standard output by default it's it
- 5:20:42displays the last 10 lines you can give
- 5:20:44a different number of lines as an option
- 5:20:46tail is especially useful when you are
- 5:20:49troubleshooting any issue using log
- 5:20:51files as you probably want to see the
- 5:20:53most recent lines of output for example
- 5:20:56to display the last 15 lines of some
- 5:20:58file. log we can use this command tail
- 5:21:02DN 15 some file that log you can also
- 5:21:05just do this tail -15 some file. log to
- 5:21:10continually monitor new output in a
- 5:21:12growing log file we can do tail-f su
- 5:21:15file. log this command will continuously
- 5:21:18display any new lines of output in some
- 5:21:21file. log as soon as they appear thus it
- 5:21:25enables you to monitor any current
- 5:21:27activity that is being reported and
- 5:21:32recorded it's very common to create and
- 5:21:34then repeatedly edit and or extract
- 5:21:37contents from a file let's learn how to
- 5:21:39use S and awk to easily perform such
- 5:21:43operations note that many Linux users
- 5:21:46and administrators will write scripts
- 5:21:48using comprehensive scripting languages
- 5:21:51such as Python and pearl rather than use
- 5:21:54S and awk and some of other utilities
- 5:21:57we'll discuss later using such utilities
- 5:21:59is certainly fine in most circumstances
- 5:22:02once should always feel free to use the
- 5:22:04tools one is experienced with however
- 5:22:06the utilities that are described here
- 5:22:08are much lighter I.E they use fewer
- 5:22:11system resources and execute faster
- 5:22:14there are situations such as during
- 5:22:16booting the system where a lot of time
- 5:22:18would be wasted using the more
- 5:22:20complicated tools and the system may not
- 5:22:22even be able to run them so the simpler
- 5:22:25tools will always be
- 5:22:30needed SD is a powerful text processing
- 5:22:33tool and is one of the oldest earliest
- 5:22:35and most powerful Unix utilities it's
- 5:22:38used to modify the contents of a file or
- 5:22:40input stream usually placing the
- 5:22:42contents into a new file or output
- 5:22:44stream its name is is an abbreviation
- 5:22:47for stream editor said s can filter text
- 5:22:51as well as perform substitutions in data
- 5:22:54streams data from an input source or
- 5:22:56file is taken and moved to a working
- 5:22:59space the entire list of operations or
- 5:23:02modifications is applied over the data
- 5:23:04in the working space and then final
- 5:23:06contents are moved to the standard
- 5:23:07output space or stream you can invoke
- 5:23:10set or SED using commands like those
- 5:23:13listed in this table the- e option
- 5:23:15allows you to specify multiple editing
- 5:23:18commands simultaneously at the command
- 5:23:20line it's unnecessary if you only have
- 5:23:23one operation invoked now that you know
- 5:23:27that you can perform multiple editing
- 5:23:28and filtering operations with said let's
- 5:23:31explain some of them in more detail the
- 5:23:34table explains some basic operations
- 5:23:36where pattern is the current string and
- 5:23:39replace uncore string is the new
- 5:23:47string let's demonstrate some of the
- 5:23:50most Elementary operations you can
- 5:23:53perform with SCD on a fedora
- 5:23:57system so I have taken the Liberty to
- 5:24:00prepare a simple text file uh before we
- 5:24:04start which looks like this cat INF
- 5:24:06file. text it just says three lines
- 5:24:10indicating their presence suppose I do
- 5:24:14sd- e
- 5:24:17slash and then uh let's say is to
- 5:24:22r on the
- 5:24:24file and the output will go right on
- 5:24:27standard
- 5:24:28out and you see it changed only the
- 5:24:32first instance on every line so I even
- 5:24:35have the instead of this
- 5:24:38um I can make a slight modification to
- 5:24:41the command if I put a g at the end of
- 5:24:45it and you see this time it caught every
- 5:24:49instance I could also
- 5:24:52do something like this uh 1 comma
- 5:24:572s and it only did it on the first and
- 5:25:00the second line but it left the third
- 5:25:02line alone you notice that I don't have
- 5:25:06to use a forward slash I can use many
- 5:25:09other characters so here I'll use a
- 5:25:14colon and it makes no difference what I
- 5:25:17use now there is an option for S to
- 5:25:21change character streams in place on the
- 5:25:24original file but it's a pretty
- 5:25:26dangerous operation to do since you
- 5:25:29destroy the original file so generally
- 5:25:31it's better to send the output into
- 5:25:34another file so I'll do I'll call that
- 5:25:36one out file. text
- 5:25:42oh I forgot to say INF file. text for
- 5:25:46input so it hung so now I can look at
- 5:25:50out file.
- 5:25:54text you see and that's the output and
- 5:25:56if I want to use the diff command to see
- 5:26:00the difference I can do something like
- 5:26:01this diff INF file. text L file. text
- 5:26:09and it shows me the two lines that have
- 5:26:11changed now you can do some pretty
- 5:26:14complicated things with SD when you're
- 5:26:17trying to deal with special characters
- 5:26:19including spaces and question marks and
- 5:26:22stars life being get pretty complicated
- 5:26:26it it is it respects everything in the
- 5:26:29world about what are called regular
- 5:26:32Expressions uh which can look rather
- 5:26:35strange but it's a daily tool that
- 5:26:37system min administrators do to make
- 5:26:39Elementary substitutions and files so
- 5:26:42that's a little bit about
- 5:26:48s awk a is used to extract and then
- 5:26:52print specific contents of a file is
- 5:26:54often used to construct reports it was
- 5:26:56created at Babs in the 1970s and derived
- 5:26:58its name from the last names of its
- 5:27:00authors o has the following features
- 5:27:03it's a powerful utility and interpreted
- 5:27:05programming language it's used to
- 5:27:07manipulate data fil
- 5:27:08and for retrieving and processing text
- 5:27:11it works well with Fields containing a
- 5:27:13single piece of data essentially a
- 5:27:14column and Records a collection of
- 5:27:17fields essentially a line in a file a is
- 5:27:21invoked as shown in this
- 5:27:25example as was said short o commands can
- 5:27:28be specified directly at the command
- 5:27:30line but a more complex script can be
- 5:27:33saved in a file that you can specify
- 5:27:35using the- F
- 5:27:36option the this table explains the basic
- 5:27:39tasks that can be performed using a the
- 5:27:42input file is read one line at a time
- 5:27:43and for each line o matches the given
- 5:27:45pattern in the given order and performs
- 5:27:48the requested action the- F option
- 5:27:50allows you to specify a particular field
- 5:27:53separator character for example the /c/
- 5:27:57password file uses a colon to separate
- 5:27:59the fields so the- F colon option is
- 5:28:02used with the SLC password file the
- 5:28:05command or action in a needs to be
- 5:28:08surrounded with apostrophes or single
- 5:28:10quotes o can be used like the following
- 5:28:13like in this
- 5:28:17example in managing your files you may
- 5:28:20need to perform tasks such as sorting
- 5:28:22data and copying data from one location
- 5:28:25to another Linux provides numerous file
- 5:28:27manipulation utilities that you can use
- 5:28:30while working with text files in this
- 5:28:32section you will learn about the
- 5:28:34following file manipulation programs
- 5:28:37sort unique paste join and split you
- 5:28:42also learn about regular expressions and
- 5:28:45search
- 5:28:48patterns sort is used to rearrange the
- 5:28:52lines of a text file in either ascending
- 5:28:54or descending order according to a sort
- 5:28:57key you can also sort with respect to
- 5:29:00particular fields or columns in a file
- 5:29:02the default sort key is the order of the
- 5:29:04asky characters I.E essentially
- 5:29:07alphabetically sort can be used like
- 5:29:11this when used with the dasu option sort
- 5:29:14checks for Unique values after sorting
- 5:29:16the records or lines it's basically
- 5:29:18equivalent to running unique on the
- 5:29:20output of
- 5:29:24sort unique removes duplicate
- 5:29:26consecutive lines in a text file and
- 5:29:28it's useful for simplifying the text
- 5:29:31display because unique requires that the
- 5:29:34duplicate entries must be consecutive
- 5:29:36one often runs sort for first and then
- 5:29:39pipes output into unique if sort is used
- 5:29:42with the dasu option it can do all this
- 5:29:44in one step to remove duplicate entries
- 5:29:48from multiple files at once use this
- 5:29:51command or you can use do this
- 5:29:54one to count the number of duplicate
- 5:29:56entries use this
- 5:30:02command suppose you have a file that
- 5:30:04contains the full name of all employees
- 5:30:07and another file that list their phone
- 5:30:08numbers and employee IDs you want to
- 5:30:11create a new file that contains all the
- 5:30:12data listed in three columns name
- 5:30:14employee ID and phone number how can you
- 5:30:16do this effectively without investing
- 5:30:18too much time Paste can be used to
- 5:30:20create a single file containing all
- 5:30:23three columns the different columns are
- 5:30:25identified based on delimiters which is
- 5:30:27spacing used to separate two fields for
- 5:30:30example delimiters can be BL a blank
- 5:30:32space a tab or an enter in this image a
- 5:30:35single space is used as a delimiter in
- 5:30:37all files paste accepts the following
- 5:30:41options- D for the delimiters which
- 5:30:44specify a list of delimeters to be used
- 5:30:46instead of tabs for separating
- 5:30:48consecutive values on a single line each
- 5:30:51delimiter is used in turn when the list
- 5:30:53has been exhausted Pace begins again at
- 5:30:56the first delimiter d s which causes
- 5:30:59Pace to appin the data in series rather
- 5:31:02than in parallel that is in a horizontal
- 5:31:04rather than vertical fashion Pace can be
- 5:31:07used to combine Fields such as name or
- 5:31:09phone number from different files as
- 5:31:11well as combin lines from multiple files
- 5:31:14for example line one from file one can
- 5:31:16be combined with line one of file two
- 5:31:19and line two from file one can be
- 5:31:20combined with line two of file two and
- 5:31:23so on to paste contents from two files
- 5:31:26one can do
- 5:31:28this and here's the syntax to use a
- 5:31:31different
- 5:31:31delimiter common delimiters are space
- 5:31:34Tab and comma
- 5:31:38suppose you have two files with with
- 5:31:40similar columns you have saved employees
- 5:31:43phone numbers in two files one with the
- 5:31:45first name and the other with their last
- 5:31:47name you want to combine the files
- 5:31:49without repeating the data of common
- 5:31:52columns how do you achieve this this
- 5:31:54task can be achieved using join which is
- 5:31:57essentially an enhanced version of paste
- 5:32:00it first checks whether the files share
- 5:32:02common fields such as names or phone
- 5:32:04numbers and then joins the lines into
- 5:32:06files based on a common field to combine
- 5:32:09two files on a common field at the
- 5:32:12common prompt type join file one file
- 5:32:14two and press the enter key for example
- 5:32:17the common field I.E it contains the
- 5:32:19same values among the phone book and
- 5:32:22cities files is the phone number and the
- 5:32:25result of joining these two files is
- 5:32:27shown
- 5:32:32here split is used to break up or split
- 5:32:35a file into equal siiz segments for
- 5:32:38easier viewing and manipulation and it's
- 5:32:40generally used only on relatively large
- 5:32:42files by default split breaks up a file
- 5:32:45into 1,000 line segments the original
- 5:32:48file remains unchanged and a set of new
- 5:32:50files with the same name plus added
- 5:32:52prefix is created by default the X
- 5:32:55prefix is added to split a file into
- 5:32:58segments use the command split in file
- 5:33:01to split a file into segments using a
- 5:33:03different prefix use the command split
- 5:33:06in file and then the prefix we will
- 5:33:08apply split to an American English
- 5:33:10dictionary file of over 999,000 lines
- 5:33:13and in this example we've used WC which
- 5:33:16stands for word count that we'll discuss
- 5:33:18shortly to report on the number of lines
- 5:33:20in the file and then you just type this
- 5:33:23this will split the American English
- 5:33:25file into 100 equal siiz segments named
- 5:33:28dictionary XX the last one will of
- 5:33:31course be somewhat
- 5:33:36smaller regular expressions are text
- 5:33:38strings used for matching a specific
- 5:33:41pattern or to search for a specific
- 5:33:43location such as the start or end of a
- 5:33:45line or a word regular Expressions can
- 5:33:48contain both normal characters or
- 5:33:50so-called medic characters such as an
- 5:33:53aster or and then and a dollar sign many
- 5:33:56text editors and utilities such as VI
- 5:33:59said o find and grep work extensively
- 5:34:02with regular Expressions this table
- 5:34:04lists the search patterns and their
- 5:34:06usage
- 5:34:10for example consider the following
- 5:34:11sentence the quick brown fox jumped over
- 5:34:14the lazy dog some of the patterns that
- 5:34:17can be applied to the sentence are shown
- 5:34:26here GP is extensively used as a primary
- 5:34:31text searching tool it scans files for
- 5:34:34specified patterns and it can be used
- 5:34:36with regular Expressions as as well as
- 5:34:38simple strings as shown in this
- 5:34:46table strings is used to extract all
- 5:34:49printable character strings found in a
- 5:34:51file or files given as arguments it's
- 5:34:54useful in locating human readable
- 5:34:56content embedded in binary files for
- 5:34:59text files one can just use GP for
- 5:35:01example to search for the string mycore
- 5:35:03string in a spreadsheet you can use this
- 5:35:05command
- 5:35:08and this screenshot shows a search of a
- 5:35:10number of programs to see which ones
- 5:35:12have GPL licenses of various
- 5:35:21versions in this section you will learn
- 5:35:23about some additional text utilities
- 5:35:26that you can use for performing various
- 5:35:28actions on your Linux files such as
- 5:35:30changing the case of letters or
- 5:35:32determining the count of words lines and
- 5:35:34characters in a file the TR utility ised
- 5:35:37used to translate specified characters
- 5:35:40into other characters or to delete them
- 5:35:42the general syntax is as follows TR
- 5:35:45options set one and set two the items in
- 5:35:48the square brackets are optional TR
- 5:35:51requires at least one argument and
- 5:35:52accepts a maximum of two the first
- 5:35:55designated set one in this example list
- 5:35:58the characters in the text to be
- 5:36:00replaced or removed the second set two
- 5:36:03list the characters that are to be
- 5:36:04substituted for the characters listed in
- 5:36:06the first argument
- 5:36:08sometimes these sets need to be
- 5:36:09surrounded by apostrophes or single
- 5:36:11quotes in order to have the shell ignore
- 5:36:13that they mean something special to the
- 5:36:15Shell it's usually safe and may be
- 5:36:18required to use the single quotes around
- 5:36:21each of the sets as you'll see in these
- 5:36:23examples uh for example suppose you have
- 5:36:26a file named City containing several
- 5:36:28lines of a text in mixed case to
- 5:36:31translate all lowercase characters to
- 5:36:33uppercase at the command prompt type cat
- 5:36:36City pipe TR A- Z A-Z and press enter
- 5:36:54key T takes the output from any command
- 5:36:58and while sending to the standard output
- 5:36:59it also saves it in a file in other
- 5:37:02words it T's the output stream from the
- 5:37:05command one stream is displayed on the
- 5:37:07standard output and the other is saved
- 5:37:09to a file for example to list the
- 5:37:12contents of a directory on the screen
- 5:37:14and save the output to a file at the
- 5:37:17command prompt type ls- lpip T new file
- 5:37:21and press enter key typing cat new file
- 5:37:24will then display the output of ls--
- 5:37:30L WC or word count counts the number of
- 5:37:33lines words and characters in a file or
- 5:37:35a list of files opt are given in this
- 5:37:39table by default all three of these
- 5:37:41options are
- 5:37:46active cut is used for manipulating
- 5:37:49column based files and is designed to
- 5:37:51extract specific columns the default
- 5:37:53column separator is the tab character
- 5:37:56different Eliminator can be given as a
- 5:37:58command option for example to display
- 5:38:01the third column eliminated by a blank
- 5:38:03space at the command prompt Type ls- S
- 5:38:06pipe cut d d double quot space double
- 5:38:08quote then- F3 and then you press the
- 5:38:11enter
- 5:38:14key you have completed chapter 13 let's
- 5:38:17summarize the key Concepts covered the
- 5:38:21command line often allows the users to
- 5:38:23perform tasks more efficiently than the
- 5:38:26guey cat short for concatenate is used
- 5:38:29to read print and combined files Echo
- 5:38:33displays a line of text either on
- 5:38:35standard output or to place in a file
- 5:38:38said is a popular stream editor often
- 5:38:40used to filter and perform substitutions
- 5:38:43on files and Text data streams o is an
- 5:38:46interpretive programming language
- 5:38:48typically used as a data extraction and
- 5:38:51reporting tool sort is used to sort text
- 5:38:55files and output streams in either
- 5:38:57ascending or descending order unique
- 5:39:01eliminates duplicate entries in a text
- 5:39:03file paste combines fields from
- 5:39:06different files it can also extract and
- 5:39:08combine line from multiple sources join
- 5:39:12combines lines from two files based on a
- 5:39:14common field it works only if files
- 5:39:17share a common field split breaks up a
- 5:39:20large file into equal siiz segments
- 5:39:23regular expressions are text strings
- 5:39:24used for pattern matching the pattern
- 5:39:27can be used to search for a specific
- 5:39:28location such as the start or end of a
- 5:39:31line or a word grep searches the text
- 5:39:34files and data streams for patterns and
- 5:39:36can be used with regular Expressions TR
- 5:39:39translates characters copy standard
- 5:39:41input to standard output and handles
- 5:39:43special characters T saves a copy of
- 5:39:47standard output to a file while still
- 5:39:49displaying at the terminal WC for word
- 5:39:52count displays the number of lines words
- 5:39:55and characters in a file or group of
- 5:39:57files cut extracts columns from a file
- 5:40:01less views files a page at a time and
- 5:40:03allows scrolling in both directions head
- 5:40:06displays the first few few lines of a
- 5:40:07file or data stream or standard standard
- 5:40:10output by default it displays 10 lines
- 5:40:13pil displays the last few lines of a
- 5:40:15file or data stream on standard output
- 5:40:18by default it displays 10 lines strings
- 5:40:21extracts printable character strings
- 5:40:23from binary
- 5:40:27files by the end of this chapter you
- 5:40:29should be able to explain basic
- 5:40:31networking Concepts including types of
- 5:40:33networks and addressing issues configure
- 5:40:36Network interace faes and us and use
- 5:40:38basic networking utilities such as if
- 5:40:41config IP ping route and trace route use
- 5:40:45graphical and non-graphical browsers
- 5:40:47such as links w3m Firefox Chrome and
- 5:40:50Epiphany transfer files to and from
- 5:40:52clients and servers using both graphical
- 5:40:54and text mode applications such as
- 5:40:57filezilla FTP SFTP curl and
- 5:41:03wget a network is a group of computers
- 5:41:06and Computing devices connected together
- 5:41:08through communication channels such as
- 5:41:10cables or wireless media the computers
- 5:41:14connected over a network may be located
- 5:41:16in the same geographical area or spread
- 5:41:19across the world a network is used to
- 5:41:23allow the connected devices to
- 5:41:24communicate with each other enable
- 5:41:27multiple users to share devices over the
- 5:41:29network such as music and video servers
- 5:41:32printers and scanners share and manage
- 5:41:36information AC cross computers easily
- 5:41:39most organizations have both an internal
- 5:41:41Network and an internet connection for
- 5:41:43users to communicate with machines and
- 5:41:46people outside the
- 5:41:48organization the internet is the largest
- 5:41:51Network in the world and can be called
- 5:41:53the network of
- 5:41:58networks devices attached to a network
- 5:42:00must have at least one unique Network
- 5:42:03address identifier known as the IP or
- 5:42:06Internet Protocol address the address is
- 5:42:08essential for routing packets of
- 5:42:10information through the network
- 5:42:12exchanging information across the
- 5:42:14network requires using streams of small
- 5:42:17packets Each of which contains a piece
- 5:42:19of the information going from one
- 5:42:21machine to another these packets contain
- 5:42:24data buffers together with headers which
- 5:42:27contain information about where the
- 5:42:29packet is going to and coming from and
- 5:42:32where it fits in the sequence of packets
- 5:42:34that constitute the Stream Network
- 5:42:37Protocols are and software are rather
- 5:42:40complicated due to the diversity of
- 5:42:42machines and operating systems they must
- 5:42:44deal with as well as the fact that even
- 5:42:47very old standards must be
- 5:42:52supported there are two different types
- 5:42:55of IP addresses available IP V4 version
- 5:42:584 and IPv6 version 6 ipv4 is older and
- 5:43:03by far the most widely used while IPv6
- 5:43:05is newer and is designed to get past
- 5:43:07limitations inherent in the older
- 5:43:09standard and furnish many more possible
- 5:43:11addresses ip4 uses 32 bits for addresses
- 5:43:15there are only 4.3 billion unique
- 5:43:18addresses available furthermore many
- 5:43:20addresses are allotted in resered but
- 5:43:22not actually used ipv4 is considered
- 5:43:25inadequate for meeting future needs
- 5:43:27because the number of devices available
- 5:43:28on the global network has increased
- 5:43:30enormously in recent
- 5:43:32years IPv6 uses 128 bits for addresses
- 5:43:37this allows for 3.4 time 10 to the power
- 5:43:40of 38 unique addresses if you have a
- 5:43:43larger network of computers and want to
- 5:43:44add more you may want to move to IPv6
- 5:43:47because it provides more unique
- 5:43:49addresses however it can be complex to
- 5:43:51migrate to IPv6 the two protocols do not
- 5:43:54always interoperate well thus moving
- 5:43:56equipment and addresses to IPv6 require
- 5:44:00significant effort and has not been
- 5:44:02quite as fast as was originally intended
- 5:44:05we'll discuss ipv V4 more than IPv6 as
- 5:44:09you're more likely to deal with it one
- 5:44:11reason ipv4 has not disappeared is there
- 5:44:14are ways to effectively make many more
- 5:44:17addresses available by methods such as
- 5:44:19natat the network address translation
- 5:44:22natat enables sharing one IP address
- 5:44:24among many locally connected computers
- 5:44:26Each of which has a unique address only
- 5:44:28seen on the local network while this is
- 5:44:31used in organizational settings it's
- 5:44:33also used in simple home networks for
- 5:44:36example if you have a router hooked up
- 5:44:38to your internet provider such as a
- 5:44:40cable system it gives you one externally
- 5:44:43visible address but issues each device
- 5:44:46in your home an individual local
- 5:44:52address a 32-bit ipv4 address is divided
- 5:44:56into four 8bit sections called octets so
- 5:45:00here's an example note that octet is
- 5:45:02just another word for bite Network
- 5:45:05addresses are divided into five classes
- 5:45:07a b c d and e classes a B and C are
- 5:45:10classified into two parts Network
- 5:45:12addresses net ID and host address host
- 5:45:15ID the net ID is used to identify the
- 5:45:17network while the host ID is used to
- 5:45:19identify a host in the network class D
- 5:45:22is used for special multicast
- 5:45:24applications information is broadcast to
- 5:45:26multiple computers simultaneously and
- 5:45:29Class E is reserved for future use in
- 5:45:32this section you will learn about
- 5:45:33classes a b and c
- 5:45:38Class A addresses use the first octet of
- 5:45:41an IP address as their net ID and use
- 5:45:44the other three octets as their host ID
- 5:45:47the first bit of the first octet is
- 5:45:49always set to zero so you can only use
- 5:45:51seven bits for Unique Network numbers as
- 5:45:53a result there are a maximum of 126
- 5:45:56Class A networks available not
- 5:45:58surprisingly this was only feasible when
- 5:46:01there were very few unique networks with
- 5:46:03large numbers of hosts as the use of the
- 5:46:06internet expanded classes B and C were
- 5:46:09added in order to accommodate the
- 5:46:11growing the growing demand for
- 5:46:13independent
- 5:46:14networks each class a network can have
- 5:46:17up to 16.7 million unique hosts on its
- 5:46:20Network the range of host addresses is
- 5:46:23from 1.0.0 point0 to 12725 5.
- 5:46:32255.255 class B addresses use the first
- 5:46:35two octets of their IP address as their
- 5:46:38net ID and the last two octets as their
- 5:46:40host ID the first two bits of the first
- 5:46:43octet are always set to Binary 10 so
- 5:46:46there are a maximum of
- 5:46:4816,384 Class B networks the first octet
- 5:46:52of a Class B address has values from 128
- 5:46:55to 191 the introduction of Class B
- 5:46:58networks expanded the number of networks
- 5:47:01but but it soon became clear that a
- 5:47:03further level would be needed each class
- 5:47:05B Network can support a maximum of
- 5:47:1065,536 unique hosts on its Network the
- 5:47:13range of host addresses is from 128.0
- 5:47:16z.0 to
- 5:47:1819125
- 5:47:23255.255 Class C addresses use the first
- 5:47:26three octets of the IP address as their
- 5:47:29net ID in the last OCTA as their host ID
- 5:47:32the first three bits of the first OCTA
- 5:47:34are set to Binary 110 so so almost 2.1
- 5:47:37million Class C networks are available
- 5:47:39the first OCTA of a Class C address has
- 5:47:41values from 19 192 to 223 these are most
- 5:47:46common for smaller networks which don't
- 5:47:48have many unique hosts each class seed
- 5:47:51Network can support up to 256 unique
- 5:47:54hosts the range of host addresses is
- 5:47:57from n2.0 z.0 to 223
- 5:48:08typically a range of IP addresses are
- 5:48:10requested from your internet service
- 5:48:12provider your ISP by your organization's
- 5:48:15network administrator often your choice
- 5:48:18of which class of IP address you are
- 5:48:20given depends on the size of your
- 5:48:21network and expected growth needs if
- 5:48:24natat is an operation such as in a home
- 5:48:27network you only get one externally
- 5:48:29visible address you can assign IP
- 5:48:31addresses to computers over a network
- 5:48:34either manually or dynamically manual
- 5:48:37assignment adds static or never-changing
- 5:48:39addresses to the network dynamically
- 5:48:42assigned addresses can change every time
- 5:48:45you reboot or even more often the
- 5:48:47dynamic host C configuration protocol
- 5:48:50DHCP is used to assign IP
- 5:48:56addresses name resolution is used to
- 5:48:59convert numerical IP address values into
- 5:49:01a human readable format known as the
- 5:49:04host name for example 104.9
- 5:49:0858515 is the numerical IP address that
- 5:49:11refers to the host name white house.gov
- 5:49:14host names are much easier to remember
- 5:49:17given an IP address you can obtain its
- 5:49:19corresponding host name accessing the
- 5:49:21machine over the network becomes easier
- 5:49:24when you can type the host name instead
- 5:49:26of the IP address you can view your
- 5:49:28system's host name simply by typing host
- 5:49:32name with no argument the special host
- 5:49:34name Local Host is associated with the
- 5:49:36address 127.0.0.1 and describes the
- 5:49:40machine you are currently on which
- 5:49:42normally has additional Network related
- 5:49:44IP
- 5:49:48addresses let's get a feel for how the
- 5:49:51domain name server works on a recent
- 5:49:54Ubuntu system so first we need to log
- 5:49:57in and when you log in we'll open up a
- 5:50:00command line terminal because uh we're
- 5:50:02going to do all our operations from the
- 5:50:04command line so I have done that by
- 5:50:07right clicking on the desktop and then
- 5:50:09let me make a bigger
- 5:50:11font I might as well go full screen
- 5:50:14while I'm at it so there are a couple of
- 5:50:17important files on your system one is
- 5:50:20called Etc
- 5:50:25resolve. now on older Linux systems you
- 5:50:29didn't have all this information at the
- 5:50:31top you just had an important thing here
- 5:50:34name server 127 0.053 you more likely to
- 5:50:39find your name server is not a 1271
- 5:50:43which all 127 addresses are on the
- 5:50:45actual machine but 1 192168 that1 that1
- 5:50:50for instance would be a common thing um
- 5:50:54might point to your your wireless modem
- 5:50:57which is attached to your internet
- 5:50:59service provider for instance uh recent
- 5:51:03systems use a system D service called
- 5:51:05system D resolve d which works in a more
- 5:51:08complicated way it makes a DNS server on
- 5:51:13the local machine uh which caches the
- 5:51:15results of previous searches uh so we're
- 5:51:18not going to get into the details of
- 5:51:20that but uh that's a recent development
- 5:51:23that you'll find on newer machines
- 5:51:25another important file is ETC
- 5:51:29hosts this file is consulted before the
- 5:51:32domain name server is consulted so
- 5:51:36you'll see for instance here at the
- 5:51:37bottom we've got two machines on the
- 5:51:39local network we give their IP addresses
- 5:51:42and a name that we can use to get it
- 5:51:44them and you'll notice you can have more
- 5:51:46than one name tied to an IP address so
- 5:51:48for instance I could do ping
- 5:51:52Theodore and that's going to take me to
- 5:51:54200 or I could do ping uh
- 5:51:58Beaver takes me to the same
- 5:52:02machine now if I want to look at
- 5:52:04something which isn't specified in in
- 5:52:06that file or in fact I can do that host
- 5:52:09uh
- 5:52:10Theodore and I will go look at the file
- 5:52:14but if I want to get something out on
- 5:52:15the internet I could do L Linux
- 5:52:18foundation.org
- 5:52:20and I'll get the both the ip4 and the
- 5:52:23ip6 addresses here of the Linux
- 5:52:26foundation and also information about
- 5:52:29the mail services provided by the Linux
- 5:52:32Foundation I can do uh another utility
- 5:52:36for similar information is nslookup so
- 5:52:39I'll do that nslookup foundation.org
- 5:52:42links foundation.org and you see I got
- 5:52:45the same basic information a little more
- 5:52:47compactly I got here's the ip4 address
- 5:52:50and then the two ip6
- 5:52:53addresses another utility I can use is
- 5:52:56dig so let's do dig
- 5:52:58Linux foundation.org
- 5:53:03and you'll see I once again got the
- 5:53:06information about the IP address and
- 5:53:08then a lot more information about the
- 5:53:11search to find that server so that's
- 5:53:13just a little bit of what you can do
- 5:53:15with DNS and some of the files that are
- 5:53:17associated with
- 5:53:22it network configuration files are
- 5:53:25essential to ensure that interfaces
- 5:53:26function correctly they're located in
- 5:53:28the /etc directory tree however the
- 5:53:31exact files used have historically been
- 5:53:33dependent on the particular Linux
- 5:53:36distribution ution and version being
- 5:53:38used for dbn family configurations the
- 5:53:42basic network configuration files could
- 5:53:44be found under slcn Network while for
- 5:53:48red hat and Susi family systems one
- 5:53:51needed to inspect /c/ CYS config Network
- 5:53:54modern systems emphasize the use of
- 5:53:57network manager which we briefly discuss
- 5:54:00when we considered graphical system
- 5:54:02administration rather than keep up with
- 5:54:04all the files in/ Etc while the
- 5:54:07graphical versions of network manager do
- 5:54:09look somewhat different in different
- 5:54:10distributions the nmtui utility shown
- 5:54:14here varies almost not at all as does
- 5:54:18even more sparse NM CLI or command line
- 5:54:20interface utility if you are proficient
- 5:54:22in the use of goys by all means use them
- 5:54:25if you're working on a variety of
- 5:54:27systems the lower level utilities may
- 5:54:29make life
- 5:54:33easier network interfaces are a
- 5:54:35connection Channel between a device and
- 5:54:38a network physically network interfaces
- 5:54:41can proceed through a network interface
- 5:54:43card or it can be more abstractly
- 5:54:46implemented as software you can have
- 5:54:49multiple network interfaces operating at
- 5:54:51once specific interfaces can be brought
- 5:54:54up or activated or brought down
- 5:54:56deactivated at any time information
- 5:54:59about a particular network interface or
- 5:55:02all network interfaces can be reported
- 5:55:04by the IP and if config utilities which
- 5:55:08you may have to run as the super user or
- 5:55:10at least give the full path name I.E SLS
- 5:55:13spin if config IP is newer than if
- 5:55:17config and has far more capabilities but
- 5:55:19its output is uglier to the human eye
- 5:55:21some new Linux distributions do not
- 5:55:23install the older net tools package to
- 5:55:26which if config belongs and so you would
- 5:55:28have to install it if you want to use
- 5:55:32it to view the IP address you can do
- 5:55:36this SLS spin I address show to view the
- 5:55:40routing information slin I rout show IP
- 5:55:45is a very powerful program that can do
- 5:55:47many things older and more specific
- 5:55:50utilities such as if config and Route
- 5:55:52are often used to accomplish similar
- 5:55:54tasks a look at the relevant Man pages
- 5:55:57can tell you much more about these
- 5:56:02utilities ping is used to check whether
- 5:56:05or not a machine attached to the network
- 5:56:07can receive and send data I.E it
- 5:56:10confirms that the remote host is online
- 5:56:13and is responding to check the status of
- 5:56:15the remote host at the command prompt
- 5:56:18type ping and then the host name ping is
- 5:56:21frequently used for Network testing and
- 5:56:24management however its usage can
- 5:56:26increase Network load unacceptably hence
- 5:56:29you can abort the execution of ping by
- 5:56:31typing control C or by using the- C
- 5:56:33option which limits the number of
- 5:56:35packets that ping will send before it
- 5:56:37quits when when an execution stops a
- 5:56:40summary is
- 5:56:44displayed a network requires the
- 5:56:46connection of many nodes data moves from
- 5:56:49source to destination by passing through
- 5:56:51a series of routers and potentially
- 5:56:53across multiple networks servers
- 5:56:55maintain routing tables containing the
- 5:56:58addresses of each node in the network
- 5:57:00the IP routing protocols enable routers
- 5:57:02to build up a forwarding table that
- 5:57:04correlates final destinations with the
- 5:57:06next hop addresses one can use the route
- 5:57:09utility or the newer IP route command to
- 5:57:12view or change IP routing table to add
- 5:57:14delete or modify specific static routes
- 5:57:17to specific hosts or networks this table
- 5:57:20explains some commands that can be used
- 5:57:21to manage IP
- 5:57:31routing trace route is used to inspect
- 5:57:34the route which the data package it
- 5:57:36takes to reach the destination host
- 5:57:39which makes it quite useful for
- 5:57:40troubleshooting Network delays and
- 5:57:42errors by using trace route you can
- 5:57:45isolate connectivity issues between hops
- 5:57:48which helps resolve them faster to print
- 5:57:50the route taken by the packet to reach
- 5:57:52the network host at the command prompt
- 5:57:55type trace route and then the
- 5:58:01address now let's learn about some
- 5:58:03additional networking tools networking
- 5:58:05tool tools are very useful for
- 5:58:07monitoring and debugging network
- 5:58:09problems such as network connectivity
- 5:58:12and network
- 5:58:24traffic let's get started on using more
- 5:58:27networking tools to use more networking
- 5:58:30tools open the command prompt to query
- 5:58:32network interface connected to eth2 type
- 5:58:36pseudo eth tool eth0 and press enter to
- 5:58:41display all active connections and
- 5:58:43routing tables type netstat - R and
- 5:58:47press enter all active connections and
- 5:58:49routing tables are displayed to scan
- 5:58:51open ports on a network type pseudo nmap
- 5:58:56DSP
- 5:58:5810.0.2 do15 sl24 and press enter the
- 5:59:03open ports on a network are displayed
- 5:59:09browsers are used to retrieve transmit
- 5:59:12and explore information resources
- 5:59:14usually on the worldwide web Linux users
- 5:59:17commonly use both graphical and
- 5:59:18non-graphical browser applications the
- 5:59:21common graphical browsers used in Linux
- 5:59:23are Firefox Google Chrome chromium coner
- 5:59:29and Opera sometimes you either do not
- 5:59:31have a graphical environment to work in
- 5:59:34or have reason not to use it but still
- 5:59:36need to access web resources in such a
- 5:59:39case you can use non-graphical browsers
- 5:59:42such as
- 5:59:49these sometimes you need to download
- 5:59:51files and information but a browser is
- 5:59:53not the best choice either because you
- 5:59:55want to download multiple files or you
- 5:59:57want to perform the action from a
- 5:59:59command line or a script WG is a command
- 6:00:02line utility that can capably handle the
- 6:00:05following types of downloads large file
- 6:00:07downloads recursive downloads where a
- 6:00:10web page refers to other web pages and
- 6:00:13all are downloaded at once password
- 6:00:15required downloads and multiple file
- 6:00:18downloads to download a web page you
- 6:00:20simply type WG and then the URL and then
- 6:00:23you can read the downloaded page as a
- 6:00:25local file using a graphical or
- 6:00:27non-graphical
- 6:00:31browser besides downloading you may want
- 6:00:33to obtain information about a URL such
- 6:00:36as the source code being used curl can
- 6:00:39be used from the command line or a
- 6:00:40script to read such information curl
- 6:00:43also allows you to save the contents of
- 6:00:45a web page to a file as does wget you
- 6:00:49can read a URL using curl URL for
- 6:00:52example if you want to read
- 6:00:53freecodecamp.org type curl HTP
- 6:00:57freecodecamp.org it to get the contents
- 6:01:00of a web page and store it to a file
- 6:01:03type curl SL o save HTML and then the
- 6:01:07website address the contents of the main
- 6:01:10index file at the website will be saved
- 6:01:11in save.
- 6:01:16HTML secure shell SSH is a cryptographic
- 6:01:20network protocol used for secure data
- 6:01:22communication it's also used for remote
- 6:01:25services and other secure Services
- 6:01:27between two devices on the network and
- 6:01:29is very useful for administering systems
- 6:01:32which are not easily available to
- 6:01:34physically work on but to which you have
- 6:01:36remote access to log in a remote system
- 6:01:39using your same username you can just
- 6:01:41type SSH some system and press enter SSH
- 6:01:45then prompts you for the remote password
- 6:01:48you can also configure SSH to securely
- 6:01:50allow your remote access without typing
- 6:01:52a password each time if you want to run
- 6:01:56as another user you can do either
- 6:01:58s-l someone some system or SSH someone
- 6:02:02at some system to run a command on a
- 6:02:06remote system via SSH at the command
- 6:02:08primed you type SSH some system my
- 6:02:15command we can also move file securely
- 6:02:18using secure copy SCP between two
- 6:02:22networked hosts SCP uses the SSH
- 6:02:25protocol for transferring data to copy a
- 6:02:28local file to a remote system at the
- 6:02:30command prompt type STP then the local
- 6:02:32file and then the user at the remote
- 6:02:34system cl/ hom user and then you press
- 6:02:37enter you will receive a prompt for the
- 6:02:39remote password you can also configure
- 6:02:42SCP so that it does not prompt for a
- 6:02:44password for each
- 6:02:49transfer let's do a simple demonstration
- 6:02:52of using secure shell and secure copy
- 6:02:56between two virtual
- 6:02:58machines uh Ubuntu machine and a cnos
- 6:03:01machine so first from the Ubuntu machine
- 6:03:04let's try to log into the Centos machine
- 6:03:08well first I need to know the IP address
- 6:03:10of both machines so I can do that with
- 6:03:13IP and I'll say brief to get a condensed
- 6:03:16output um addr for address
- 6:03:20show and I can see my address on this
- 6:03:23machine is
- 6:03:2517216 249
- 6:03:27133 I'll do the same command on this
- 6:03:30Centos machine
- 6:03:37and you see the address is the same
- 6:03:39except for the last bite or octed which
- 6:03:41is 129 so first let's log into the C
- 6:03:44West machine from obuntu I do SSH
- 6:03:48student
- 6:03:50at
- 6:03:5217216
- 6:03:5624929 and it's the first time I'm doing
- 6:03:59this so it wants to make sure that I'm
- 6:04:01authentic so I say
- 6:04:03yes and now I have to give the
- 6:04:08password and it's fine I'm on the Centos
- 6:04:10machine as you can see from The Prompt
- 6:04:13now in that command I really didn't have
- 6:04:15to give student that because we're using
- 6:04:19student count on both machines but never
- 6:04:21hurts to do that so let me
- 6:04:25exit now let's do from the SOS machine
- 6:04:29Let's copy over
- 6:04:31directory using SCP over to the iunu
- 6:04:34machine so let me do SCP R for recursive
- 6:04:39to get the whole directory and
- 6:04:40everything underneath it uh and this
- 6:04:43time uh I won't see home student I'll
- 6:04:47copy the home student directory I won't
- 6:04:49bother saying student ad I'll just give
- 6:04:50the address
- 6:04:5317216
- 6:04:5424913 3 and I'll put it in the temp
- 6:04:58directory once again it wants to make
- 6:05:01sure that it's authentic so I'll say
- 6:05:04yes and once again I have to give the
- 6:05:07password and it's copied over and if I
- 6:05:10go over to the Ubuntu
- 6:05:12machine and I look in the temp
- 6:05:18directory oh see the account is now
- 6:05:20there the directory is now there so
- 6:05:23that's all there is to do a pretty
- 6:05:25simple demonstration of using secure
- 6:05:27shell and secure
- 6:05:34copy you have completed chapter 14 let's
- 6:05:37summarize the key Concepts covered the
- 6:05:40IP or Internet Protocol address is a
- 6:05:43unique logical Network address that is
- 6:05:45assigned to a device on a network ipv4
- 6:05:48uses 32 bits for addresses and IPv6 uses
- 6:05:51128 bits for addresses every IP address
- 6:05:54contains both a network and a host
- 6:05:56address field there are five classes of
- 6:05:59network addresses available a b c d and
- 6:06:02e DNS domain name system is used for
- 6:06:05converting Internet domain and host
- 6:06:07names to IP addresses the if config
- 6:06:11program is used to display current
- 6:06:13Active network interfaces the commands
- 6:06:16IP addr show and IP route show can be
- 6:06:19used to view IP addresses and routing
- 6:06:22information you can use ping to check if
- 6:06:24the remote host is alive and responding
- 6:06:27you can use the route utility program to
- 6:06:30manage IP routing you can monitor and
- 6:06:32debug networking problems using
- 6:06:34networking tools
- 6:06:36Firefox Google Chrome chromium and
- 6:06:38Epiphany are the main graphical browsers
- 6:06:40used in Linux non-graphical or text
- 6:06:44browsers used in Linux are links links
- 6:06:47and
- 6:06:48w3m you can use WG to download web pages
- 6:06:51you can use Curl to obtain information
- 6:06:53about URLs you can use SSH to run
- 6:06:56commands on remote systems we've reached
- 6:06:59the end of the course you should now
- 6:07:01have a good working knowledge of Linux
- 6:07:04from both a graphical and command line
- 6:07:07perspective I mentioned at the beginning
- 6:07:09of the course that there is a text based
- 6:07:11version of this course Linked In the
- 6:07:13video's description that version also
- 6:07:16has sections about the bass shell and
- 6:07:18scripting Printing and local security
- 6:07:21principles those won't be relevant to
- 6:07:23everybody but feel free to check that
- 6:07:25out if you want to learn about those
- 6:07:26topics so good luck as you use and
- 6:07:29administer Linux
About this transcript
This page contains the full transcript of Introduction to Linux – Full Course for Beginners by freeCodeCamp.org, generated from the public captions YouTube serves with the video. The transcript has 51,776 words across 7,886 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.