YouTube2Text

Introduction to Linux – Full Course for Beginners — Transcript

by freeCodeCamp.org · 51,776 words · 7,886 segments · language en · Watch on YouTube

Full transcript

  1. 0:00welcome to this introduction to Linux
  2. 0:01course I'm Bo K and I will be teaching
  3. 0:04this course this course is designed for
  4. 0:06computer users who have limited or no
  5. 0:08previous exposure to Linux whether
  6. 0:10they're working in an individual or
  7. 0:12Enterprise environment this course
  8. 0:15explores the various tools and
  9. 0:16techniques commonly used by Linux system
  10. 0:18administrators and endusers to achieve
  11. 0:21their day-to-day work in a Linux
  12. 0:23environment you will gain a good working
  13. 0:26knowledge of Linux and how to navigate
  14. 0:28through major Linux distributions system
  15. 0:32configurations and graphical interfaces
  16. 0:34of L Linux basic command line operations
  17. 0:37common applications of Linux and more
  18. 0:40upon completion of this training you
  19. 0:42should have a good working knowledge of
  20. 0:44Linux from both a graphical and command
  21. 0:47line perspective allowing you to easily
  22. 0:50navigate through any of the major Linux
  23. 0:53distributions the content of this course
  24. 0:55was developed by the Linux Foundation
  25. 0:59Who provided a Grant to make this course
  26. 1:01possible I've taken their primarily text
  27. 1:04based course and turned it into a
  28. 1:06video-based course throughout the course
  29. 1:09you will see some video segments that
  30. 1:11were developed by the Linux Foundation
  31. 1:13also you should know that sometimes
  32. 1:15throughout this course I put Linux
  33. 1:17commands on the screen like this the
  34. 1:19dollar sign at the beginning is not part
  35. 1:21of the command that just indicates the
  36. 1:23command should be typed into the system
  37. 1:25shell or terminal so if you're following
  38. 1:28along type everything after the dollar
  39. 1:30sign in the description of this video
  40. 1:33I've linked to a text based version of
  41. 1:35this course okay let's get
  42. 1:40started by the end of this chapter you
  43. 1:43should be able to describe the software
  44. 1:45environment required for this course and
  45. 1:48describe the three major Linux
  46. 1:50distribution
  47. 1:54families in order to fully benefit from
  48. 1:57this course you will need to have at
  49. 1:58least one link Linux distribution
  50. 2:00installed if you're not already familiar
  51. 2:03with the term distribution as it relates
  52. 2:05to Linux you soon will be you are about
  53. 2:08to learn some more details about the
  54. 2:10many available Linux distributions
  55. 2:13because there are literally hundreds of
  56. 2:15distributions I'm not covering them all
  57. 2:17in this course instead I'll focus on the
  58. 2:20three major distribution families the
  59. 2:24families in representative distributions
  60. 2:26this course will focus on are red hat
  61. 2:29family system sys including C OS and
  62. 2:32Fedora Susi family systems including
  63. 2:35open Susi and Debian family systems
  64. 2:38including Ubuntu and Linux
  65. 2:44Mint I'm about to tell you more about
  66. 2:46red hat Susi and Debian well this course
  67. 2:50focuses on these three major Linux
  68. 2:52distribution families as long as there
  69. 2:54are talented contributors the families
  70. 2:56of distributions and the distributions
  71. 2:58within these families will continue to
  72. 3:00change and grow people see a need and
  73. 3:03develop special configurations and
  74. 3:05utilities to respond to the need
  75. 3:08sometimes that effort creates a whole
  76. 3:09new distribution of Linux sometimes that
  77. 3:12e effort will leverage an existing
  78. 3:14distribution to expand the members of an
  79. 3:16existing
  80. 3:20family Red Hat Enterprise Linux or Rel
  81. 3:25heads the family that includes cnos cnos
  82. 3:28stream fedora and Oracle Linux Fedora
  83. 3:32has a close relationship with re and
  84. 3:34contains significantly more software
  85. 3:37than Red Hats Enterprise version one
  86. 3:40reason for this is that a diverse
  87. 3:41Community is involved in building Fedora
  88. 3:44with many contributors who do not work
  89. 3:46for Red Hat furthermore it's used as a
  90. 3:49testing platform for future real
  91. 3:52releases in this course we'll mainly use
  92. 3:54syn OS stream from the Red Hat Family
  93. 3:57the basic version of CN OS is also
  94. 3:59virtually identical to Rel the most
  95. 4:02popular Linux distribution in Enterprise
  96. 4:05environments however cnos 8 has no more
  97. 4:09scheduled updates the replacement is
  98. 4:11cnos 8 stream some of the key facts
  99. 4:14about the red hat distribution family
  100. 4:16are Fedora serves as an upstream testing
  101. 4:19platform for real cnos is a close clone
  102. 4:22of real while Oracle Linux is mostly a
  103. 4:25copy with some changes it supports
  104. 4:27Hardware platforms such as Intel x86 arm
  105. 4:31itanium power PC and IBM system Z it
  106. 4:34uses the Yum and dnf RPM based yum
  107. 4:37package managers uh to install update
  108. 4:40and remove packages in the system re is
  109. 4:43widely used by Enterprise which hosts
  110. 4:45their own
  111. 4:50systems the Susi family and their the
  112. 4:53relationship between Susi and open Susi
  113. 4:57is similar to the one described between
  114. 4:59real cnos Idora we use open Susi as the
  115. 5:04reference distribution for the Susi
  116. 5:06family as it's available to end users at
  117. 5:08no cost because the two products are
  118. 5:11extremely similar the material that
  119. 5:13covers open Susi can typically be
  120. 5:16applied to SLE with few problems some of
  121. 5:20the key facts about the Susi family are
  122. 5:23the Susi Linux Enterprise server or SLE
  123. 5:26is Upstream from open Susi it uses the
  124. 5:30RPM based zipper package manager which
  125. 5:33we'll cover later to install update and
  126. 5:36remove packages in the system it
  127. 5:38includes the yast or yet another setup
  128. 5:41tool application for system
  129. 5:43administration purposes slas is widely
  130. 5:46used in retail and many other
  131. 5:52sectors the Debian distribution is
  132. 5:55Upstream for several other distributions
  133. 5:57including auntu in turn a Von 2 is
  134. 6:00Upstream for Linux Mint and a number of
  135. 6:02other distributions it's commonly used
  136. 6:04on both servers and desktop computers
  137. 6:07Debian is a Pure open- Source Community
  138. 6:10project which is not owned by any
  139. 6:12Corporation and has a strong focus on
  140. 6:14stability and dbm provides by far the
  141. 6:17largest and most complete software
  142. 6:19repository to its users of any Linux
  143. 6:23distribution Ubuntu aims to at providing
  144. 6:26a good compromise between long-term
  145. 6:28stability and ease of use since autu
  146. 6:31gets most of its packages from Debian
  147. 6:33stable Branch it also has access to a
  148. 6:36very large software repository for those
  149. 6:39reasons we will use auntu LTS or
  150. 6:41long-term support as the reference to
  151. 6:44the dbm family distributions for this
  152. 6:46course some key facts about the dbm
  153. 6:49family are the dbm family is Upstream
  154. 6:52for Ubuntu and yuntu is Upstream for
  155. 6:55Linux Mint and others it uses the dpkg
  156. 6:59based AP package manager which we'll
  157. 7:03cover later in detail to install update
  158. 7:06and remove packages in the system Ubuntu
  159. 7:09has been widely used for cloud
  160. 7:12deployments while and while Ubuntu is
  161. 7:14built on top of Debian and is gnome
  162. 7:17based under the hood it differs visually
  163. 7:19from the interface on standard Debian as
  164. 7:22well as other
  165. 7:26distributions so in conclusion there are
  166. 7:29three m Major Distribution families
  167. 7:30within Linux Red Hat Susi and Debian in
  168. 7:34this course we'll work with
  169. 7:36Representative members of all of these
  170. 7:38families
  171. 7:42throughout by the end of this chapter
  172. 7:44you should be able to define the common
  173. 7:47terms associated with Linux and discuss
  174. 7:50the components of a Linux distribution
  175. 7:53in order for you to get the most out of
  176. 7:55this course we recommend that you have
  177. 7:57Linux installed on a machine that you
  178. 7:59can use throughout this course you can
  179. 8:02use this brief installation guide
  180. 8:04preparing your computer for Linux
  181. 8:06training it will help you to select a
  182. 8:08Linux distribution to install decide on
  183. 8:11whether you want to do a standalone pure
  184. 8:13Linux machine or a dual boot one whether
  185. 8:16to do a physical or virtual install and
  186. 8:19more and then it guides you through the
  187. 8:21steps I'll also cover installation soon
  188. 8:24well we have not covered everything in
  189. 8:26great detail but keep in mind that most
  190. 8:28of the documentation in Linux is
  191. 8:31actually already on your system in the
  192. 8:33form of band Pages which we'll discuss
  193. 8:36in great detail later whenever you do
  194. 8:38not understand something or want to know
  195. 8:40more about a command program topic or
  196. 8:42utility you can just type man and then
  197. 8:45the topic at the command line so I'll
  198. 8:47just assume you're thinking this way so
  199. 8:49I won't constantly repeat for more
  200. 8:52information look at the man page for
  201. 8:54this topic on a related note throughout
  202. 8:57the course we'll use a shorthand that is
  203. 9:00common in the open-source Community when
  204. 9:03referring to cases where the user has to
  205. 9:05make a choice of what to enter like a
  206. 9:08name of a program or file we use the
  207. 9:10shorthand Fu to represent the to
  208. 9:13basically represent insert file name
  209. 9:15here so we're not actually suggesting
  210. 9:17that you manipulate files or install
  211. 9:19Services called Foo the best way to
  212. 9:22learn Linux is by doing it so make sure
  213. 9:25to try things out yourself as you follow
  214. 9:27along you'll need to have a Linux system
  215. 9:30up and running that can either be a
  216. 9:32native Linux system on your Hardware
  217. 9:35running through a live USB stick or CD
  218. 9:38or a virtual machine running through a
  219. 9:40hypervisor we'll show you all these
  220. 9:42methods so let's get
  221. 9:44going before you begin using Linux you
  222. 9:47need to be aware of some basic terms
  223. 9:49such as kernel distribution boot loader
  224. 9:53service file system X Windows system
  225. 9:57desktop environment and command line
  226. 10:01these are very commonly used by the
  227. 10:03Linux
  228. 10:04Community the kernel is considered the
  229. 10:06brain of the Linux operating system it
  230. 10:09controls the hardware and makes the
  231. 10:11hardware interact with the
  232. 10:13applications an example of a kernel is
  233. 10:15the Linux kernel the most recent Linux
  234. 10:18kernel along with past Linux kernels can
  235. 10:21be found at the kernel.org
  236. 10:24website a distribution also known as
  237. 10:27dros is a collection of programs
  238. 10:29combined with the Linux kernel to make
  239. 10:31up a linux-based operating system some
  240. 10:34common examples of a distribution are
  241. 10:36red hat Enterprise Linux Fedora Ubuntu
  242. 10:41and
  243. 10:42gentu the boot loader as the name
  244. 10:44implies is a program that Boots the
  245. 10:46operating system two examples of a boot
  246. 10:49loader are grub and isol
  247. 10:52Linux a service is a program that runs
  248. 10:54as a background process some examples of
  249. 10:57the service are a
  250. 11:00httpd nfsd
  251. 11:03ntpd ftpd and name
  252. 11:06d a file system is a method for storing
  253. 11:09and organizing files in Linux some
  254. 11:12examples of file systems are
  255. 11:15ext3
  256. 11:17ext4 fat xfs and butter
  257. 11:21FS the X Windows system provides the
  258. 11:24standard toolkit and protocol to build
  259. 11:26graphical user interfaces on nearly all
  260. 11:29Linux systems the desktop environment is
  261. 11:32a graphical user interface on top of the
  262. 11:35operating system gome KDE xfce and
  263. 11:40fluxbox are some examples of the desktop
  264. 11:43environment the command line is an
  265. 11:45interface for typing commands on top of
  266. 11:48the operating
  267. 11:49system the shell is the command line
  268. 11:52interpreter that interprets the command
  269. 11:54line input and instructs the operating
  270. 11:57system to perform any necessary test
  271. 11:59tasks and commands for example bash TC
  272. 12:03shell and
  273. 12:08zshell suppose you've been assigned to a
  274. 12:11project building a product for a Linux
  275. 12:14platform project requirements include
  276. 12:16making sure that project works properly
  277. 12:18on the most widely used Linux
  278. 12:21distributions to accomplish this you
  279. 12:23need to learn about the different
  280. 12:25components services and configurations
  281. 12:29associated with each distribution we're
  282. 12:31about to look at how you would go about
  283. 12:33doing exactly that so what is a Linux
  284. 12:36distribution and how does it relate to
  285. 12:38the Linux kernel the Linux kernel is the
  286. 12:42core of the operating system a full
  287. 12:44Linux distribution consists of the
  288. 12:46kernel plus a number of other software
  289. 12:48tools for file related operations user
  290. 12:51management and software package
  291. 12:53management each of these tools provides
  292. 12:55a part of the complete system each tool
  293. 12:58is often its own separate project with
  294. 13:00its own developers working to perfect
  295. 13:02that piece of the system while the most
  296. 13:05recent Linux kernel and earlier versions
  297. 13:08can always be found in the Linux kernel
  298. 13:10archives Linux distributions may be
  299. 13:13based on different kernel versions for
  300. 13:15example the very popular real 8
  301. 13:17distribution is based on the 4.18 Kernel
  302. 13:20which is not new but is extremely stable
  303. 13:23other distributions may move move more
  304. 13:26quickly in adopting the latest kernel
  305. 13:28releases it's important to note that the
  306. 13:30kernel is not an All or Nothing
  307. 13:33proposition for example re and C OS have
  308. 13:37Incorporated many of the most the more
  309. 13:39recent kernel improvements into their
  310. 13:41older versions as have auntu op sui SL
  311. 13:45and more examples of other essential
  312. 13:47tools and and ingredients provided by
  313. 13:49distributions include the C and C++ and
  314. 13:52claim compilers the GDB de debugger the
  315. 13:55core system libraries applications need
  316. 13:58to to link with in order to run the
  317. 14:01low-level interface for drawing graphics
  318. 14:03on the screen as well as the higher
  319. 14:06level desktop environment and the system
  320. 14:08for installing and updating the various
  321. 14:10components including the C the kernel
  322. 14:13itself in all distributions come with a
  323. 14:15rather complete Suite of applications
  324. 14:18already
  325. 14:21installed the vast variety of Linux
  326. 14:24distributions are designed to cater to
  327. 14:26many different audiences and or
  328. 14:29organizations according to their
  329. 14:31specific needs and tastes however large
  330. 14:34organizations such as companies and
  331. 14:36governmental institutions and other
  332. 14:38entities tend to choose the major
  333. 14:41commercially supported distributions
  334. 14:44from Red Hat Susi and canle which is
  335. 14:48iunu SOS and C OS stream are popular
  336. 14:51free alternatives to Red Hat Enterprise
  337. 14:53Linux real and are often used by
  338. 14:55organizations that are comfortable
  339. 14:57operating without paid techn technical
  340. 14:59support huntu and pedora are widely used
  341. 15:02by developers and are also popular in
  342. 15:04the educational realm scientific Linux
  343. 15:07is favored by the scientific research
  344. 15:09Community for its compatibility with
  345. 15:11scientific and mathematical software
  346. 15:14packages both cnos variants are binary
  347. 15:17compatible with real which means in most
  348. 15:20cases binary software packages will
  349. 15:22install properly across the
  350. 15:24distributions many commercial
  351. 15:25Distributors including Red Hat Ubuntu
  352. 15:27Susi and or Le provide long-term fee
  353. 15:31based support for their distributions as
  354. 15:33well as hardware and software
  355. 15:35certification all major distributions
  356. 15:37provide update services for keeping your
  357. 15:39system primed with the latest security
  358. 15:41and Bug fixes and performance
  359. 15:43enhancements as well as provide online
  360. 15:46support
  361. 15:50resources you have completed chapter 2
  362. 15:53let's summarize the key Concepts covered
  363. 15:56Linux borrows heavily from the Unix
  364. 15:58operating system
  365. 15:59with which its creators were well-versed
  366. 16:01Linux accesses many features and
  367. 16:04services through files and filik objects
  368. 16:07Linux is a fully multitasking multi-user
  369. 16:10operating system with built-in
  370. 16:12networking and service processes known
  371. 16:14as dam some of the more common terms
  372. 16:17used in Linux are kernel distribution
  373. 16:20bootloader service file system X window
  374. 16:23system desktop environment and command
  375. 16:25line and a full Linux distribution
  376. 16:28consists of the kernel plus a number of
  377. 16:31other software tools for file related
  378. 16:33operations user management and software
  379. 16:36package
  380. 16:41management by the end of this chapter
  381. 16:43you should be able to identify Linux
  382. 16:45file systems identify the differences
  383. 16:48between partitions and file systems
  384. 16:51describe the boot process and install
  385. 16:54Linux on a computer the Linux boot
  386. 16:57process is the procedure for for
  387. 16:59initializing the system it consists of
  388. 17:01everything that happens from when the
  389. 17:03computer is first switched on until the
  390. 17:06user interface is fully operational
  391. 17:09having a good understanding of the steps
  392. 17:11in the boot process may help you with
  393. 17:13troubleshooting problems as well as with
  394. 17:16tailoring the computer's performance to
  395. 17:19your
  396. 17:20needs on the other hand the boot process
  397. 17:22can be rather Technical and you can
  398. 17:24start using Linux without knowing all
  399. 17:26the details
  400. 17:30starting an x86 based Linux system
  401. 17:33involves a number of steps when the
  402. 17:35computer's powered on the basic input
  403. 17:37output system or bios in initializes the
  404. 17:40hardware including the screen and
  405. 17:42keyboard and tests the main memory this
  406. 17:45process is also called post power on
  407. 17:48self test the bio software is stored on
  408. 17:51a ROM chip on the motherboard after this
  409. 17:54the remainder of the boot process is
  410. 17:56controlled by the operating system
  411. 18:02once the post is completed the system
  412. 18:04control passes from the BIOS to the
  413. 18:06bootloader the boot loader is usually
  414. 18:08stored on one of the hard diss in the
  415. 18:10system either in the boot sector for
  416. 18:13traditional bios or MBR systems or the
  417. 18:17EFI partition for more recent or unified
  418. 18:20extensible firmware interfaces or EFI
  419. 18:22ufi systems up to this stage the machine
  420. 18:25does not access any mass storage media
  421. 18:28there after information on date time and
  422. 18:31the most important peripherals are
  423. 18:33loaded from the seos values after
  424. 18:35technology used for the battery powered
  425. 18:37memory store which allows the system to
  426. 18:39keep track of the date and time when
  427. 18:42even when it's powered off a number of
  428. 18:44boot loaders exist for Linux the most
  429. 18:46common ones are grub for Grand unified
  430. 18:49boot loader isol Linux for booting from
  431. 18:51removable media and dos uboot for
  432. 18:54booting on embedded devices appliances
  433. 18:57most Linux boot loaders can present a
  434. 18:59user interface for choosing alternative
  435. 19:01options for booting Linux and even other
  436. 19:05op operating systems that might be
  437. 19:06installed when booting Linux the boot
  438. 19:09loader is responsible for loading the
  439. 19:11kernel image and the initial Ram disc or
  440. 19:14file system into
  441. 19:19memory the boot loader has two distinct
  442. 19:22stages for systems using the BIOS MBR
  443. 19:25method the bootloader resides at the
  444. 19:27first sector of the hard disk also known
  445. 19:30as the master boot record the size of
  446. 19:33the MBR is just 512 bytes in this stage
  447. 19:36the bootloader examines the partition
  448. 19:38table and finds a bootable partition
  449. 19:41once it finds a bootable partition it
  450. 19:43then searches for the second stage boot
  451. 19:45loader for example grub and loads it
  452. 19:47into RAM for systems using the EFI
  453. 19:51slfi method UEFI firmware reads its boot
  454. 19:55manager data to determine which UEFI
  455. 19:57application is to be launched and from
  456. 19:59where the firmware then launches the
  457. 20:02UEFI application for example grub as
  458. 20:05defined in the boot entry in the
  459. 20:07firmware boot manager the second stage
  460. 20:10boot loader resides under slash boot a
  461. 20:13splash screen is displayed which allows
  462. 20:15us to choose which operating system to
  463. 20:17boot after choosing the OS the boot lead
  464. 20:20boot the boot loader loads the Kel of
  465. 20:23the selected operating system into RAM
  466. 20:25and passes control to it kernels are
  467. 20:28almost always compressed so its first
  468. 20:30job is to uncompress itself after this
  469. 20:33it will check and analyze the system
  470. 20:35hardware and initialize any hardware
  471. 20:37device drivers built into the
  472. 20:41kernel the init Ram FS file system image
  473. 20:45contains programs and binary files that
  474. 20:47perform all actions needed to mount the
  475. 20:49proper root file system like providing
  476. 20:52kernel functionality for the needed file
  477. 20:54system and device drivers for mass
  478. 20:56storage controllers with a facility
  479. 20:58called udev for user device which is
  480. 21:00responsible for figuring out which
  481. 21:02devices are present locating the device
  482. 21:05drivers they need to operate properly
  483. 21:07and loading them after the root file
  484. 21:09system has been found it's checked for
  485. 21:11errors and mounted the mount program
  486. 21:14instructs the operating system that a
  487. 21:16file system is ready for use and
  488. 21:19Associates it with a particular point in
  489. 21:21the overall hierarchy of the file system
  490. 21:24the mount point if this is successful
  491. 21:26the the init Ram FS is is cleared from
  492. 21:29RAM and the init program from the root
  493. 21:31file system is executed init handles the
  494. 21:34mounting and pivoting over to the final
  495. 21:36real root file system if special
  496. 21:39Hardware drivers are needed before the
  497. 21:41mass storage can be accessed they must
  498. 21:43be in the init ramfs
  499. 21:48image near the end of the boot process
  500. 21:50init starts a number of text mode login
  501. 21:53prompts these enable you to type your
  502. 21:55username followed by your password and
  503. 21:58to eventually get a command shell
  504. 22:01however if you're running a system with
  505. 22:03a graphical login interface you'll not
  506. 22:06see these at first usually the default
  507. 22:08command shell is Bash but there are a
  508. 22:11number of other Advanced command shells
  509. 22:14available the shell prints a text prompt
  510. 22:17indicating it is ready to accept
  511. 22:19commands after the user types the
  512. 22:21command and presses enter the command is
  513. 22:24executed and another prompt is displayed
  514. 22:27after the command is done
  515. 22:32the boot loader loads the kernel and an
  516. 22:35initial Ram based file system into
  517. 22:37memory so it can be used directly by the
  518. 22:40kernel when the kernel is loaded in Ram
  519. 22:43it immediately initializes and
  520. 22:45configures the computer's memory it also
  521. 22:48configures all the hardware attached to
  522. 22:50the system this includes all processors
  523. 22:53IO subsystems storage devices and more
  524. 22:56the kernel also loads some necess are
  525. 22:58user space
  526. 23:03applications once the kernel has set up
  527. 23:05all its hardware and mounted the root
  528. 23:07file system the kernel runs the sbin
  529. 23:10init this then becomes the initial
  530. 23:13process which then starts other
  531. 23:15processes to get the system running most
  532. 23:17other processes on the system Trace
  533. 23:19their origin ultimately to init
  534. 23:22exceptions include the so-called kernel
  535. 23:25processes these are started by the
  536. 23:27kernel directly and their job is to
  537. 23:29manage internal operating system details
  538. 23:32besides starting the system init is
  539. 23:35responsible for keeping the system
  540. 23:37running and for shutting it down cleanly
  541. 23:40one of it one of its responsibilities is
  542. 23:42to act when necessary as a manager for
  543. 23:45all non-el processes it cleans up after
  544. 23:48them upon completion and restarts user
  545. 23:51login Services as needed when users log
  546. 23:54in and out and does the same for other
  547. 23:56background system services
  548. 23:59traditionally this process startup was
  549. 24:01done using conventions that date back to
  550. 24:03the
  551. 24:041980s and the system V variety of Unix
  552. 24:08this serial process had the system
  553. 24:10passing through a sequence of run levels
  554. 24:12containing collections of scripts that
  555. 24:14start and stop Services each run level
  556. 24:17supported a different mode of running
  557. 24:19the system with within each run level
  558. 24:22Individual Services could be set to run
  559. 24:24or to be shut down if running however
  560. 24:27all major distribu s have moved away
  561. 24:29from this sequential runlevel method of
  562. 24:32system initialization although they
  563. 24:34usually emulate many system V utilities
  564. 24:37for compatibility
  565. 24:39purposes next we'll discuss the new
  566. 24:41methods of which system MD has become
  567. 24:47dominant systems with system D start up
  568. 24:50faster than those with earlier init
  569. 24:52methods this is largely because it
  570. 24:55replaces a serialized set of steps with
  571. 24:58aggressive pitalization techniques which
  572. 25:01permits multiple services to be
  573. 25:03initiated simultaneously it has been
  574. 25:06adapted by all major distributions and
  575. 25:09so we'll not discuss the older system V
  576. 25:11method or upstart which has become a
  577. 25:13dead end complicated Startup shell
  578. 25:15scripts are replaced with simpler
  579. 25:17configuration files which enumerate what
  580. 25:20has to be done before a service is
  581. 25:22started how to execute service startup
  582. 25:25and what conditions the service should
  583. 25:26indicate have been accom accomplished
  584. 25:29when startup is finished one thing to
  585. 25:31note is that s spinit now just points to
  586. 25:34lib system d/ systemd so system D takes
  587. 25:38over the init process one system D
  588. 25:41command system control is used for most
  589. 25:44basic tasks while we have not yet talked
  590. 25:47about working at the command line here's
  591. 25:49a brief listing of its use
  592. 26:01think of a refrigerator that has
  593. 26:03multiple shelves that can be used for
  594. 26:05storing various items these shelves help
  595. 26:08you organize the grocery items by shape
  596. 26:11size type Etc the same concept applies
  597. 26:14to a file system which is the embodiment
  598. 26:17of a method of storing and organizing
  599. 26:19arbitrary collections of data in a human
  600. 26:22usable form different types of file
  601. 26:25systems supported by Linux include
  602. 26:28conventional disk file systems flash
  603. 26:31storage file
  604. 26:33systems database file systems and
  605. 26:37special purpose file
  606. 26:39systems this section will describe the
  607. 26:41standard file system layout shared by
  608. 26:44most Linux
  609. 26:49distributions a partition is a
  610. 26:52physically contigous section of a dis or
  611. 26:55what appears to be so in some Advanced
  612. 26:56setups a file system is a method of
  613. 27:00storing or finding files on a hard disk
  614. 27:03usually in a partition one can think of
  615. 27:05a partition as a container in which a
  616. 27:08file system resides although in some
  617. 27:10circumstances a file system can span
  618. 27:13more than one partition if one uses
  619. 27:16symbolic links which we'll discuss much
  620. 27:18later a comparison between file systems
  621. 27:21in Windows and Linux is shown in this
  622. 27:24table
  623. 27:33Linux systems store their important
  624. 27:35files according to a standard layout
  625. 27:37called the file system hierarchy
  626. 27:40standard which has long been maintained
  627. 27:43by the Linux Foundation having a
  628. 27:45standard is designed to ensure that
  629. 27:47users administrators and developers can
  630. 27:50move between distributions without
  631. 27:52having to relearn how the system is
  632. 27:55organized Linux uses the slash care to
  633. 27:58separate paths unlike Windows which uses
  634. 28:01the backslash and it does not have
  635. 28:03multiple Drive letters multiple drives
  636. 28:05and or partitions are mounted as
  637. 28:08directories in the single file system
  638. 28:11removable media such as USB drives and
  639. 28:13CDs and DVDs will show up as mounted at
  640. 28:17run/ media your username slis Lael for
  641. 28:21recent Linux systems or under SL media
  642. 28:24for older distributions for example if
  643. 28:27your username is student a USB pin Drive
  644. 28:30labeled Fedora might end up being found
  645. 28:32at run/ media student Fedora and a file
  646. 28:37readme.txt on that dis would be at run/
  647. 28:41media student Fedora readme.txt all
  648. 28:45Linux file systems are case sensitive so
  649. 28:49these different ways of spelling boot
  650. 28:51represent three different directories or
  651. 28:53folders many distributions distinguish
  652. 28:56between core utilities needed for proper
  653. 28:58system operation and other programs and
  654. 29:01place the ladder in directories under SL
  655. 29:04USR or user now let's learn about
  656. 29:07viewing the file system hierarchy from
  657. 29:10the graphical interface in
  658. 29:13yuntu Click the file manager icon on the
  659. 29:16left panel by default it explores your
  660. 29:18home
  661. 29:19directory to see all directories under
  662. 29:22root directory click computer on the
  663. 29:24left places pane inside this window
  664. 29:29doubleclick the Etsy directory to open
  665. 29:32it double click aahi and press control L
  666. 29:36to see the current location the current
  667. 29:39path appears at the top of the window
  668. 29:41the path for this is Etsy
  669. 29:44aah now let's learn about viewing the
  670. 29:47file system hierarchy from the graphical
  671. 29:49user interface in open
  672. 29:51Susi click activities on the top left
  673. 29:54corner of the screen
  674. 29:56Corner click the file manager your icon
  675. 29:58on the left panel by default it explores
  676. 30:01your home
  677. 30:03directory click computer on the left
  678. 30:05places pane inside this window you can
  679. 30:08see all directories under the root
  680. 30:11directory doubleclick the Etsy directory
  681. 30:14to open
  682. 30:16it to see the current location
  683. 30:18doubleclick the avahi folder and press
  684. 30:21control L the current path appears at
  685. 30:24the top of the window the path for this
  686. 30:27is Etsy
  687. 30:32aahi suppose you intend to buy a new car
  688. 30:36what factors do you need to consider to
  689. 30:38make a proper Choice requirements which
  690. 30:41need to be taken into account include
  691. 30:43the size needed to fit your family in
  692. 30:45the vehicle the type of engine and gas
  693. 30:48economy your expected budget and
  694. 30:50available financing options reliability
  695. 30:54record and after Sal Services Etc
  696. 30:57similarly determining which distribution
  697. 30:59to deploy also requires planning here
  698. 31:03you can see some but not all choices
  699. 31:06note that many embedded Linux systems
  700. 31:08use custom crafted contents rather than
  701. 31:11Android or yako some questions worth
  702. 31:14thinking about before deciding on a
  703. 31:17distribution include what is the main
  704. 31:19function of the system what types of
  705. 31:22packages are important to the
  706. 31:25organization for example web server word
  707. 31:27process processing Etc how much hard
  708. 31:30disk space is required and how much is
  709. 31:32available for example when installing
  710. 31:35Linux on an embedded device space is
  711. 31:37usually
  712. 31:38constrained how often are packages
  713. 31:42updated how long is the support cycle
  714. 31:44for each release for example LTS
  715. 31:47releases have long-term support do you
  716. 31:50need kernel customization from a vendor
  717. 31:52or a third party what Hardware are you
  718. 31:55running on for example it might be x86
  719. 31:57arm or PPC do you need long-term
  720. 32:00stability can you accept or need a more
  721. 32:03volatile Cutting Edge system running the
  722. 32:05latest
  723. 32:10software the partition layout needs to
  724. 32:12be decided at the time of installation
  725. 32:15it can be difficult to change later
  726. 32:17while Linux systems handle multiple
  727. 32:19partitions by mounting them at specific
  728. 32:21points in the file system and you can
  729. 32:24always modify the design later it's
  730. 32:26always easier to try to get it right to
  731. 32:28begin with nearly all installers provide
  732. 32:32a reasonable default layout with either
  733. 32:34all space dedicated to normal files on
  734. 32:37one big partition and a smaller swap
  735. 32:39partition or with separate partitions
  736. 32:42for some space sensitive areas like home
  737. 32:45and VAR you may need to override the
  738. 32:47defaults and do something different if
  739. 32:49you have special needs or if you want to
  740. 32:51use more than one dis
  741. 32:58all installations include the bare
  742. 33:00minimum software for running a Linux
  743. 33:03distribution most installers also
  744. 33:05provide options for adding categories of
  745. 33:08software common applications such as the
  746. 33:11Firefox web browser and Libra office
  747. 33:14office suite developer tools like the V
  748. 33:17and emex text editors which we'll
  749. 33:20explore later and other popular services
  750. 33:22such as the Apache web server tools or
  751. 33:25mySQL database are usually included
  752. 33:28in addition for any system with a
  753. 33:30graphical desktop a chosen desktop such
  754. 33:33as nomer KDE is installed by default all
  755. 33:36installers set up some initial security
  756. 33:38features on the new system one basic
  757. 33:41step includes setting the password for
  758. 33:43the super user rout and setting up an
  759. 33:46initial user in some cases only an
  760. 33:49initial user set up direct root login is
  761. 33:52not configured and root access requires
  762. 33:54logging in first as a normal user and
  763. 33:56then using PSE sudo as we'll describe
  764. 33:58later some distributions will also
  765. 34:01install more advanced security
  766. 34:02Frameworks such as SE Linux or app armor
  767. 34:06for example all red hat based systems
  768. 34:08including Fedora and CN OS always use SE
  769. 34:11Linux by default and yuntu comes with
  770. 34:14app armor up and
  771. 34:19running like other operating systems
  772. 34:22Linux distributions are provided on
  773. 34:24removable media such as USB drives and
  774. 34:27CDs or D DVDs most Linux distributions
  775. 34:30also support booting a small image and
  776. 34:32downloading the rest of the system over
  777. 34:34the network these small images are
  778. 34:36usable on Media or as Network boot
  779. 34:38images in which case it is possible to
  780. 34:41perform and install without using any
  781. 34:43local media many installers can do an
  782. 34:46installation completely automatically
  783. 34:48using a configuration file to specify
  784. 34:51installation options this file is called
  785. 34:54a Kickstart file for Red Hat based
  786. 34:56systems and Auto yes profile for Susi
  787. 34:59based systems and a preed file for
  788. 35:02Debian based systems each distribution
  789. 35:05provides its own documentation and tools
  790. 35:08for creating and managing these
  791. 35:14files the actual installation process is
  792. 35:17pretty similar for all
  793. 35:19distributions after booting from the
  794. 35:21installation media the installer starts
  795. 35:23and asks questions about how this system
  796. 35:26should be set up these questions are
  797. 35:28skipped if an automatic installation
  798. 35:31file is provided then the installation
  799. 35:34is performed finally the computer
  800. 35:36reboots into the newly installed system
  801. 35:39on some distributions additional
  802. 35:41questions are asked after the system
  803. 35:43reboots most installers have the option
  804. 35:46of downloading and installing updates as
  805. 35:49part of the installation process this
  806. 35:51requires internet access otherwise the
  807. 35:54system uses its normal update mechanism
  808. 35:57to retrieve retrieve those updates after
  809. 35:59the installation is
  810. 36:04done the demonstrations we see show how
  811. 36:07to install Linux directly on your
  812. 36:09machine erasing everything that was
  813. 36:11there while the demonstrations will not
  814. 36:14alter your computer following these
  815. 36:16procedures in real life will erase all
  816. 36:19current data there are also alternate
  817. 36:21methods to install Linux where you won't
  818. 36:23lose any data so some of those methods
  819. 36:26include repartition your hard disk to
  820. 36:28free up enough room to permit dual boot
  821. 36:31or side by-side installation of Linux
  822. 36:34along with your present operating system
  823. 36:36or using a host machine hypervisor
  824. 36:38program such as vmware's products or
  825. 36:41Oracle virtual box to install a client
  826. 36:44Linux virtual machine and finally
  827. 36:46booting off of and using a live CD or
  828. 36:49USB disc and not riding to the hard disk
  829. 36:51at all the first method is sometimes
  830. 36:54complicated and should be done when your
  831. 36:56confidence is high and you understand
  832. 36:58the steps involved the second and third
  833. 37:01methods are quite safe and make it
  834. 37:04difficult to damage your
  835. 37:09system here are the steps to install
  836. 37:11yuntu now going to do an install of
  837. 37:14Ubuntu
  838. 37:151804 as a virtual machine under the
  839. 37:18VMware hypervisor using a redhead 7 host
  840. 37:24system running VMware Player
  841. 37:28so first thing we need to do is to
  842. 37:31create a new virtual
  843. 37:33machine and for that I already have the
  844. 37:37uh Ubuntu install disc
  845. 37:40mounted
  846. 37:42uh in the virtual CD drive and we'll
  847. 37:45give it a
  848. 37:47name for the user as LF
  849. 37:52student with a username of student and
  850. 37:56we have to give a password
  851. 37:59which I've
  852. 38:01done and then for the name let's just
  853. 38:03call it Ubuntu and then on the host
  854. 38:05machine I want to have a certain place I
  855. 38:08want to put it uh rather than my home
  856. 38:11directory I want it in a on a disc that
  857. 38:14has a lot of
  858. 38:16space and then let's allocate 30 gigabyt
  859. 38:21of
  860. 38:22space and I prefer to have it as one big
  861. 38:26file rather than multiple files or
  862. 38:28slices I find that clutters my system
  863. 38:34less and really that's all you have to
  864. 38:36do to start setting up the install but
  865. 38:39it's better to click on customize
  866. 38:41hardware and increase the amount of
  867. 38:44memory from 1 Gigabyte to four in my
  868. 38:47case and I might as well take advantage
  869. 38:49of having multiple processors so I'll
  870. 38:51let it use all four processors on this
  871. 38:55host machine
  872. 38:57and then I'll just click on
  873. 39:00finish and uh it will start the install
  874. 39:03after a couple of harmless messages
  875. 39:06about how the virtual machine graphics
  876. 39:09driver doesn't permit accelerated
  877. 39:12graphics
  878. 39:14performance
  879. 39:15now the beautiful thing about the Ubuntu
  880. 39:19install on this recent version is that I
  881. 39:22am done there are no more choices to
  882. 39:24make I don't have any more parameters to
  883. 39:26specify
  884. 39:27Etc if I hadn't been installing in a
  885. 39:30virtual machine it would have asked me
  886. 39:33information like username and password
  887. 39:37at this stage but it was able to pick
  888. 39:39that up because of the intelligent way
  889. 39:42that VMware can handle UB
  890. 39:44to so I'm doing this in real time if you
  891. 39:48can read the messages you see it just
  892. 39:50created the the main file system on the
  893. 39:54system and now it's going to the stage
  894. 39:56of copying all the files over to the
  895. 39:59hard disk or I should say the simulated
  896. 40:02hard disk now this takes a little bit of
  897. 40:05time so I'll pause the recording for a
  898. 40:08few seconds so you don't have to watch
  899. 40:10not much happening I skipped about a
  900. 40:12minute or so and now it says it's almost
  901. 40:15finished copying files it's showing a
  902. 40:18bunch of different blurbs for various
  903. 40:21features in this bionic Beaver or Ubuntu
  904. 40:2518.04 release
  905. 40:30the status bar has reached all the way
  906. 40:32to the right so it should be almost
  907. 40:36done and now it's doing the actual
  908. 40:39install of the system so it's copied all
  909. 40:41the files it needs over to the hard disk
  910. 40:44and it's doing the actual
  911. 40:52configuration so once again I believe
  912. 40:54I'll pause for a little while so you
  913. 40:56don't have to sit here and watch not
  914. 40:58much
  915. 40:59happening paused for about a minute now
  916. 41:02it says it's configuring
  917. 41:05Hardware so it's finding all the
  918. 41:07hardware devices in the system making
  919. 41:09sure it has the right device drivers for
  920. 41:12it
  921. 41:14Etc it's now configuring the boot loader
  922. 41:17the
  923. 41:18grub and now it's doing cleanup it's
  924. 41:21getting rid of packages which were only
  925. 41:24needed during the install
  926. 41:30and of course
  927. 41:33that's rolling by far too fast to be
  928. 41:41readable and
  929. 41:44so it's doing a little bit more package
  930. 41:49installation I think I'll pause again
  931. 41:51for a little
  932. 41:54while so it reached the end of the
  933. 41:57status bar and now it's doing the
  934. 42:05reboot and shortly I should be getting a
  935. 42:07login
  936. 42:14prompt if you notice it's installing
  937. 42:17open VM tools that's a package of
  938. 42:20special drivers and configuration stuff
  939. 42:24that's used when you're running it as a
  940. 42:27guest under VMware
  941. 42:33hypervisor and we've reached the login
  942. 42:35screen running under the
  943. 42:37greeter so I'll just log in as
  944. 42:43student and oops I typed in the wrong
  945. 42:46password I suppose
  946. 42:52yep and now the system's running there's
  947. 42:55a few introductory uh messages here and
  948. 42:58I'll just click through them to get to a
  949. 43:02fully up system and then just to see
  950. 43:05what really happened here if I right
  951. 43:07click I can open up a
  952. 43:09terminal and then I'm going to run the
  953. 43:11command DF for dis
  954. 43:14free- T to show me what type of file
  955. 43:17systems I have in h to print out the
  956. 43:20results in megabytes and
  957. 43:23gigabytes and I see that in the main
  958. 43:25file system I have 30 GB of space of
  959. 43:29which I'm using 5.3 and it's an ext4
  960. 43:33file system when we install Centos we
  961. 43:36need to actually specify the type of
  962. 43:38file system the size of the partition
  963. 43:41Etc but auntu made choices that it
  964. 43:44thought were best likewise uh we won't
  965. 43:48talk about this now but if I look
  966. 43:50at Swap
  967. 43:52files you'll see that there is a swap
  968. 43:55file of about 1 and a 12 Gab
  969. 43:58created uh instead of a swap partition
  970. 44:00usually distributions create swap
  971. 44:03partitions so that's all there is to
  972. 44:06install the latest uh version of
  973. 44:09Ubuntu uh absolutely nothing to do
  974. 44:11during the install it makes what it
  975. 44:13thinks as sensible decisions for
  976. 44:15everything and after the system is up
  977. 44:17and running you could then go into the
  978. 44:19package manager and put in exactly what
  979. 44:21you need and configure the system in
  980. 44:23other ways if you need a more flexible
  981. 44:26installation
  982. 44:28to begin with you can make such choices
  983. 44:31uh when you start but we we took the
  984. 44:33easy path
  985. 44:36here here are the steps to install syn
  986. 44:40OS we are now going to do a fresh
  987. 44:43install of
  988. 44:45Centos 8.1 the latest version of Centos
  989. 44:50at the time of this
  990. 44:51installation we have already allocated
  991. 44:55hard disk space for this install ation
  992. 44:57to make a virtual machine under
  993. 45:00VMware and we have inserted
  994. 45:03the install dis image and we're ready to
  995. 45:07begin so we will uh not take the step of
  996. 45:11testing the media and installing it
  997. 45:13because uh that takes some time so we'll
  998. 45:16just go directly to an install so I'll
  999. 45:18just move to the first element here and
  1000. 45:21hit
  1001. 45:23return and uh we'll try to do this
  1002. 45:25install as as quickly as possible so
  1003. 45:28we'll choose mostly the uh default
  1004. 45:32choices and we're going to do a
  1005. 45:34workstation install rather than a server
  1006. 45:37install uh because this is what is
  1007. 45:40desired for this course um to have an to
  1008. 45:44have a user based uh
  1009. 45:52install Okay so the first choice is to
  1010. 45:55pick the language we'll pick
  1011. 46:03English and then uh we can go really
  1012. 46:06through any order we want through these
  1013. 46:08different
  1014. 46:09choices uh to begin with but let's just
  1015. 46:12go in order so we've already picked an
  1016. 46:13English keyboard with the US uh layout
  1017. 46:17and also language support is set up for
  1018. 46:19English for United States you can click
  1019. 46:21on these to make those changes for the
  1020. 46:24time and date uh it's actually better to
  1021. 46:26to make sure the network is installed
  1022. 46:29first so here I'm going I clicked on
  1023. 46:32network and I'm going to turn on the
  1024. 46:35network it found the network card and
  1025. 46:37it's kind of ready to go probably should
  1026. 46:41configure uh but I think the default
  1027. 46:44choices will be fine if I go to General
  1028. 46:47uh it says all users May connect and
  1029. 46:51then if I go to ipv vce settings you'll
  1030. 46:54see it's automatic DHCP
  1031. 46:57uh so that's generally what you want
  1032. 46:59rather than having to give it a fixed
  1033. 47:01address so we'll just say okay for all
  1034. 47:05this and
  1035. 47:06uh
  1036. 47:08um I guess we should say connect
  1037. 47:11automatically with priority zero that
  1038. 47:13means it'll always connect when you
  1039. 47:15start up the machine and we can say done
  1040. 47:18the reason it's good to do that before
  1041. 47:20we set the time and date is we can now
  1042. 47:23have Network time on which means it will
  1043. 47:25automatically find a
  1044. 47:27time
  1045. 47:29uh I'm currently doing this installation
  1046. 47:32from Central Time Zone in the United
  1047. 47:35States so you can try to do that with
  1048. 47:38the
  1049. 47:39mouse and I got it right it's set for
  1050. 47:41Chicago which is Central Time so I'll
  1051. 47:44say
  1052. 47:45done and then uh the installation source
  1053. 47:49is uh rather important but that's local
  1054. 47:52media I already have the DVD set as you
  1055. 47:55see at Centos 8-11 1911 that's the uh
  1056. 47:59latest version of
  1057. 48:01Centos for the software
  1058. 48:04selection uh let's just keep the
  1059. 48:07workstation I could make it a server
  1060. 48:09with a graphical interface or just a
  1061. 48:11server if I really wanted to be quick I
  1062. 48:13could do a minimal install and then
  1063. 48:15bring everything up later that I need uh
  1064. 48:18but within the workstation I should pick
  1065. 48:20a few things so I'll pick gnome
  1066. 48:22applications internet
  1067. 48:25applications uh you'll probably want to
  1068. 48:27pick the office suite and productivity
  1069. 48:28but I'd like this to go quickly so I
  1070. 48:30won't do that right
  1071. 48:32now uh I'll pick development Tools in
  1072. 48:35case I want to compile
  1073. 48:37anything um and that's probably the main
  1074. 48:40things I need right now but you can
  1075. 48:42always change everything in detail once
  1076. 48:44the system's up so it's it's good to do
  1077. 48:48a a relatively quick
  1078. 48:50install the trickiest part here is to do
  1079. 48:53the
  1080. 48:54installation um
  1081. 48:56partitioning setup so I'll pick I've
  1082. 49:00already got picked here the virtual 30
  1083. 49:03gigabyte disc and if I wanted to take
  1084. 49:06things really fast I would do automatic
  1085. 49:09storage
  1086. 49:10configuration uh and let it decide what
  1087. 49:12kind of partitions I should have how big
  1088. 49:15they should be Etc and you may want to
  1089. 49:17at least look at that but I let me just
  1090. 49:19do custom because it fits in better with
  1091. 49:21my needs and then I can say
  1092. 49:24done okay and then I get to pick what
  1093. 49:27kind of installation I want to do a
  1094. 49:30standard partition and not an lvm which
  1095. 49:33is logical volume management uh I just
  1096. 49:36want a simple standard partition so I'll
  1097. 49:38do that and then I actually have to
  1098. 49:40create the partitions I need so I hit
  1099. 49:43the plus sign and I'll have one big
  1100. 49:46partition for everything so it's mounted
  1101. 49:49at slash and let's give it 29
  1102. 49:53gabes and I'll add that this is a 30 G
  1103. 49:56abte dis and then I'll add one
  1104. 49:59more okay and that won't be mounted
  1105. 50:02that'll be for Swap and if I don't give
  1106. 50:05it desired capacity it should take it
  1107. 50:08all uh which it actually decided it
  1108. 50:12should have three gigabytes I'll let the
  1109. 50:15system go with what it wants it's it's
  1110. 50:17doing that based on how much uh memory I
  1111. 50:20have okay um and it says I have only
  1112. 50:24like one megabyte left I the total 30
  1113. 50:28gabt the one other thing I get to do for
  1114. 50:31the first Mount Point here is pick what
  1115. 50:33kind of file system and you notice the
  1116. 50:36default on red hat now is or C is xfs
  1117. 50:40let me make it
  1118. 50:42ext4 um which is which is easier to
  1119. 50:46mount from other other machines Etc than
  1120. 50:50xfs but you can just take the the uh
  1121. 50:53default if you prefer and then I'd say
  1122. 50:55done and and should be done it's telling
  1123. 50:59me do I really want to do this cuz it's
  1124. 51:01going to wipe out everything that's on
  1125. 51:02that dis I'll say sure accept the
  1126. 51:06changes so uh I'm pretty much done uh K
  1127. 51:10dump is a system you can set up so that
  1128. 51:14if the system crashes you produce what's
  1129. 51:16called a cord dump file so I'll just you
  1130. 51:19know you probably won't need to use that
  1131. 51:22it'll be a little faster to boot uh when
  1132. 51:24you have a new kernel so I'll just not
  1133. 51:27enable that but if you're doing a
  1134. 51:29develop machine you probably want that
  1135. 51:32we already configured the network and
  1136. 51:34under security policy uh we won't do any
  1137. 51:38specialization we'll just leave it alone
  1138. 51:40for now you can always change it later
  1139. 51:43and then you just say begin
  1140. 51:46installation now it'll already take a
  1141. 51:48head start on trying to load some
  1142. 51:51packages and files while you have some
  1143. 51:53more information to put in uh first have
  1144. 51:56to pick a password for the root account
  1145. 52:00and so I'll do that and it's actually LF
  1146. 52:03train for uh Mach virtual machines we
  1147. 52:07use for the classes which is a pretty
  1148. 52:09simple
  1149. 52:10password and
  1150. 52:13uh it's it's hard to read here but it it
  1151. 52:16should be saying it's too simple I can't
  1152. 52:19see that oh it says weak here but it
  1153. 52:21says press done again to use the
  1154. 52:23password anyway so I'll do that this is
  1155. 52:26a away machine and then I have to create
  1156. 52:29a user I'll make the full name of the
  1157. 52:32user LF student and by choice by default
  1158. 52:36it wants to make the username of the
  1159. 52:38account L student but we'll just make it
  1160. 52:42student um it will require a password to
  1161. 52:45use this account if we said make this
  1162. 52:48user administrator it would be like
  1163. 52:51Ubuntu systems where there's just one
  1164. 52:53password and uh you have to do su to do
  1165. 52:56anything privileged but let's keep a
  1166. 52:59standard Unix type set up with separate
  1167. 53:01accounts and passwords for the student
  1168. 53:03user and the root user so we're going to
  1169. 53:06give a very simple password again just
  1170. 53:08the word
  1171. 53:10student and once you get it oh it says
  1172. 53:13it does not match I must have typed
  1173. 53:14things wrong let's try again St
  1174. 53:18ENT St
  1175. 53:21ENT yeah so now it says the password
  1176. 53:24contains the username and some form
  1177. 53:27you will have to pass done twice to
  1178. 53:28confirm it it's also considered very
  1179. 53:30weak but we'll accept it once again it's
  1180. 53:33a throwaway machine in real life you
  1181. 53:35shouldn't do
  1182. 53:37this and so I say
  1183. 53:40done and now uh we just have to wait for
  1184. 53:43the install you'll see it has installed
  1185. 53:46F 500 some odd packages out of
  1186. 53:501481 we could keep watching while this
  1187. 53:52happens but it takes some time so I'm
  1188. 53:54going to pause the recording and come
  1189. 53:56back when it's almost
  1190. 54:05done so it has finished and it's
  1191. 54:08configuring the kernel
  1192. 54:10now uh that takes a little bit of time
  1193. 54:13it installed I think, 1481 packages so
  1194. 54:17now it's doing the actual configuration
  1195. 54:19of the kernel it is doing a few other
  1196. 54:23configuration steps you'll notice it is
  1197. 54:26is installing the boot loader it
  1198. 54:28configured the
  1199. 54:29editors is generating What's called the
  1200. 54:32init Ram FS which is uh needed to boot
  1201. 54:36it contains the initial file system
  1202. 54:38which is stored in memory for just for
  1203. 54:41the system booting which we talk about
  1204. 54:44in detail in this
  1205. 54:47course and this is probably the last
  1206. 54:50thing it really has to do before it's
  1207. 54:52done uh depending on the complexity of
  1208. 54:55things it can take away while is now
  1209. 54:57complete so now we can simply reboot so
  1210. 55:02let's do that and we should have a
  1211. 55:05running
  1212. 55:10system and you see it's wants to boot
  1213. 55:13there into the default kernel
  1214. 55:174.8.0 and I didn't do anything it will
  1215. 55:20automatically boot on its own
  1216. 55:27and then there's a few things that
  1217. 55:28happen when you start up the first time
  1218. 55:32I it wants me to accept the uh and user
  1219. 55:35license which is pretty simple for uh
  1220. 55:39open source
  1221. 55:42product uh and then finish
  1222. 55:45configuration it has a few other things
  1223. 55:48to set up and we're ready to do our
  1224. 55:51first login as student so I clicked on
  1225. 55:54that I type in the password
  1226. 56:02and we have an up and running
  1227. 56:05system and uh it's going to ask us to
  1228. 56:08confirm again our choice of
  1229. 56:11language and uh we could check to make
  1230. 56:14sure the keyboard is okay but uh we're
  1231. 56:16fine with English
  1232. 56:18us and uh I'm going to turn off location
  1233. 56:21services that's a that's a choice you
  1234. 56:24can make
  1235. 56:27and if you want you can connect to
  1236. 56:29various online accounts so we're going
  1237. 56:31to skip all that and we're ready to go
  1238. 56:35so now we have a fully functional system
  1239. 56:38it brings up so a tutorial screen if you
  1240. 56:40want to get some more information we'll
  1241. 56:42just skip
  1242. 56:44that and here we are it's a fully
  1243. 56:46functional system if I want to uh get a
  1244. 56:50little information let me drop to a
  1245. 56:51command line so I clicked on activities
  1246. 56:54I'll say terminal and and here we are so
  1247. 56:57for instance if I do
  1248. 57:00df- you'll see uh I've used 5.2
  1249. 57:04GB uh and there's plenty of space
  1250. 57:07available uh if I wanted to change the
  1251. 57:09size of the screen depending on your
  1252. 57:11hypervisor sometimes you can just kind
  1253. 57:13of drag it out or something but uh here
  1254. 57:17let me go to display settings and it's
  1255. 57:19set for 1280 time 78
  1256. 57:23768 and I obviously can go bigger so
  1257. 57:26just to show you for instance let's say
  1258. 57:29I take 19 20 by
  1259. 57:331220 and I'm filling up the whole screen
  1260. 57:36now it's actually bigger than my whole
  1261. 57:38screen so I'll revert the settings but
  1262. 57:40you can do all sorts of other
  1263. 57:42adjustments and we've done a complete
  1264. 57:44install of centos8 it's all set and
  1265. 57:47ready to use and customize to your
  1266. 57:49heart's
  1267. 57:52content here are the steps to install
  1268. 57:54open Susi
  1269. 57:56we are now going to do a fresh install
  1270. 57:58of open Su as a virtual machine under a
  1271. 58:01VMware hypervisor on a red hat 7
  1272. 58:05system we have already inserted the
  1273. 58:07installed DVD and we are about to begin
  1274. 58:12notice that in our initial screen we can
  1275. 58:14do an installation and upgrade or if we
  1276. 58:17scroll down to
  1277. 58:19more we see that we can also use the
  1278. 58:22install DVD as a rescue system uh uh we
  1279. 58:26can check memory and do various things
  1280. 58:28but we're going to do an install so I'll
  1281. 58:31just pick on install and then it will
  1282. 58:34cook for a while before it asks me to do
  1283. 58:39anything uh so now it's finding all the
  1284. 58:42hardware deciding what drivers to use
  1285. 58:44Etc and getting
  1286. 58:48started this is open Su leap version
  1287. 58:5142.3
  1288. 58:57and this is a typical gnome graphical
  1289. 59:00booting screen while it's getting itself
  1290. 59:09ready it should take a few more
  1291. 59:13seconds I'll pause so we don't have to
  1292. 59:15watch the whole thing okay it has moved
  1293. 59:18on and it's about ready to bring up a
  1294. 59:20graphical screen and there we go
  1295. 59:26so it's initializing the hardware on the
  1296. 59:32system okay now it's asking whether we
  1297. 59:35want to accept English as a language and
  1298. 59:38also the license agreement so we'll just
  1299. 59:40say
  1300. 59:41sure click on the next button it's doing
  1301. 59:45more probing of the system deciding what
  1302. 59:47to
  1303. 59:51do and it says in a very small font
  1304. 59:54initializing the installation now it
  1305. 59:57would like to take a default partition
  1306. 1:00:00scheme which we will
  1307. 1:00:03override um so let me say edit proposed
  1308. 1:00:07settings and I will take a
  1309. 1:00:09partition-based
  1310. 1:00:11proposal I will choose for my root
  1311. 1:00:14partition
  1312. 1:00:15ext4 I won't have any separate home
  1313. 1:00:19partition or other partitions to keep
  1314. 1:00:20things simple and that's all I have to
  1315. 1:00:23choose so it's pretty simple
  1316. 1:00:26and it says here it's going to create a
  1317. 1:00:28swap partition of 2 gabt and then a root
  1318. 1:00:32partition for everything else 28
  1319. 1:00:35gigabytes um and so I'm happy enough
  1320. 1:00:38with that so I'll just say
  1321. 1:00:46next and first thing is just to pick the
  1322. 1:00:50time zone so I'll pick central
  1323. 1:00:52time where I am currently sitting
  1324. 1:00:56and I could do some other
  1325. 1:00:59settings that unless I don't want to
  1326. 1:01:01take automatic time
  1327. 1:01:03setting so I just say
  1328. 1:01:06next and here I have a choice for what
  1329. 1:01:08kind of desktop let me pick the gome
  1330. 1:01:10desktop I could pick the KDE or as a
  1331. 1:01:13server pure text mode no graphical or I
  1332. 1:01:16could do custom to do something a little
  1333. 1:01:18more complicated or
  1334. 1:01:21different and then it wants me to give a
  1335. 1:01:25a full name name for uh the main user
  1336. 1:01:27I'll say LF
  1337. 1:01:30student and for username I'll pick
  1338. 1:01:32student and I'll give a
  1339. 1:01:36password and then I will not pick use
  1340. 1:01:38this password for system administrator
  1341. 1:01:41that would be like what auntu does and I
  1342. 1:01:43will not pick automatic log and it's
  1343. 1:01:45generally not a good idea to let your
  1344. 1:01:47system log in without having to give a
  1345. 1:01:50password so I'll say
  1346. 1:01:52next it doesn't like my password because
  1347. 1:01:55it's too simple but I'll say okay do it
  1348. 1:01:58and now I have to give a root
  1349. 1:02:02password and you might want to test your
  1350. 1:02:04keyboard layout to make sure you have
  1351. 1:02:06the right
  1352. 1:02:08language I'll say next and once again
  1353. 1:02:11it's going to complain my password is
  1354. 1:02:12too
  1355. 1:02:14simple and then I just say install and
  1356. 1:02:17that's all the choices that I actually
  1357. 1:02:20have to make uh so really nothing except
  1358. 1:02:24specifying username password and what
  1359. 1:02:27kind of desktop I want we can do further
  1360. 1:02:30adjustments once the system is fully
  1361. 1:02:33installed now while it's
  1362. 1:02:35installing which should take about 10
  1363. 1:02:38minutes uh the default screen here is a
  1364. 1:02:41slide show giving you brochures and
  1365. 1:02:44information if I click on details it's a
  1366. 1:02:46little more fun to look at so you can
  1367. 1:02:49see the overall progress as it goes this
  1368. 1:02:52first bar here is for each package as it
  1369. 1:02:55is being installed and on the bottom you
  1370. 1:02:57can see I'm already about 15% installed
  1371. 1:03:01so I'm going to pause the recording cuz
  1372. 1:03:02it's kind of boring to watch it install
  1373. 1:03:04all 1500 packages and I'll wait until
  1374. 1:03:07it's asking me to do something again
  1375. 1:03:09before
  1376. 1:03:11resuming okay that took about less than
  1377. 1:03:1410 minutes and now it's telling me the
  1378. 1:03:17system is going to reboot and it
  1379. 1:03:20did um and so we'll just see our normal
  1380. 1:03:24booting uh
  1381. 1:03:26of the new open Su
  1382. 1:03:33system and uh it should quickly bring up
  1383. 1:03:36the login
  1384. 1:03:43screen just a few more seconds
  1385. 1:03:56and there's our usual greeter screen
  1386. 1:03:58I'll just type in the password for the
  1387. 1:04:01student
  1388. 1:04:02account and we have a fully operational
  1389. 1:04:05open Su
  1390. 1:04:06system now the first thing I would do
  1391. 1:04:09from here is update the system because
  1392. 1:04:12there's always new updates to various
  1393. 1:04:15packages since the DVD install disc was
  1394. 1:04:19released so that's important for both
  1395. 1:04:21security and
  1396. 1:04:22performance and it's even prompting me
  1397. 1:04:25to go go ahead and do that and then I'd
  1398. 1:04:27probably do some minor customizations
  1399. 1:04:29about what kind of menus I see how
  1400. 1:04:31Windows behave the keyboard Etc but I'll
  1401. 1:04:34leave that for people to do as an
  1402. 1:04:42exercise you have completed chapter 3
  1403. 1:04:46Let's summarize the key Concepts covered
  1404. 1:04:49a partition is a logical part of the dis
  1405. 1:04:52a file system is a method of storing or
  1406. 1:04:55finding files on a hard disk by dividing
  1407. 1:04:58the hard disk into partitions data can
  1408. 1:05:00be grouped and separated as needed when
  1409. 1:05:03a failure or a mistake occurs only the
  1410. 1:05:06data in the effective partition will be
  1411. 1:05:08damaged while data on the other
  1412. 1:05:11partitions will likely
  1413. 1:05:13survive the boot process has multiple
  1414. 1:05:15steps starting with the BIOS which
  1415. 1:05:18triggers the boot loader to start up the
  1416. 1:05:20Linux kernel from there the init Ram FS
  1417. 1:05:23file system is invoked which triggers
  1418. 1:05:25the anet program to complete the startup
  1419. 1:05:28process and determining the appropriate
  1420. 1:05:31distribution to deploy requires that you
  1421. 1:05:33match your specific system needs to the
  1422. 1:05:36capabilities of the different
  1423. 1:05:42distributions by the end of this chapter
  1424. 1:05:44you should be able to manage graphical
  1425. 1:05:47interface sessions perform basic
  1426. 1:05:50operations using the graphical interface
  1427. 1:05:53change the graphical desktop to suit
  1428. 1:05:55your needs needs you can use either a
  1429. 1:05:57command line interface or a graphical
  1430. 1:05:59user interface when using Linux to work
  1431. 1:06:03at the CLI you have to remember which
  1432. 1:06:05programs and commands are used to
  1433. 1:06:07perform tasks on the other hand using
  1434. 1:06:10the guey is often quick and easy it
  1435. 1:06:12allows you to interact with your system
  1436. 1:06:14through graphical icons and screens for
  1437. 1:06:18repetitive tasks the CLI is often more
  1438. 1:06:20efficient while the guei is easier to
  1439. 1:06:22navigate if you don't remember all the
  1440. 1:06:24details or do something only rarely
  1441. 1:06:27we'll learn how to manage sessions using
  1442. 1:06:29the guey for the three Linux
  1443. 1:06:31distribution families that we cover the
  1444. 1:06:33most in this course which are red hat
  1445. 1:06:36including C and Fedora Susi open Susi
  1446. 1:06:39and deian Ubuntu and mint in subsequent
  1447. 1:06:43sections of this course we'll
  1448. 1:06:44concentrate in great detail on the
  1449. 1:06:47command line interface which is pretty
  1450. 1:06:49much the same on all distributions
  1451. 1:06:52generally in a Linux desktop system the
  1452. 1:06:54x windows system is loaded as one of the
  1453. 1:06:57final steps in the boot process it's
  1454. 1:06:59often just called x a service called the
  1455. 1:07:02display manager keeps track of the
  1456. 1:07:04displays being provided and loads the X
  1457. 1:07:07server so-called because it provides
  1458. 1:07:09graphical services to Applications
  1459. 1:07:12sometimes called X clients the display
  1460. 1:07:14manager also handles graphical logins
  1461. 1:07:17and starts the appropriate desktop
  1462. 1:07:19environment after a user logs in X is
  1463. 1:07:22rather old software it dates back to the
  1464. 1:07:24mid1 1980s
  1465. 1:07:26and as such it has certain def
  1466. 1:07:28deficiencies on Modern systems for
  1467. 1:07:30example with security and it's been
  1468. 1:07:32stretched rather far from its original
  1469. 1:07:35purpose a newer system known as Wayland
  1470. 1:07:38is gradually superseding it and is the
  1471. 1:07:40default display system for Fedora real 8
  1472. 1:07:42and other recent distributions for the
  1473. 1:07:45most part it looks just like x to the
  1474. 1:07:47user although under the hood it's quite
  1475. 1:07:49different a desktop environment consists
  1476. 1:07:52of a session manager which starts and
  1477. 1:07:54maintains the components of the
  1478. 1:07:56graphical session and the window manager
  1479. 1:07:59which controls the placement and
  1480. 1:08:00movement of Windows the window title
  1481. 1:08:03bars and controls although these can be
  1482. 1:08:06mixed generally a set of utilities
  1483. 1:08:09session manager and Window Manager are
  1484. 1:08:11used together as a unit and together
  1485. 1:08:13they provide a seamless desktop
  1486. 1:08:15environment if the display manager is
  1487. 1:08:18not started by default in the default
  1488. 1:08:20run level you can start the graphical
  1489. 1:08:22desktop in different in a different way
  1490. 1:08:24after logging into a text mode console
  1491. 1:08:27by running start X from the command line
  1492. 1:08:29when you install a desktop environment
  1493. 1:08:31the X display manager starts at the end
  1494. 1:08:34of the boot process it's responsible for
  1495. 1:08:36starting the graphics system logging in
  1496. 1:08:38the user and starting the user's desktop
  1497. 1:08:41environment you can often select from a
  1498. 1:08:43choice of desktop environment when
  1499. 1:08:46logging into the system gnome is a
  1500. 1:08:48popular desktop environment with an
  1501. 1:08:50easyto usee graphical user interface
  1502. 1:08:53it's bundles as the default desktop
  1503. 1:08:55environment for most Linux distributions
  1504. 1:08:58including Red Hat Enterprise Linux re
  1505. 1:09:00Fedora Centos Susi Linux Enterprise
  1506. 1:09:03auntu and deian gome has menu based
  1507. 1:09:06navigation and is sometimes an easy
  1508. 1:09:09transition to accomplish for Windows
  1509. 1:09:11users however as you'll see the look and
  1510. 1:09:14feel can be quite different across
  1511. 1:09:16distributions even if they're all using
  1512. 1:09:18gnome another common desktop environment
  1513. 1:09:20very important in the history of Linux
  1514. 1:09:23and also widely used is KD e which has
  1515. 1:09:26often been used in conjunction with Susi
  1516. 1:09:28and open Susi as previously mentioned
  1517. 1:09:31most desktop environments follow a
  1518. 1:09:33similar structure to gnome and we'll
  1519. 1:09:35restrict ourselves mostly to it to keep
  1520. 1:09:37things less complex let's demonstrate
  1521. 1:09:40how we log in and log out of a system
  1522. 1:09:43which has already been booted on all
  1523. 1:09:45recent distributions this looks pretty
  1524. 1:09:47much the same here we're showing an
  1525. 1:09:50instance of Centos stream which has
  1526. 1:09:54three users on the system
  1527. 1:09:55and I can log in in any one of them by
  1528. 1:09:58selecting so let's go with the second
  1529. 1:10:00one BJ moose and you'll notice that when
  1530. 1:10:03I log in if I click on the gear item I
  1531. 1:10:05have a choice of different
  1532. 1:10:07desktops okay here's the default on
  1533. 1:10:10couette stream which is a whan but I can
  1534. 1:10:13pick a couple different kinds of x11s if
  1535. 1:10:17I want I'll type in the
  1536. 1:10:21password and I log in I depending on
  1537. 1:10:24what's going on it may see a little bit
  1538. 1:10:26of information um and that's all
  1539. 1:10:30involved in logging in I probably won't
  1540. 1:10:32see a hell of a lot uh this is a new
  1541. 1:10:34user without much going on if I click on
  1542. 1:10:37activities for instance I'll see some
  1543. 1:10:39favorite
  1544. 1:10:40applications uh if I click on Terminal
  1545. 1:10:43here I can bring up a terminal if I want
  1546. 1:10:45to do command line activity to log out
  1547. 1:10:48all I have to do is go in the upper
  1548. 1:10:49right corner and I can click on my
  1549. 1:10:53name and then I can say either switch
  1550. 1:10:55user or log out I would do switch user
  1551. 1:10:58if I want to keep more than one session
  1552. 1:11:00active at a time for different people
  1553. 1:11:02which is something you probably won't
  1554. 1:11:04want to do very often but it would mean
  1555. 1:11:06if I came back into this user session I
  1556. 1:11:09would see the whatever applications I
  1557. 1:11:12had open but I'll just pick on log out
  1558. 1:11:15and then I click here log out and I'm
  1559. 1:11:19back to my greeter or my login screen
  1560. 1:11:21where I can pick the users again so I
  1561. 1:11:24can log in on any one of them so that's
  1562. 1:11:27a simple demonstration of how one logs
  1563. 1:11:29in and out of a system each Linux
  1564. 1:11:32distribution comes with its own set of
  1565. 1:11:34desktop backgrounds you can change the
  1566. 1:11:36default by choosing a new wallpaper or
  1567. 1:11:39selecting a custom picture to be set as
  1568. 1:11:41the desktop background if you don't want
  1569. 1:11:44to use an image as the background you
  1570. 1:11:47can select a color to be displayed on
  1571. 1:11:49the desktop instead in addition you can
  1572. 1:11:52also change the desktop theme which
  1573. 1:11:54changes the look feel of the Linux
  1574. 1:11:56system the theme also defines the
  1575. 1:11:59appearance of application windows so
  1576. 1:12:02let's see how to change the desktop
  1577. 1:12:03background and
  1578. 1:12:05theme we are going to demonstrate how to
  1579. 1:12:08change the background wallpaper on a red
  1580. 1:12:11hat 7 system all recent Linux
  1581. 1:12:14distributions have exactly the same
  1582. 1:12:15method so this will suffice to show for
  1583. 1:12:19all so all we have to do is click on the
  1584. 1:12:23background with a right click
  1585. 1:12:25and change
  1586. 1:12:29background click on background again and
  1587. 1:12:31then we have a choice between wallpapers
  1588. 1:12:34that the system knows already and it's
  1589. 1:12:38possible to load up other ones so let's
  1590. 1:12:40say we pick this one
  1591. 1:12:42here and you see now the background has
  1592. 1:12:45been
  1593. 1:12:46changed or I could pick for instance a
  1594. 1:12:49picture stored on my machine in my
  1595. 1:12:52pictures directory under my home
  1596. 1:12:54directory so I'll pick this
  1597. 1:12:57one and you see it's been
  1598. 1:13:00changed so that's all we have to do to
  1599. 1:13:02change the background on any recent
  1600. 1:13:04Linux
  1601. 1:13:10system most common settings both
  1602. 1:13:13personal and systemwide are to be found
  1603. 1:13:15by clicking in the upper right hand
  1604. 1:13:17corner on either a gear or other obvious
  1605. 1:13:21icon depending on your Linux
  1606. 1:13:23distribution
  1607. 1:13:25however there are many settings which
  1608. 1:13:27many users would like to modify which
  1609. 1:13:30are not accessible in that way the
  1610. 1:13:33default settings utility is
  1611. 1:13:35unfortunately rather Limited in modern
  1612. 1:13:37gnome based
  1613. 1:13:38distributions unfortunately the Quest
  1614. 1:13:40for Simplicity has actually made it
  1615. 1:13:43difficult to adapt your system to your
  1616. 1:13:45tastes and needs fortunately there is a
  1617. 1:13:48standard utility gnome tweaks which
  1618. 1:13:51exposes many more setting options it
  1619. 1:13:54also perits you to easily install
  1620. 1:13:56extensions by external parties not all
  1621. 1:13:58Linux distributions install this tool by
  1622. 1:14:00default but it's always available you
  1623. 1:14:02may have to run it by hitting alt F2 and
  1624. 1:14:05then typing in the name you may want to
  1625. 1:14:07add it to your favorites list as we
  1626. 1:14:09shall discuss in this screenshot the
  1627. 1:14:11keyboard mapping is being adjusted so
  1628. 1:14:14the useless cap loot key can be used as
  1629. 1:14:18an additional control key this saves
  1630. 1:14:20users who use control a lot such as emac
  1631. 1:14:23efficient autos from getting physically
  1632. 1:14:26damaged by pinky
  1633. 1:14:32strain the visual appearance of
  1634. 1:14:34applications the buttons scroll bars
  1635. 1:14:36widgets and other graphical components
  1636. 1:14:38are controlled by a theme gnome comes
  1637. 1:14:42with a set of different themes which can
  1638. 1:14:44change the way your applications look
  1639. 1:14:48the exact method for changing your theme
  1640. 1:14:51may depend on your distribution for
  1641. 1:14:54older gnome based distributions you can
  1642. 1:14:56simply run gnome tweaks as shown in this
  1643. 1:15:00screenshot from Ubuntu
  1644. 1:15:05however now you'll be able to see a
  1645. 1:15:08demonstration for logging in and out on
  1646. 1:15:11the major Linux distribution families
  1647. 1:15:13we'll concentrate on in this course note
  1648. 1:15:16that Evolution has brought us to a stage
  1649. 1:15:18where little it matters little which
  1650. 1:15:20distribution you choose as they're all
  1651. 1:15:22rather similar recent Linux distribution
  1652. 1:15:25which use the gnome desktop look
  1653. 1:15:28remarkably the same when it comes to the
  1654. 1:15:30process of starting up and shutting down
  1655. 1:15:33so we will demonstrate that here by
  1656. 1:15:35using a VMware hypervisor on a red hat
  1657. 1:15:39Enterprise Linux host and we'll
  1658. 1:15:41demonstrate three recent distributions
  1659. 1:15:44and how they boot so we've already teed
  1660. 1:15:47them up so here I will start Centos
  1661. 1:15:52stream here I will start Ubuntu
  1662. 1:15:562004 and here I will start open
  1663. 1:16:00Su leap
  1664. 1:16:0315.3 so you'll see a little bit
  1665. 1:16:05different messages on each as they boot
  1666. 1:16:07uh according to how grub is configured
  1667. 1:16:10and what the possible kernel choices are
  1668. 1:16:13it will take longer to boot than they
  1669. 1:16:16were normally would if I was only doing
  1670. 1:16:18one at a time simply because uh the host
  1671. 1:16:21machine's a little bit overloaded
  1672. 1:16:23running three virtual Machin machines it
  1673. 1:16:25really doesn't have a ton of memory uh
  1674. 1:16:28in this case I have allotted 3 GB of
  1675. 1:16:31memory to each out of a total of 16 gab
  1676. 1:16:36on the machine so it's a little bit
  1677. 1:16:39memory stressed uh so we'll just wait
  1678. 1:16:41till they start and reach their greeter
  1679. 1:16:44screen which you see we've already done
  1680. 1:16:46that on
  1681. 1:16:47auntu we've already done that on open Su
  1682. 1:16:51leap and it's taking somewhat longer on
  1683. 1:16:55s uh H stream so let's log into these
  1684. 1:16:59guys while we wait for SOS stream to get
  1685. 1:17:02ready so I'll log in the
  1686. 1:17:05student password here on the uh Ubuntu
  1687. 1:17:09machine I'll do the same thing on the
  1688. 1:17:11open Su
  1689. 1:17:15machine and now we're just waiting for
  1690. 1:17:18the Cent 8
  1691. 1:17:22machine finally ready and then I'll log
  1692. 1:17:25in there as
  1693. 1:17:27well and you notice they have different
  1694. 1:17:30background pictures just because we have
  1695. 1:17:32selected different background pictures
  1696. 1:17:34over time but they all arrive to pretty
  1697. 1:17:37much the same appearance with an
  1698. 1:17:39activities and an applications menu and
  1699. 1:17:42then uh Ubuntu still likes to have this
  1700. 1:17:45uh sidebar on the left with major
  1701. 1:17:49applications um I can easily bring that
  1702. 1:17:51up on the other ones for instance if I
  1703. 1:17:53type activities here activities on open
  1704. 1:17:57Su I will see the same thing
  1705. 1:18:00there and then the process of shutting
  1706. 1:18:03down is also quite similar all I need to
  1707. 1:18:05do is click in the upper right hand
  1708. 1:18:08corner and I find the power
  1709. 1:18:10icon and I just say power
  1710. 1:18:13off I'll do the same thing with the
  1711. 1:18:16Buu I get power off going to go power
  1712. 1:18:20off and I can do the same thing with
  1713. 1:18:22open SU
  1714. 1:18:25power off and power off so it's
  1715. 1:18:26remarkably the same from distribution to
  1716. 1:18:29distribution these
  1717. 1:18:34days it's often a good idea to lock your
  1718. 1:18:37screen to prevent other people from
  1719. 1:18:39accessing your session while you're away
  1720. 1:18:41from your computer note this does not
  1721. 1:18:43suspend the computer all your
  1722. 1:18:45applications and processes continue to
  1723. 1:18:47run while the screen is
  1724. 1:18:50locked let's show how to lock and unlock
  1725. 1:18:53your screen on any recent gnome
  1726. 1:18:56distribution so the simplest way is to
  1727. 1:18:58go to the upper right corner and click
  1728. 1:19:00and find the lock
  1729. 1:19:03button and simply and simply click on
  1730. 1:19:06that and then you can unlock it by
  1731. 1:19:09clicking on the display on the time
  1732. 1:19:12there and just typing in the password
  1733. 1:19:15again very simple another way to do it
  1734. 1:19:18is through combination of keys uh
  1735. 1:19:21depending on your machine this will
  1736. 1:19:23generally be the Super Key plus l or the
  1737. 1:19:26Super Key plus the Escape where the
  1738. 1:19:28super key is also known as the Windows
  1739. 1:19:30key uh so let me do that here and once
  1740. 1:19:33again I brought up the lock window and I
  1741. 1:19:35can simply unlock it
  1742. 1:19:37again so that's all that's involved it's
  1743. 1:19:40very
  1744. 1:19:46simple Linux is a true multi-user
  1745. 1:19:50operating system which allows more than
  1746. 1:19:52one user to be simultaneously logged in
  1747. 1:19:54if more than one person uses the system
  1748. 1:19:56it's best for each person to have their
  1749. 1:19:58own user account and password this
  1750. 1:20:01allows for individualize settings home
  1751. 1:20:03directories and other files users can
  1752. 1:20:06take turns using the machine while
  1753. 1:20:09keeping everyone's sessions alive or
  1754. 1:20:11even be logged in simultaneously through
  1755. 1:20:14the
  1756. 1:20:15network let us demonstrate how to switch
  1757. 1:20:17users on an Ubuntu machine with several
  1758. 1:20:22accounts so first I will choose the
  1759. 1:20:25Linux Foundation student as the account
  1760. 1:20:27to log
  1761. 1:20:28into type my password and sign
  1762. 1:20:33in and then if I look in the upper right
  1763. 1:20:36hand
  1764. 1:20:37corner and click there I will see LF
  1765. 1:20:41student and I can click on either log
  1766. 1:20:44out or switch user notice if I log out I
  1767. 1:20:47really log out but if I switch user I
  1768. 1:20:49will just lock the user account and then
  1769. 1:20:51when I start up I will preserve all of
  1770. 1:20:54my sessions and open Windows Etc when I
  1771. 1:20:58restart on some distributions you may
  1772. 1:21:00actually see a list of users at this
  1773. 1:21:03screen but not on Ubuntu so I'll say
  1774. 1:21:06switch user I'm back to the greeter
  1775. 1:21:09screen and let me pick the second one
  1776. 1:21:11Theodor
  1777. 1:21:14Cleaver and log in as that other
  1778. 1:21:19user and there we go and now if I look
  1779. 1:21:22up here again I can do the same thing
  1780. 1:21:25so let me click on the name and I'll say
  1781. 1:21:28switch
  1782. 1:21:29user and if I pick student again you
  1783. 1:21:32notice here it says unlock and not
  1784. 1:21:35restart that means that if I were to log
  1785. 1:21:37in now I will have preserved all the
  1786. 1:21:39open windows and running applications
  1787. 1:21:41from
  1788. 1:21:42before this will look the same
  1789. 1:21:44essentially on all Linux
  1790. 1:21:46distributions of recent vintage so it's
  1791. 1:21:48very easy to switch users and not lose
  1792. 1:21:51any information from what you're already
  1793. 1:21:53doing
  1794. 1:22:00besides normal daily starting and
  1795. 1:22:02stopping of the computer a system
  1796. 1:22:04restart may be required as part of
  1797. 1:22:06certain major system updates generally
  1798. 1:22:09only those involving installing a new
  1799. 1:22:11Linux kernel initiating the shutdown
  1800. 1:22:14process from the graphical desktop is
  1801. 1:22:17rather trivial on most current Linux
  1802. 1:22:19distributions with very little variation
  1803. 1:22:22we'll discuss later how to do this from
  1804. 1:22:24the command line using the shutdown
  1805. 1:22:26command in all cases you click on either
  1806. 1:22:29a settings or gear or a power icon and
  1807. 1:22:32follow the prompts to shut down the
  1808. 1:22:34computer on any recent gnome based Linux
  1809. 1:22:37distribution perform the following steps
  1810. 1:22:40uh first click the power or the gear
  1811. 1:22:42icon in the upper right hand corner of
  1812. 1:22:44the screen second click on click on the
  1813. 1:22:48power off restart or cancel if you do
  1814. 1:22:51nothing the system will shut down in 60
  1815. 1:22:53Seconds
  1816. 1:22:55shutdown reboot and logout operations
  1817. 1:22:57will ask for confirmation before going
  1818. 1:22:59ahead this is because many applications
  1819. 1:23:02will not save their data their data
  1820. 1:23:04properly when terminated this way always
  1821. 1:23:07save your documents and data before
  1822. 1:23:09restarting shutting down or logging out
  1823. 1:23:13all modern Computers support suspend or
  1824. 1:23:16sleep mode when you want to stop using
  1825. 1:23:19your computer for a while suspend mode
  1826. 1:23:22saves the current system state and
  1827. 1:23:24allows you to resume your session more
  1828. 1:23:26quickly while remaining on but uses very
  1829. 1:23:30little power in the sleeping state it
  1830. 1:23:32works by keeping your systems
  1831. 1:23:34applications desktop and so on in system
  1832. 1:23:37Ram but turning off all the other
  1833. 1:23:39Hardware this shortens the the time for
  1834. 1:23:42a full system startup as well as
  1835. 1:23:44conserves battery power once you note
  1836. 1:23:46that modern Linux distributions actually
  1837. 1:23:48boot so fast that the amount of time
  1838. 1:23:50saved is often minor
  1839. 1:23:57even experienced users can forget the
  1840. 1:23:59precise command that launches an
  1841. 1:24:01application or exactly what options and
  1842. 1:24:03arguments it requires fortunately Linux
  1843. 1:24:06allows you to quickly open applications
  1844. 1:24:09using the graphical interface
  1845. 1:24:11applications are found at different
  1846. 1:24:12places in Linux and within gnome they
  1847. 1:24:15can be found from the applications menu
  1848. 1:24:18in the upper leftand corner or from the
  1849. 1:24:22activities menu in the upper left hand
  1850. 1:24:24corner also in some Ubuntu versions from
  1851. 1:24:29the dash button in the upper leftand
  1852. 1:24:31corner for KDE and some other
  1853. 1:24:34environments applications can be opened
  1854. 1:24:37from the button in the lower leftand
  1855. 1:24:39corner in the upcoming sections you will
  1856. 1:24:42learn how to perform basic Linux
  1857. 1:24:43operations using the graphical
  1858. 1:24:50interface unlike other operating systems
  1859. 1:24:53the initial install of Linux usually
  1860. 1:24:55comes with a wide range of applications
  1861. 1:24:57and software archives that contain
  1862. 1:24:59thousands of programs that enable you to
  1863. 1:25:01accomplish a wide variety of tasks with
  1864. 1:25:04your computer for most key tasks a
  1865. 1:25:07default application is usually already
  1866. 1:25:09installed however you can always install
  1867. 1:25:11more applications and try different
  1868. 1:25:13options for example Firefox is popular
  1869. 1:25:17as the default browser in many Linux
  1870. 1:25:19distributions while Epiphany codor and
  1871. 1:25:22chromium the open source uh of Google
  1872. 1:25:25Chrome are usually available for install
  1873. 1:25:27from software repositories proprietary
  1874. 1:25:30web browsers such as Opera and chrome
  1875. 1:25:32are also available locating applications
  1876. 1:25:35from The Gnome and KDE menus is easy as
  1877. 1:25:38they're neatly organized in functional
  1878. 1:25:41submenus multiple applications are
  1879. 1:25:43available to accomplish various tasks
  1880. 1:25:46and to open a file type a file of a
  1881. 1:25:48given type for example you can click on
  1882. 1:25:50a web address while reading an email and
  1883. 1:25:52launch a browser such as fir fox or
  1884. 1:25:55Chrome to set the default applications
  1885. 1:25:58enter the settings menu on all recent
  1886. 1:26:01Linux distributions and then click on
  1887. 1:26:03either default applications or details
  1888. 1:26:07default
  1889. 1:26:08applications let's now demonstrate how
  1890. 1:26:10to set default applications on a red hat
  1891. 1:26:13system we go to the upper right hand
  1892. 1:26:16corner click on the top bar then scroll
  1893. 1:26:19down to the gears icon for settings go
  1894. 1:26:23down to the bottom for d
  1895. 1:26:25details and then I can click on default
  1896. 1:26:29applications so you see under web or
  1897. 1:26:31browser there are three choices on this
  1898. 1:26:34system I have Google Chrome Firefox or
  1899. 1:26:37Opera we'll leave it at Google
  1900. 1:26:40Chrome for video the default choic is
  1901. 1:26:44videos which is actually a program
  1902. 1:26:46called totem but let's switch it to the
  1903. 1:26:49VC media player and for the image viewer
  1904. 1:26:52I have the built-in image viewer or I
  1905. 1:26:55could switch to the new image
  1906. 1:26:57manipulation program better known as
  1907. 1:26:59so on all recent distributions with
  1908. 1:27:03a gnome desktop the procedure is
  1909. 1:27:06identical and absolutely the same and
  1910. 1:27:08it's very simple to change your default
  1911. 1:27:15applications each distribution
  1912. 1:27:17implements the naist or file manager
  1913. 1:27:21utility which is used to navigate the
  1914. 1:27:23file system
  1915. 1:27:24it can locate files and when a file is
  1916. 1:27:26clicked upon either it will run if it's
  1917. 1:27:29a program or an associate application
  1918. 1:27:31will be launched using the file as data
  1919. 1:27:34this behavior is completely familiar to
  1920. 1:27:36anyone who has used other operating
  1921. 1:27:38systems to start the file manager you
  1922. 1:27:41will have to click on its icon a file
  1923. 1:27:43cabinet which is easily found usually
  1924. 1:27:46under favorites or accessories it will
  1925. 1:27:49have the name files this will open a
  1926. 1:27:52window with your home directory
  1927. 1:27:54displayed the left panel of the file
  1928. 1:27:56manager window holds a list of commonly
  1929. 1:27:59used directories such as desktop
  1930. 1:28:03documents downloads and
  1931. 1:28:09pictures the file manager let you access
  1932. 1:28:11different locations on your computer and
  1933. 1:28:13the network including the home directory
  1934. 1:28:16the desktop uh documents pictures and
  1935. 1:28:20other other locations every user with an
  1936. 1:28:23account on on the system will have a
  1937. 1:28:25home directory usually created under
  1938. 1:28:28home slome and usually named according
  1939. 1:28:30to the user such as slome SL student by
  1940. 1:28:34default files the user saves will be
  1941. 1:28:36placed in a directory Stree starting
  1942. 1:28:39there account creation whether during
  1943. 1:28:41system installation or at a later time
  1944. 1:28:44when a new user is added also induces
  1945. 1:28:46default directories to be created under
  1946. 1:28:48the user's home directory such as
  1947. 1:28:52documents desktop and and
  1948. 1:28:59downloads the file manager allows you to
  1949. 1:29:01view files and directories in more than
  1950. 1:29:03one way you can switch between the icons
  1951. 1:29:06and list formats either by clicking The
  1952. 1:29:09Familiar icons in the top bar or you can
  1953. 1:29:11press control1 or control2 respectively
  1954. 1:29:14in addition you can also arrange the
  1955. 1:29:16files and directories by name size type
  1956. 1:29:19or modification date for future sorting
  1957. 1:29:23to do so click View and select arrange
  1958. 1:29:26items another useful option is to show
  1959. 1:29:29hidden files sometimes I'm precisely
  1960. 1:29:31called system files which are usually
  1961. 1:29:34configuration files that are hidden by
  1962. 1:29:36default and whose name starts with a DOT
  1963. 1:29:39to show hidden files select show hidden
  1964. 1:29:42files from the menu or press controll h
  1965. 1:29:45the file browser provides multiple ways
  1966. 1:29:47to customize your window view to
  1967. 1:29:50facilitate easy drag and drop file
  1968. 1:29:53operations you can also alter the size
  1969. 1:29:55of the icons by selecting zoom in and
  1970. 1:29:58zoom out under the view menu the file
  1971. 1:30:02manager includes a great Search tool
  1972. 1:30:04inside the file browser
  1973. 1:30:06window one click search in the toolbar
  1974. 1:30:09to bring up a text box then enter the
  1975. 1:30:12keyword in this text box this causes the
  1976. 1:30:14system to perform a recursive search
  1977. 1:30:16from the current directory for any file
  1978. 1:30:19or directory which contains a part of
  1979. 1:30:21this keyword you can refine your search
  1980. 1:30:24beyond the initial keyword by providing
  1981. 1:30:27drop-down menus to further filter the
  1982. 1:30:33search deleting a file in Nautilus will
  1983. 1:30:35automatically move the deleted file to
  1984. 1:30:38the lo/ share tr/ files directory uh
  1985. 1:30:42basically a trash can under the user's
  1986. 1:30:44home directory there are several ways to
  1987. 1:30:46delete files and directories under
  1988. 1:30:48Nautilus one you can select all you
  1989. 1:30:51select all the files and directories
  1990. 1:30:52that you want to delete then press
  1991. 1:30:54control delete on your keyboard or right
  1992. 1:30:57click the file then select move to
  1993. 1:31:00trash note that you may have a delete
  1994. 1:31:04permanently option which bypasses the
  1995. 1:31:06trash folder and this option may be
  1996. 1:31:09visible all the time or only in list
  1997. 1:31:12rather than icon mode to permanently
  1998. 1:31:15delete a file on the left panel inside a
  1999. 1:31:18nautilus file browser window rightclick
  2000. 1:31:21on the trash the the on the trash
  2001. 1:31:23directory
  2002. 1:31:24select empty trash and that's all
  2003. 1:31:28alternatively select the file or
  2004. 1:31:30directory you want to permanently delete
  2005. 1:31:33and press shift delete let's see how to
  2006. 1:31:36locate the Firefox application in locate
  2007. 1:31:40Firefox click activities on the top left
  2008. 1:31:43corner of your desktop on the left panel
  2009. 1:31:46click the show applications icon click
  2010. 1:31:49the Firefox
  2011. 1:31:52icon close Firefox by clicking close in
  2012. 1:31:55the top right corner of the Firefox
  2013. 1:31:58window next let's explore the home
  2014. 1:32:01directory using the file manager try to
  2015. 1:32:03View files in list mode create a new
  2016. 1:32:06empty document save it and remove it
  2017. 1:32:10click activities in the upper left
  2018. 1:32:11corner of your
  2019. 1:32:13desktop in the left panel click the file
  2020. 1:32:16manager icon this will by default open
  2021. 1:32:19the home directory to View files in list
  2022. 1:32:22mode click the list icon in the upper
  2023. 1:32:24right of the file manager window
  2024. 1:32:27doubleclick the document directory to
  2025. 1:32:29open it click activities in the top left
  2026. 1:32:32corner of your desktop to launch
  2027. 1:32:36gedit type gedit in the search box click
  2028. 1:32:40the gedit icon to open
  2029. 1:32:43it type your name and click close in the
  2030. 1:32:46top right corner of the gedit window to
  2031. 1:32:49create and close a file click save as to
  2032. 1:32:52save the created file
  2033. 1:32:54select documents from the left panel of
  2034. 1:32:57the save as
  2035. 1:32:58window type test to save the file by
  2036. 1:33:01that
  2037. 1:33:02name click save to save the file and
  2038. 1:33:05close gedit this brings you back to the
  2039. 1:33:07document directory rightclick the test
  2040. 1:33:10file in the document window select move
  2041. 1:33:13to trash to remove the
  2042. 1:33:19file you have completed chapter 4 let's
  2043. 1:33:22summarize the key Concepts covered gome
  2044. 1:33:25is a popular desktop environment and
  2045. 1:33:28graphical user interface that runs on
  2046. 1:33:30top of the Linux operating system the
  2047. 1:33:33default display manager for Gnome is
  2048. 1:33:35called gdm the gdm display manager
  2049. 1:33:39presents the user with the login screen
  2050. 1:33:41which prompt for the user the login
  2051. 1:33:43username and password loging out through
  2052. 1:33:45the desktop environment kills all
  2053. 1:33:48processes in your current X session and
  2054. 1:33:51returns to the display manager login
  2055. 1:33:53screen Linux enables users to switch
  2056. 1:33:56between logged in sessions suspending
  2057. 1:33:59puts the computer into sleep mode for
  2058. 1:34:01each key task there is generally a
  2059. 1:34:03default application
  2060. 1:34:05installed every user created in the
  2061. 1:34:08system will have a home
  2062. 1:34:10directory the places menu contains
  2063. 1:34:13entries that allow you to access
  2064. 1:34:15different parts of the computer and the
  2065. 1:34:18network Nautilus gives three formats to
  2066. 1:34:21View files each each Linux distribution
  2067. 1:34:25comes with its own set of desktop
  2068. 1:34:27backgrounds gnome comes with a set of
  2069. 1:34:30different themes which can change the
  2070. 1:34:32way your applications
  2071. 1:34:37look by the end of this chapter you
  2072. 1:34:39should be able to apply system display
  2073. 1:34:42and date and time settings using the
  2074. 1:34:44system settings panel track the network
  2075. 1:34:47settings and manage connections using
  2076. 1:34:49the network manager in Linux install an
  2077. 1:34:53update soft Ware Linux from a graphical
  2078. 1:34:56interface note that we'll revisit all
  2079. 1:34:58these tasks later when we discuss how to
  2080. 1:35:00accomplish them from the command
  2081. 1:35:06line the system settings panel allows
  2082. 1:35:09you to control most of the basic
  2083. 1:35:11configuration options and desktop
  2084. 1:35:13settings such as specifying the screen
  2085. 1:35:15resolution managing network connections
  2086. 1:35:17or changing the date and time of the
  2087. 1:35:20system for The Gnome desktop manager one
  2088. 1:35:23clicks on the upper right hand corner
  2089. 1:35:25and then selects the tools image the
  2090. 1:35:27screwdriver crossed with a rinse or a
  2091. 1:35:29gear uh depending on your distribution
  2092. 1:35:32you may find other ways to get into the
  2093. 1:35:33settings configurations as well you'll
  2094. 1:35:36also find variations in the menu layout
  2095. 1:35:38between Linux distributions and versions
  2096. 1:35:40so you may have to hunt for the settings
  2097. 1:35:41you need or to examine or
  2098. 1:35:48modify to get deeper into configuration
  2099. 1:35:51one can click on the devices on the
  2100. 1:35:54previous menu in order to configure
  2101. 1:35:56items like the display the keyboard the
  2102. 1:35:59printers Etc one can also click on the
  2103. 1:36:02users icon which may be under details to
  2104. 1:36:05set values for system users such as
  2105. 1:36:08their login picture password
  2106. 1:36:14Etc a lot of personalized configuration
  2107. 1:36:17settings do not appear on the settings
  2108. 1:36:18menu instead you have to launch a tool
  2109. 1:36:21called either gnome tweaks or gnome
  2110. 1:36:24tweak tool we have not really discussed
  2111. 1:36:27working at the command line yet but you
  2112. 1:36:29can always launch a program such as this
  2113. 1:36:31by doing alt F2 and typing in the
  2114. 1:36:34command some distributions have a link
  2115. 1:36:36to the tweaks menu in the settings but
  2116. 1:36:39for some mysterious reason many obscure
  2117. 1:36:41this Tool's existence and it becomes
  2118. 1:36:43hard to discover how to modify even
  2119. 1:36:46rather basic desk type attributes and
  2120. 1:36:49behaviors important things you can do
  2121. 1:36:51with this tool include selecting a theme
  2122. 1:36:53configuring extensions which you can get
  2123. 1:36:56from your distribution or download from
  2124. 1:36:59the internet you can control fonts mod
  2125. 1:37:01modify the keyboard layout and set which
  2126. 1:37:04program start when you log in the most
  2127. 1:37:06recent gnome versions have removed a lot
  2128. 1:37:08of the functionality of gnome tweaks
  2129. 1:37:12extensions now have to be configured
  2130. 1:37:13using a new a new app called gnome
  2131. 1:37:15extensions app the reasoning for this is
  2132. 1:37:18obscure here you can see a screenshot
  2133. 1:37:20from a red hat system with quite a few
  2134. 1:37:23extensions installed but not all being
  2135. 1:37:29used clicking on settings displays or
  2136. 1:37:32settings devices displays will expose
  2137. 1:37:35the most common settings for changing
  2138. 1:37:37the desktop appearance these settings
  2139. 1:37:40function independently of the specific
  2140. 1:37:42display drivers you're running the exact
  2141. 1:37:45appearance will depend enormously on how
  2142. 1:37:48many monitors you have and other factors
  2143. 1:37:50such as Linux distribution and
  2144. 1:37:52particular vers
  2145. 1:37:55if your system uses a proprietary video
  2146. 1:37:58card driver usually from Nvidia or AMD
  2147. 1:38:01you'll probably have a separate
  2148. 1:38:03configuration program for that driver
  2149. 1:38:06this program may give more configuration
  2150. 1:38:08options but may also be more complicated
  2151. 1:38:11and might require admin root access if
  2152. 1:38:14possible you should configure the
  2153. 1:38:16settings in the displays panel rather
  2154. 1:38:18than with the proprietary program the X
  2155. 1:38:22server which actually provid Ides the
  2156. 1:38:24the guey uses SLC x1x org.com as its
  2157. 1:38:29configuration file if it exists in
  2158. 1:38:31modern Linux distributions this file is
  2159. 1:38:34usually present only in unusual
  2160. 1:38:36circumstances such as when certain less
  2161. 1:38:39common graphic drivers are in use
  2162. 1:38:41changing this configuration file
  2163. 1:38:43directly is usually for more advanced
  2164. 1:38:50users while your system will usually
  2165. 1:38:52figure out the the best resolution for
  2166. 1:38:54your screen automatically it may get
  2167. 1:38:56this wrong in some cases or you might
  2168. 1:38:58want to change the resolution to meet
  2169. 1:39:01your needs you can accomplish this using
  2170. 1:39:04the displays panel the switch the switch
  2171. 1:39:07to the new resolution will be effective
  2172. 1:39:09when you click apply and then confirm
  2173. 1:39:11that the resolution is working in case
  2174. 1:39:14the selected resolution fails to work or
  2175. 1:39:16you're just not happy with the
  2176. 1:39:18appearance the system will switch back
  2177. 1:39:20to the original resolution after a short
  2178. 1:39:22timeout once again the exact appearance
  2179. 1:39:25of the configuration screen will vary a
  2180. 1:39:27lot between distributions and versions
  2181. 1:39:30but usually it's rather intuitive and
  2182. 1:39:32easy Once you find the configuration
  2183. 1:39:35menus in most cases the configuration
  2184. 1:39:37for multiple displays is set up
  2185. 1:39:39automatically as one big screen spanning
  2186. 1:39:42all monitors using a reasonable guess
  2187. 1:39:44for screen layout if the screen layout
  2188. 1:39:47is not as desired a checkbox can turn on
  2189. 1:39:49mirrored mode where the same display is
  2190. 1:39:51seen on all monitors clicking on a
  2191. 1:39:53particular monitor image lets you
  2192. 1:39:55configure the resolution of each one and
  2193. 1:39:59whether they make one big screen or
  2194. 1:40:01mirror the same video configuring
  2195. 1:40:04display settings such as resolution is
  2196. 1:40:06almost identical on all major
  2197. 1:40:08distributions so we'll demonstrate that
  2198. 1:40:12running virtual machines under VMware on
  2199. 1:40:15a red hat 8 host so let's begin with
  2200. 1:40:19showing what it looks like on
  2201. 1:40:21auntu so I go up in the upper right hand
  2202. 1:40:24corner and I find the settings
  2203. 1:40:27button and then uh in the main uh panel
  2204. 1:40:31here we have displays so we've already
  2205. 1:40:34clicked on that and you see uh the
  2206. 1:40:37easiest thing to do here is I can change
  2207. 1:40:40the resolution to be any one of these
  2208. 1:40:42numbers now you can continuously vary
  2209. 1:40:46the display size usually on a virtual
  2210. 1:40:49machine um and by dragging and dropping
  2211. 1:40:52the corners you see now it's changed to
  2212. 1:40:54another number but that's all that's
  2213. 1:40:56involved in Ubuntu for instance if I
  2214. 1:40:59want to go to open well let's try
  2215. 1:41:03Centos Centos uh H stream actually I
  2216. 1:41:08find the settings once again and then
  2217. 1:41:11here you have to scroll down to
  2218. 1:41:13devices and then displays is in there
  2219. 1:41:16and we have the identical setup except
  2220. 1:41:18for this NightLight uh option which is
  2221. 1:41:21for looking in a darker situation a
  2222. 1:41:24which we also had in the auntu was just
  2223. 1:41:26located in a different place on open
  2224. 1:41:30Su you'll see it's virtually identical
  2225. 1:41:33as well I just click on the uh settings
  2226. 1:41:36gear button here and uh once again I
  2227. 1:41:40have to go to devices like I did on the
  2228. 1:41:43red hat system and I have the identical
  2229. 1:41:45situation you couldn't tell what
  2230. 1:41:48operating system you were on if you just
  2231. 1:41:50looked at
  2232. 1:41:51this now the these are all virtual
  2233. 1:41:54machines with one terminal if I look on
  2234. 1:41:56the host which actually has three
  2235. 1:41:58different monitors hooked up to it
  2236. 1:42:01you'll see then I get something like
  2237. 1:42:03this where I can see all three of my
  2238. 1:42:06monitors uh I can figure any one of them
  2239. 1:42:09here it's doing the the smaller one the
  2240. 1:42:1118inch one but I could switch to the 27
  2241. 1:42:15or the
  2242. 1:42:1624 and I can control uh their different
  2243. 1:42:20resolutions if I move these around here
  2244. 1:42:24I can change the way the three of them
  2245. 1:42:26are laid out from left to right I don't
  2246. 1:42:29particularly want to do that uh because
  2247. 1:42:31it gets kind of messy but this is how
  2248. 1:42:33you can control which one's in the
  2249. 1:42:35middle which is on the right or left Etc
  2250. 1:42:38so these days configuring the display
  2251. 1:42:40resolution and some other basic things
  2252. 1:42:43is really very simple very intuitive the
  2253. 1:42:45hardest thing is just to find the the um
  2254. 1:42:49settings icon to click on
  2255. 1:42:56by default Linux always uses coordinated
  2256. 1:42:58universal time for its own internal
  2257. 1:43:01timee keeping displayed or stored time
  2258. 1:43:03values rely on the system time zone
  2259. 1:43:06setting to get the proper time UTC is
  2260. 1:43:08similar to but more accurate than green
  2261. 1:43:11witch
  2262. 1:43:12meantime if you click on the time
  2263. 1:43:14displayed on the top panel you can
  2264. 1:43:16adjust the format with which the date
  2265. 1:43:18and time is shown on some distributions
  2266. 1:43:20you can also alter the values the more
  2267. 1:43:24detailed date and time settings can be
  2268. 1:43:26selected from the date and time window
  2269. 1:43:28in the system settings menu the
  2270. 1:43:31automatic settings are referring to the
  2271. 1:43:34use of network time protocol which we'll
  2272. 1:43:37discuss
  2273. 1:43:42next the network time protocol is the
  2274. 1:43:45most popular and reliable protocol for
  2275. 1:43:47setting the local time by Consulting
  2276. 1:43:50established internet servers l
  2277. 1:43:53distributions always come with a working
  2278. 1:43:55ntp setup which refers to a specific
  2279. 1:43:58time servers run or relied on by the
  2280. 1:44:01distribution this means that no setup
  2281. 1:44:03Beyond on or off is generally required
  2282. 1:44:05for Network time
  2283. 1:44:11synchronization all Linux distributions
  2284. 1:44:13have network configuration files but
  2285. 1:44:15file formats and locations can differ
  2286. 1:44:17from one distribution to another hand
  2287. 1:44:19editing of these files can handle quite
  2288. 1:44:22complicated set
  2289. 1:44:23but it's not very dynamic or easy to
  2290. 1:44:26learn and use network manager was
  2291. 1:44:28developed to make things easier and more
  2292. 1:44:31uniform across distributions it can list
  2293. 1:44:34all available networks both wired and
  2294. 1:44:36wireless allow the choice of a wired
  2295. 1:44:39Wireless or mobile broadband Network
  2296. 1:44:41handle passwords and set up virtual
  2297. 1:44:43private networks except for unusual
  2298. 1:44:46situations it's generally best to let
  2299. 1:44:49network manager establish your
  2300. 1:44:51connections and keep track of your
  2301. 1:44:53settings in this section you'll learn
  2302. 1:44:55how to manage network connections
  2303. 1:44:57including wired and wireless connections
  2304. 1:45:00and mobile broadband and VPN
  2305. 1:45:07connections wired connections usually do
  2306. 1:45:09not require complicated or manual
  2307. 1:45:11configuration the hardware interface and
  2308. 1:45:14Signal presence are automatically
  2309. 1:45:16detected and then network manager sets
  2310. 1:45:18the actual network settings via Dynamic
  2311. 1:45:21host configuration protocol or
  2312. 1:45:24DHCP for static configurations that do
  2313. 1:45:28not use DHCP manual setup can also be
  2314. 1:45:31done easily through network manager you
  2315. 1:45:34can also change the Ethernet Mac address
  2316. 1:45:37or media Access Control address if your
  2317. 1:45:40Hardware supports it the MAC address is
  2318. 1:45:42a unique hexadecimal number of your
  2319. 1:45:45network card wireless networks are
  2320. 1:45:47usually not connected by default you can
  2321. 1:45:49view the list of available wireless
  2322. 1:45:51networks and see which one if any you're
  2323. 1:45:55currently connected to by using network
  2324. 1:45:57manager you can then add edit or remove
  2325. 1:46:00known wireless networks and also specify
  2326. 1:46:03which one which ones you want connected
  2327. 1:46:05by default when
  2328. 1:46:11present to configure a wireless network
  2329. 1:46:14in any recent gnome based
  2330. 1:46:16distribution click on the upper right
  2331. 1:46:19corner of the top panel which brings up
  2332. 1:46:21a settings and or Network window while
  2333. 1:46:24the exactic appearance will depend on
  2334. 1:46:26Linux distribution inv verion it will
  2335. 1:46:28always be possible to click on a Wi-Fi
  2336. 1:46:31submenu as long as the hardware is
  2337. 1:46:34present here is an example from a real 8
  2338. 1:46:37System select the wireless network you
  2339. 1:46:40wish to connect to if it's a secure
  2340. 1:46:42network the first time it will request
  2341. 1:46:44that you enter the appropriate password
  2342. 1:46:47by default the password will be saved
  2343. 1:46:49for subsequent connections if you click
  2344. 1:46:53on Wi-Fi settings you will bring up this
  2345. 1:46:56if you click on the gear icon for any
  2346. 1:47:00connection you can configure it in more
  2347. 1:47:02detail older and other Linux
  2348. 1:47:05distributions may look quite a bit
  2349. 1:47:06different in detail but the steps and
  2350. 1:47:08choices are essentially identical as
  2351. 1:47:11they're all running network manager with
  2352. 1:47:13perhaps somewhat different
  2353. 1:47:15clothing let's
  2354. 1:47:17demonstrate how to control wired and
  2355. 1:47:20wireless network connections on a red
  2356. 1:47:22head
  2357. 1:47:24system if I click on the upper right
  2358. 1:47:26hand corner for instance if I want to
  2359. 1:47:28look at the wired connection I can just
  2360. 1:47:30scroll down to the wired connection and
  2361. 1:47:32then wired settings and it asks me for
  2362. 1:47:36my password the root the root password
  2363. 1:47:39because it it
  2364. 1:47:40wants to have a super user only control
  2365. 1:47:44network
  2366. 1:47:45connections and you'll see I have a
  2367. 1:47:47th000 megabit connection if I click on
  2368. 1:47:50the gear icon I can control the settings
  2369. 1:47:53on the details first screen it says it
  2370. 1:47:56connects automatically when the system
  2371. 1:47:57starts and all users can use
  2372. 1:48:00it on identity I give what the name of
  2373. 1:48:03the interface looks like not the name of
  2374. 1:48:05the
  2375. 1:48:06system uh in older systems that would
  2376. 1:48:09have been eth0 eth1 Etc but as we will
  2377. 1:48:13discuss later newer systems have these
  2378. 1:48:16more complex
  2379. 1:48:18names under ipv4 we control the basic
  2380. 1:48:21Internet Protocol system systems
  2381. 1:48:24settings most of the time you'll leave
  2382. 1:48:26it alone at automatic DHCP Dynamic host
  2383. 1:48:30configuration protocol where the system
  2384. 1:48:32figures out its address from the server
  2385. 1:48:36Etc if you understand how the importance
  2386. 1:48:40of manual settings you can specify an
  2387. 1:48:42address a net mask a Gateway you can
  2388. 1:48:45select a particular DNS server and you
  2389. 1:48:48can specify roots to certain addresses
  2390. 1:48:52if you understand understand those
  2391. 1:48:53Concepts this is where you would go to
  2392. 1:48:55control all that we're not changing
  2393. 1:48:57anything so I'll just hit
  2394. 1:48:59cancel now if I want to control Wi-Fi
  2395. 1:49:01settings I could go back to that upper
  2396. 1:49:03right corner or I can just click on the
  2397. 1:49:06Wi-Fi setting here and once again it's
  2398. 1:49:08asking me for the super user password
  2399. 1:49:13these are the different wireless
  2400. 1:49:15networks that have to be that are
  2401. 1:49:17available at the moment they all have
  2402. 1:49:18locks next to them means they require a
  2403. 1:49:21password this is the one that I'm
  2404. 1:49:23actually on Coupe J the first one and if
  2405. 1:49:26I click on the settings there once again
  2406. 1:49:28it's going to ask me for
  2407. 1:49:32um my P my super user password and I see
  2408. 1:49:36essentially the exact same settings I
  2409. 1:49:38had on the wir connection the automatic
  2410. 1:49:42startup as other people use it the
  2411. 1:49:45identity and whether I want to use DHCP
  2412. 1:49:48or set things manually or
  2413. 1:49:50not so that's all there really is in the
  2414. 1:49:53graphical interface to control basic
  2415. 1:49:55network connections it's rather simple
  2416. 1:49:58and it looks the same at all recent
  2417. 1:50:00Linux
  2418. 1:50:07distributions you can set up mobile
  2419. 1:50:09broadband connection with network
  2420. 1:50:10manager which will launch a wizard to
  2421. 1:50:13set up the connection details for each
  2422. 1:50:16connection once the configuration is
  2423. 1:50:18done the network is configured
  2424. 1:50:20automatically each time the broadband
  2425. 1:50:22network is attached network manager can
  2426. 1:50:25also manage manage your VPN connections
  2427. 1:50:29it supports many VPN Technologies such
  2428. 1:50:32as native IPC Cisco open connect via
  2429. 1:50:35either the Cisco client or a native open
  2430. 1:50:37source client Microsoft pptp and
  2431. 1:50:40openvpn you might get support for VPN as
  2432. 1:50:43a separate package from your distributor
  2433. 1:50:47you need to install this package if your
  2434. 1:50:49preferred VPN is not supported
  2435. 1:50:56each package in Linux distribution
  2436. 1:50:59provides one piece of the system such as
  2437. 1:51:01the Linux kernel the C compiler
  2438. 1:51:04utilities for manipulating text or
  2439. 1:51:06configuring the network or for your
  2440. 1:51:08favorite web browsers and email clients
  2441. 1:51:12packages often depend on each other for
  2442. 1:51:14example because your email client
  2443. 1:51:16communicates using ssltls it will depend
  2444. 1:51:19on a package which provides the ability
  2445. 1:51:21to encrypt and decrypt SSL and TLS
  2446. 1:51:25communication and will not install
  2447. 1:51:26unless that package is also installed at
  2448. 1:51:28the same time all systems have a lower
  2449. 1:51:32level utility which handles the details
  2450. 1:51:34of unpacking a package and putting the
  2451. 1:51:36pieces in the right places most of the
  2452. 1:51:39time you will be working with a higher
  2453. 1:51:41level utility which knows how to
  2454. 1:51:43download packages from the internet and
  2455. 1:51:45can manage dependencies and groups for
  2456. 1:51:48you in this section you will learn how
  2457. 1:51:50to install and update software in Linux
  2458. 1:51:53using the dbn packaging system used by
  2459. 1:51:56systems such as Ubuntu as well and RPM
  2460. 1:51:59Packaging Systems which is used by both
  2461. 1:52:02red hat and the Susi family systems
  2462. 1:52:05there are these are the main ones in use
  2463. 1:52:07although there are other ones which work
  2464. 1:52:09well for other distributions which are
  2465. 1:52:11less
  2466. 1:52:15used let's look at the package
  2467. 1:52:18management for the Debian family
  2468. 1:52:21system dpkg is the underlying package
  2469. 1:52:25manager for these systems it can install
  2470. 1:52:28remove and build packages unlike higher
  2471. 1:52:31level packages Management Systems it
  2472. 1:52:34does not automatically download and
  2473. 1:52:35install packages and satisfy their
  2474. 1:52:38dependencies for deviant based systems
  2475. 1:52:41the higher level package management
  2476. 1:52:43system is the advanced package tool or a
  2477. 1:52:49system of utilities generally while each
  2478. 1:52:51distribution with within the devian
  2479. 1:52:53family uses AP it creates its own user
  2480. 1:52:56interface on top of it for example AP
  2481. 1:52:59kit or app kit sympatic uh yuntu
  2482. 1:53:01software Center Etc although apt
  2483. 1:53:04repositories are generally compatible
  2484. 1:53:06with each other the software they
  2485. 1:53:07contain generally is not therefore most
  2486. 1:53:10repositories Target a particular
  2487. 1:53:12distribution like yuntu and often
  2488. 1:53:14software Distributors ship with multiple
  2489. 1:53:17repositories to support multiple
  2490. 1:53:19distributions demonstrations are shown
  2491. 1:53:21later in this section
  2492. 1:53:27Red Hat package manager or RPM is the
  2493. 1:53:30other package management system popular
  2494. 1:53:32on Linux distributions it was developed
  2495. 1:53:34by red hat and adopted by a number of
  2496. 1:53:37other distributions including Susi and
  2497. 1:53:39open Susi uh C OS Oracle Linux and
  2498. 1:53:42others the highlevel package manager
  2499. 1:53:45differs between distributions Red Hat
  2500. 1:53:48Family distributions historically use re
  2501. 1:53:50or SOS and fedora uses dnf while
  2502. 1:53:54retaining good backward compatibility
  2503. 1:53:56with the older yum program Susi family
  2504. 1:53:59distribution such as open Susi also use
  2505. 1:54:01RPM but use the zipper
  2506. 1:54:08interface the yet another setup tool or
  2507. 1:54:11yast software manager is similar to
  2508. 1:54:14other graphical package managers it's an
  2509. 1:54:17RPM based application you can add remove
  2510. 1:54:20or update packages using this
  2511. 1:54:22application very easily to access the
  2512. 1:54:24yes software manager first click
  2513. 1:54:28activities then in the search box type
  2514. 1:54:31yes and click on the yes icon then click
  2515. 1:54:36software management you can also find
  2516. 1:54:38yes by clicking on applications other
  2517. 1:54:41yes which is a strange place to put it
  2518. 1:54:44uh but open su's yes software management
  2519. 1:54:46application is similar to The graphical
  2520. 1:54:49package managers and other distributions
  2521. 1:54:52uh demonstration of the Yas software
  2522. 1:54:54manager is seen later in this
  2523. 1:55:00section we are now going to demonstrate
  2524. 1:55:02software package management from a
  2525. 1:55:04graphical interface using the open Su
  2526. 1:55:08Linux
  2527. 1:55:09distribution the tool we want to use for
  2528. 1:55:12doing this is yast yst and there's two
  2529. 1:55:16different ways I can reach it if I have
  2530. 1:55:18the gnome shell extension installed
  2531. 1:55:21which shows the application s menu which
  2532. 1:55:23doesn't come by default I can go down to
  2533. 1:55:26systems tools and then go down to yes or
  2534. 1:55:30I can always go up to the upper right
  2535. 1:55:33hand corner click on the tool
  2536. 1:55:36icon and then at the bottom here on the
  2537. 1:55:38system click on yes it will want the
  2538. 1:55:41root password CU I'm going to manipulate
  2539. 1:55:44what's installed on the system and so if
  2540. 1:55:47I go to software I can go to software
  2541. 1:55:50management
  2542. 1:55:54now the first thing that yes has to do
  2543. 1:55:57is study the system and get a database
  2544. 1:55:59of every possible
  2545. 1:56:02package so it you can look at the
  2546. 1:56:04packages on the system in different ways
  2547. 1:56:07you can look by what's called RPM groups
  2548. 1:56:11so here's all the games are grouped
  2549. 1:56:14under
  2550. 1:56:14amusements I have applications
  2551. 1:56:17development and all different kinds of
  2552. 1:56:19development
  2553. 1:56:21subcategories tools documentation Etc or
  2554. 1:56:25RPM groups that is rpm groups
  2555. 1:56:30okay yeah pack or I can look at package
  2556. 1:56:33groups which maybe is a little more
  2557. 1:56:34intuitive so I could click on let's say
  2558. 1:56:37multimedia and see all the different
  2559. 1:56:39programs are involved in uh in dealing
  2560. 1:56:41with
  2561. 1:56:42multimedia suppose I want to install
  2562. 1:56:46something or inquire as to where
  2563. 1:56:47something is installed I can click on
  2564. 1:56:50search and type something in here I'll
  2565. 1:56:53type G
  2566. 1:56:56plot and I bring up quickly all the
  2567. 1:56:59different G plot uh pro programs there
  2568. 1:57:03are the main one you see has a check
  2569. 1:57:06mark in the box that means it's already
  2570. 1:57:09installed
  2571. 1:57:11um I will decide to install gup plot do
  2572. 1:57:15doc which is a small documentation
  2573. 1:57:18package and then in order to do the
  2574. 1:57:20install I will click on
  2575. 1:57:23accept and I we go ahead and do it it's
  2576. 1:57:26a pretty small package it doesn't take
  2577. 1:57:28long if you needed some other packages a
  2578. 1:57:30function it would have installed them at
  2579. 1:57:32the same time so now I'll say
  2580. 1:57:36continue and if I can want to remove it
  2581. 1:57:39because I don't really need it I'll type
  2582. 1:57:41it that in the search
  2583. 1:57:44again and then I click on
  2584. 1:57:47here
  2585. 1:57:49um until I get an X for removal
  2586. 1:57:53and then I say
  2587. 1:57:55accept and it's removing it so that's
  2588. 1:57:59all I had to do to do some basic package
  2589. 1:58:02installation and removal under gnome
  2590. 1:58:04software with open Su pretty
  2591. 1:58:14simple experienced Linux administrators
  2592. 1:58:17probably do most of their package
  2593. 1:58:20management from the command line rather
  2594. 1:58:22than from a graphical
  2595. 1:58:24interface however every Linux
  2596. 1:58:26distribution has at least one graphical
  2597. 1:58:29interface for installing upgrading
  2598. 1:58:32removing Etc various software packages
  2599. 1:58:36so let's take a look at a recent Ubuntu
  2600. 1:58:39system uh I can go to Applications and
  2601. 1:58:42then down to system tools and first
  2602. 1:58:45let's look at the one at the bottom here
  2603. 1:58:48which just says
  2604. 1:58:49software this is actually a program
  2605. 1:58:52progr called gnome
  2606. 1:58:54software uh you can always install it if
  2607. 1:58:56it hasn't been installed on your system
  2608. 1:58:58it looks somewhat like an app store or
  2609. 1:59:01Play Store from Android and uh it's
  2610. 1:59:05pretty obvious you can click in any one
  2611. 1:59:07of these to try to install Etc and at
  2612. 1:59:10the bottom you'll see things are grouped
  2613. 1:59:13by category so for instance oh I could
  2614. 1:59:16click on
  2615. 1:59:18utilities and then I'll see a bunch of
  2616. 1:59:20different utilities uh that may or may
  2617. 1:59:22not be installed on your system already
  2618. 1:59:27okay or I could search for various
  2619. 1:59:29things so let me go back to the main
  2620. 1:59:32page and
  2621. 1:59:34um if I click on The Hourglass up in the
  2622. 1:59:37corner here I can search so let's say I
  2623. 1:59:40search on
  2624. 1:59:44Terminal and you'll see it'll come up
  2625. 1:59:46with a number of different things I
  2626. 1:59:47could install you'll see here this
  2627. 1:59:50terminal here is the a gome terminal and
  2628. 1:59:53it says installed in a rather small font
  2629. 1:59:56here uh and if I wanted to install
  2630. 2:00:00something else I could just say for
  2631. 2:00:01instance here I could click on that and
  2632. 2:00:04I would say install and it could just be
  2633. 2:00:07installed or if I want something a
  2634. 2:00:09little more fun let's say I'll look for
  2635. 2:00:12a program called
  2636. 2:00:14cheese which let's you use your um
  2637. 2:00:19webcam to take pictures
  2638. 2:00:22or or make videos Etc and I can say
  2639. 2:00:26remove cuz it turns out it's already
  2640. 2:00:28installed so let me remove
  2641. 2:00:31it and it's going to want a password to
  2642. 2:00:33do this which shouldn't be that priz
  2643. 2:00:38surprising so I type my password and
  2644. 2:00:41it's removing
  2645. 2:00:42it and then uh you know if I want to
  2646. 2:00:46reinstall it which I'll do I'll just say
  2647. 2:00:48install and give the password again
  2648. 2:00:53so this is not a very complex program to
  2649. 2:00:56use uh it's pretty easy to use gome
  2650. 2:00:59software and you notice at the top you
  2651. 2:01:02have a list here of explore which is
  2652. 2:01:05where you are now installed would be all
  2653. 2:01:07your installed packages and if you do
  2654. 2:01:10updates it's telling me the system has
  2655. 2:01:12two sets of updates that I really should
  2656. 2:01:14install but the save time I'll do that
  2657. 2:01:17right
  2658. 2:01:18now so that's one graphical interface
  2659. 2:01:21there's a much older graphical interface
  2660. 2:01:24that's available intu called synaptic so
  2661. 2:01:27let's do that
  2662. 2:01:30one
  2663. 2:01:32uh I thought it was it's under system
  2664. 2:01:36tools there we go synaptic package
  2665. 2:01:43manager and once again this is going to
  2666. 2:01:46ask for a
  2667. 2:01:49password and uh it's an informatory
  2668. 2:01:53message and this is actually a very
  2669. 2:01:55simple easy to use and uh it gives you a
  2670. 2:01:59clear uh vision of exactly where
  2671. 2:02:01everything came from compared to the
  2672. 2:02:04more modern graphical interfaces it's
  2673. 2:02:07pretty straight forward to use um it's
  2674. 2:02:10organized by either sections here I can
  2675. 2:02:13do it in other ways I can do searching
  2676. 2:02:17uh uh Etc so suppose I want to search
  2677. 2:02:20well I'll do the same search your
  2678. 2:02:25terminal and it's going to show me all
  2679. 2:02:27the packages that either have terminal
  2680. 2:02:29in the name or discuss terminal if I
  2681. 2:02:31want to restrict it to ones that have
  2682. 2:02:34only uh in the name I can do
  2683. 2:02:38that and it's pretty straightforward to
  2684. 2:02:41use I won't run through this these are
  2685. 2:02:43already installed because they're in
  2686. 2:02:45green uh I can install any of these
  2687. 2:02:48other ones and I can just click on that
  2688. 2:02:51and then up let's say I want to do QT
  2689. 2:02:54terminal I would say Mark for
  2690. 2:02:57installation and it says in order to
  2691. 2:02:59this to work it has to install these
  2692. 2:03:01other packages too which it depends on
  2693. 2:03:04so we won't bother to do that and that's
  2694. 2:03:07briefly what you can do on a auntu
  2695. 2:03:09system with a graphical software package
  2696. 2:03:13installations and
  2697. 2:03:19removals you have completed Che chapter
  2698. 2:03:225 so let's summarize the key Concepts
  2699. 2:03:25covered you can control basic
  2700. 2:03:28configuration options and desktop
  2701. 2:03:30settings through the system settings
  2702. 2:03:33panel Linux always uses coordinated
  2703. 2:03:36universal time or UTC for its own
  2704. 2:03:38internal timekeeping you can set the
  2705. 2:03:41date and time settings from the system
  2706. 2:03:43settings window the network time
  2707. 2:03:46protocol is the most popular and
  2708. 2:03:47reliable protocol for setting the local
  2709. 2:03:50time via internet server
  2710. 2:03:52the displays panel allows you to change
  2711. 2:03:54the resolution of your display and
  2712. 2:03:57configure multiple
  2713. 2:03:59screens the network manager can present
  2714. 2:04:01available wireless networks it allows
  2715. 2:04:04the choice of a wireless or mobile BRB
  2716. 2:04:06Brad Network handles passwords and sets
  2717. 2:04:10up vpns the dpkg and RPM are the most
  2718. 2:04:14popular package Management Systems used
  2719. 2:04:16on Linux distributions deviant
  2720. 2:04:19distributions use dpkg and AP based
  2721. 2:04:22utilities for package management RPM was
  2722. 2:04:25developed by red hat and adopted by a
  2723. 2:04:28number of other distributions including
  2724. 2:04:31open Susi SOS oracal Linux and
  2725. 2:04:36others by the end of this chapter you
  2726. 2:04:39should be familiar with common Linux
  2727. 2:04:42applications including internet
  2728. 2:04:44applications such as browsers and email
  2729. 2:04:47programs office productivity Suites such
  2730. 2:04:51as Le RA office developer tools such as
  2731. 2:04:54compilers debug debuggers Etc multimedia
  2732. 2:04:58applications such as those for audio and
  2733. 2:05:01video graphic editors such as the
  2734. 2:05:04and other Graphics
  2735. 2:05:09utilities the internet is a Global
  2736. 2:05:11Network that allows users around the
  2737. 2:05:12world to perform multiple tasks such as
  2738. 2:05:15searching for data communicating through
  2739. 2:05:17emails and online shopping obviously you
  2740. 2:05:20need to use Network aware applications
  2741. 2:05:22to take advantage of the internet these
  2742. 2:05:25include web browsers email clients
  2743. 2:05:28streaming media applications Internet
  2744. 2:05:31relay chats and conferencing
  2745. 2:05:36software as discussed in the graphical
  2746. 2:05:39interface chapter Linux offers a wide
  2747. 2:05:41variety of web browsers both graphical
  2748. 2:05:44and text space including Firefox Google
  2749. 2:05:48Chrome chromium epiphany renamed web
  2750. 2:05:53conquer links links w3m and
  2751. 2:06:00Opera email applications allow for
  2752. 2:06:03sending receiving and reading messages
  2753. 2:06:05over the Internet Linux systems offer a
  2754. 2:06:08wide number of email clients both
  2755. 2:06:10graphical and text based in addition
  2756. 2:06:13many users simply use their browsers to
  2757. 2:06:15access their email accounts most email
  2758. 2:06:18clients use the internet message access
  2759. 2:06:21protocol or IMAP or the older pop post
  2760. 2:06:24office protocol to access emails stored
  2761. 2:06:26on a remote mail server most email
  2762. 2:06:29applications always also display HTML
  2763. 2:06:31formatted emails that include objects
  2764. 2:06:34like pictures and hyperlinks Linux
  2765. 2:06:36support the following types of email
  2766. 2:06:39applications graphical email clients
  2767. 2:06:41such as Thunderbird Evolution and Claus
  2768. 2:06:45mail text mode email clients such as mut
  2769. 2:06:48and mail all web browser based client
  2770. 2:06:51cents such as Gmail yah and Office
  2771. 2:06:58365 Linux systems provide many other
  2772. 2:07:01applications for performing internet
  2773. 2:07:03related tasks these include filezilla
  2774. 2:07:06pigeon AA and
  2775. 2:07:11hexchat most day-to-day computer systems
  2776. 2:07:14have productivity applications sometimes
  2777. 2:07:17called office suites available or
  2778. 2:07:19installed each Suite is a a collection
  2779. 2:07:22of closely coupled programs used to
  2780. 2:07:24create and edit different types of files
  2781. 2:07:26such as text spreadsheets presentations
  2782. 2:07:31graphical
  2783. 2:07:32objects most Linux distributions offer
  2784. 2:07:35Libra office an open- source office
  2785. 2:07:37suite that started in 2010 and is
  2786. 2:07:40evolved from open Office while other
  2787. 2:07:42office suites are available as as we
  2788. 2:07:45have listed Libra office is the most
  2789. 2:07:47mature and it's most it's also the most
  2790. 2:07:49widely used and intensely developed
  2791. 2:07:52in addition Linux users have full access
  2792. 2:07:54to internet-based office suites such as
  2793. 2:07:56Google Docs and Microsoft Office
  2794. 2:08:01365 the component applications included
  2795. 2:08:04in Libra office are writer for word
  2796. 2:08:08processing calc for spreadsheets impress
  2797. 2:08:11for presentations draw for creating and
  2798. 2:08:14editing graphics and diagrams the Libra
  2799. 2:08:16office applications can read and write
  2800. 2:08:19non-native document formats such as
  2801. 2:08:22those used by Microsoft Office usually
  2802. 2:08:24Fidelity is maintained quite well but
  2803. 2:08:26complicated documents might have some
  2804. 2:08:28imperfect
  2805. 2:08:33conversions Linux distributions come
  2806. 2:08:35with a complete set of applications and
  2807. 2:08:38tools that are needed by those
  2808. 2:08:40developing or maintaining both user
  2809. 2:08:42applications and the kernel itself these
  2810. 2:08:46tools are tightly integrated and include
  2811. 2:08:49Advanced editors customized for
  2812. 2:08:51programmers needs such as V and emac
  2813. 2:08:54compilers for every computer language
  2814. 2:08:56that has ever existed including very
  2815. 2:08:58popular new ones such as go L and rust
  2816. 2:09:01debuggers such as GDB and various
  2817. 2:09:04graphical front ends to it and other and
  2818. 2:09:06many other debugging tools performance
  2819. 2:09:09measuring and monitoring programs some
  2820. 2:09:11with easy to ous graphical interfaces
  2821. 2:09:14others more Arcane and meant to be used
  2822. 2:09:16only by serious experienced development
  2823. 2:09:19Engineers complete integrated develop
  2824. 2:09:21environments or idees such as eclipse
  2825. 2:09:25and visual studio code that put all
  2826. 2:09:27these tools together on other operating
  2827. 2:09:30systems these tools have to be obtained
  2828. 2:09:32and installed separately often at a high
  2829. 2:09:34cost while in Linux they are all
  2830. 2:09:37available at no cost through standard
  2831. 2:09:39package installation
  2832. 2:09:43systems multimedia applications are used
  2833. 2:09:46to listen to music watch videos Etc as
  2834. 2:09:49well as to present and view text and
  2835. 2:09:51Graphics Linux systems offer a number of
  2836. 2:09:55sound player applications including amck
  2837. 2:09:58audacity and Rhythm box of course Linux
  2838. 2:10:01systems can also connect with commercial
  2839. 2:10:03online music streaming services such as
  2840. 2:10:06Pandora and Spotify through web
  2841. 2:10:12browsers movie and video players can
  2842. 2:10:14portray input from many different
  2843. 2:10:16sources either local to the machine or
  2844. 2:10:18on the Internet Linux systems offer a
  2845. 2:10:21number of movie players including VLC
  2846. 2:10:24imp player Zen
  2847. 2:10:30Totem Movie editors are used to edit
  2848. 2:10:33videos or movies link systems offer a
  2849. 2:10:36number of movie editors including cin
  2850. 2:10:39paint blender CA and
  2851. 2:10:45ffmpeg graphic editors allow you to
  2852. 2:10:48create edit View and organize images of
  2853. 2:10:51various formats the new image
  2854. 2:10:53manipulation program or is a
  2855. 2:10:56feature image retouching and editing
  2856. 2:10:58tool similar to Adobe Photoshop and it's
  2857. 2:11:00available on all Linux distributions
  2858. 2:11:03some features of of are it can
  2859. 2:11:06handle any image format it has many
  2860. 2:11:08special purpose plugins and filters it
  2861. 2:11:11provides extensive information about the
  2862. 2:11:13image such as layers channels and
  2863. 2:11:16histograms in addition to there are
  2864. 2:11:19other Graphics utilities that help
  2865. 2:11:21perform various imag related tasks
  2866. 2:11:25including EOG inkscape convert and
  2867. 2:11:32scribus you have completed chapter six
  2868. 2:11:35let's summarize the key Concepts covered
  2869. 2:11:38Linux offers a wide variety of Internet
  2870. 2:11:41applications such as web browsers email
  2871. 2:11:43clients online media applications and
  2872. 2:11:46others web browsers supported by Linux
  2873. 2:11:49can be either graphic iCal or text based
  2874. 2:11:53such as Firefox Google Chrome Epiphany
  2875. 2:11:55w3m links and other others Linux
  2876. 2:11:58supports graphical email clients such as
  2877. 2:12:02Thunderbird Evolution and Claus mail and
  2878. 2:12:05text mode email clients such as mut and
  2879. 2:12:08mail Linux systems provide many other
  2880. 2:12:10applications for performing internet
  2881. 2:12:12related tasks such as filezilla xchat
  2882. 2:12:16pidgen and others most link
  2883. 2:12:18distributions offer Libra office to
  2884. 2:12:20create an different kinds of documents
  2885. 2:12:23Linux systems offer entire Suites of
  2886. 2:12:26development applications and tools
  2887. 2:12:28including compilers and debuggers Linux
  2888. 2:12:31systems offer a number of sound players
  2889. 2:12:33including amarok audacity and Rhythm box
  2890. 2:12:37Linux systems offer a number of movie
  2891. 2:12:39players including VC M player Zen and
  2892. 2:12:42totem Linux systems offer a number of
  2893. 2:12:44movie editors including Kino cin paint
  2894. 2:12:47blender among
  2895. 2:12:48others the utility is a featur rich
  2896. 2:12:53imagery touching and editing tool
  2897. 2:12:55available on all Linux
  2898. 2:12:56distributions other Graphics utilities
  2899. 2:12:59that help perform various image related
  2900. 2:13:01tasks are EOG inkscape convert and
  2901. 2:13:08scribus by the end of this chapter you
  2902. 2:13:10should be able to use the command line
  2903. 2:13:13to perform operations in Linux search
  2904. 2:13:16for files create and manage files
  2905. 2:13:20install and update
  2906. 2:13:26software Linux system administrators
  2907. 2:13:28spend a significant amount of their time
  2908. 2:13:31at a command line prompt they often
  2909. 2:13:33automate and troubleshoot tasks in this
  2910. 2:13:35text environment there's a saying
  2911. 2:13:38graphical user interfaces make easy
  2912. 2:13:40tasks easier while command line
  2913. 2:13:42interfaces make difficult tasks possible
  2914. 2:13:46Linux relies heavily on the abundance of
  2915. 2:13:48command line tools the command line
  2916. 2:13:50interface provides the following
  2917. 2:13:52advantages no gooey overhead is incurred
  2918. 2:13:55virtually any and every task can be
  2919. 2:13:57accomplished while sitting at the
  2920. 2:13:58command line you can Implement scripts
  2921. 2:14:01for often used or easy to forget tasks
  2922. 2:14:05and series of procedures you can sign
  2923. 2:14:08into remote machines anywhere on the
  2924. 2:14:10internet you can initiate graphical
  2925. 2:14:13applications directly from the command
  2926. 2:14:15line instead of hunting through menus
  2927. 2:14:18while graphical tools may vary among
  2928. 2:14:20Linux distributions the command line
  2929. 2:14:22interface does
  2930. 2:14:28not a terminal emulator program emulates
  2931. 2:14:31or simulates a standalone terminal
  2932. 2:14:33within a window on the desktop by this
  2933. 2:14:35we mean it behaves essentially as if you
  2934. 2:14:37were logging into the machine at a pure
  2935. 2:14:40text terminal terminal with no running
  2936. 2:14:42graphical interface most terminal
  2937. 2:14:45emulators programs support multiple
  2938. 2:14:47terminal sessions by opening additional
  2939. 2:14:49tabs or Windows by default on gnome
  2940. 2:14:52desktop environments The Gnome terminal
  2941. 2:14:55application is used to emulate a text
  2942. 2:14:58mode terminal in window other available
  2943. 2:15:01terminal programs include xterm console
  2944. 2:15:05default on KDE and
  2945. 2:15:12Terminator to open a terminal on any
  2946. 2:15:15system using a recent gnome desktop
  2947. 2:15:17click on applications system tools
  2948. 2:15:20terminals or applications utilities
  2949. 2:15:24terminal if you do not have the
  2950. 2:15:26applications menu you will have to
  2951. 2:15:28install the appropriate gnome shell
  2952. 2:15:30extension package and turn it on with
  2953. 2:15:33gnome
  2954. 2:15:34tweaks on any but some of the most
  2955. 2:15:37recent gnome based distributions you can
  2956. 2:15:40always open a terminal by right clicking
  2957. 2:15:42anywhere on the desktop background and
  2958. 2:15:45selecting open in
  2959. 2:15:47terminal if this does not work you will
  2960. 2:15:50once again need to install and activate
  2961. 2:15:52the appropriate gnome shell package you
  2962. 2:15:55can also hit alt F2 and type in either
  2963. 2:15:58gnome terminal or console whichever is
  2964. 2:16:03appropriate because distributions have
  2965. 2:16:05had a history of bearing opening up a
  2966. 2:16:09command line terminal and the place and
  2967. 2:16:11menus may vary in the desktop guey it is
  2968. 2:16:14a good idea to figure out how to pin the
  2969. 2:16:16terminal icon to the panel which might
  2970. 2:16:19mean adding it to the favorite grouping
  2971. 2:16:21on gnome
  2972. 2:16:26systems there are some basic command
  2973. 2:16:29line utilities that are used constantly
  2974. 2:16:32and it would be impossible to proceed
  2975. 2:16:34further without using some some of them
  2976. 2:16:37in simple forms before we discuss them
  2977. 2:16:39in more detail a short list has to
  2978. 2:16:42include cat used to type out a file or
  2979. 2:16:45combined files head used to show the
  2980. 2:16:49first few lines of a file tail used to
  2981. 2:16:52show the last few lines of a file man
  2982. 2:16:56used to view
  2983. 2:16:58documentation this screenshot shows
  2984. 2:17:00Elementary uses of these programs note
  2985. 2:17:03the use of the pipe symbol the vertical
  2986. 2:17:05line you used to have one program take
  2987. 2:17:08as input the output of another for the
  2988. 2:17:11most part we will only only use these
  2989. 2:17:13utilities and screenshots displaying
  2990. 2:17:15various activities before we discuss
  2991. 2:17:17them in detail
  2992. 2:17:23most input lines entered at the Shell
  2993. 2:17:25prompt have three basic
  2994. 2:17:27elements the command the options and the
  2995. 2:17:32arguments the command is the name of the
  2996. 2:17:35program you are executing it may be
  2997. 2:17:37followed by one or more options or
  2998. 2:17:39switches that modify what the command
  2999. 2:17:42may do options usually start with one or
  3000. 2:17:45two dashes for example- p or-- print in
  3001. 2:17:49order to differentiate them from
  3002. 2:17:51arguments which represent what the
  3003. 2:17:53command operates on however plenty of
  3004. 2:17:56commands have no options no arguments or
  3005. 2:17:59neither in addition other elements such
  3006. 2:18:02as setting environment variables can
  3007. 2:18:04also appear on the command line when
  3008. 2:18:07launching a
  3009. 2:18:12task all the demonstrations created have
  3010. 2:18:15a user configured with pseudo
  3011. 2:18:18capabilities to provide the user with
  3012. 2:18:20administ rative privileges when required
  3013. 2:18:23pseudo allows users to run programs
  3014. 2:18:25using the security privileges of another
  3015. 2:18:28user generally root the super user on
  3016. 2:18:31your own systems you may need to set up
  3017. 2:18:33an enable Pudo to work correctly to do
  3018. 2:18:36this you need to follow some steps that
  3019. 2:18:38will not explain much detail now but you
  3020. 2:18:41will learn about later in this course
  3021. 2:18:44when running on yuntu and some other
  3022. 2:18:46recent distributions pseudo is already
  3023. 2:18:49always set up for you during
  3024. 2:18:52installation on other Linux
  3025. 2:18:53distributions you will likely need to
  3026. 2:18:55set up pseudo to work properly for you
  3027. 2:18:58after the initial
  3028. 2:19:00installation next you will learn the
  3029. 2:19:02steps through setup and run pseudo on
  3030. 2:19:05your
  3031. 2:19:10system if your system does not already
  3032. 2:19:13have pseudo set up in and enabled you
  3033. 2:19:16need to do the following steps you'll
  3034. 2:19:19need to make modific ations to the
  3035. 2:19:21administrative or super user route while
  3036. 2:19:25pseudo will become the preferred method
  3037. 2:19:26of doing this we not have to have it set
  3038. 2:19:29up yet so we you we will use Su which
  3039. 2:19:32we'll discuss later in detail Instead at
  3040. 2:19:35the command line prompt type Su and
  3041. 2:19:37press enter you'll then be prompted for
  3042. 2:19:39the root password so enter it and press
  3043. 2:19:42enter you'll notice that nothing is
  3044. 2:19:44printed this is so so others cannot see
  3045. 2:19:47the password on the screen you should
  3046. 2:19:49end up with a different look prompt
  3047. 2:19:51often ending with a hashmark or a pound
  3048. 2:19:55sign for example Su and then password uh
  3049. 2:19:58now you need to create a configuration
  3050. 2:20:00file to enable your user account to use
  3051. 2:20:02Pudo typically this file is created in
  3052. 2:20:04the
  3053. 2:20:04/c/ Su doers. d/d directory with the
  3054. 2:20:09name of the file as the same as your
  3055. 2:20:11username for example for this demo let's
  3056. 2:20:13say your username is student after doing
  3057. 2:20:16step one you would then create the
  3058. 2:20:18configuration file for student by doing
  3059. 2:20:22this Echo student all equals all all and
  3060. 2:20:27then the the directory here finally some
  3061. 2:20:30Linux distributions will complain if you
  3062. 2:20:33do not also change permissions on the
  3063. 2:20:34file by doing uh chod 440 and then put
  3064. 2:20:38the file name uh that should be it for
  3065. 2:20:41the rest of this course if you use
  3066. 2:20:42pseudo you should be properly set up
  3067. 2:20:46when using pseudo by default you will be
  3068. 2:20:48prompted to give a password you your own
  3069. 2:20:51user password at least the the first
  3070. 2:20:53time you do it within a specified time
  3071. 2:20:56interval it's possible the varant secur
  3072. 2:20:58to configure pseudo to not require
  3073. 2:21:00password or change the time window in
  3074. 2:21:02which the password does not have to be
  3075. 2:21:04repeated with every pseudo
  3076. 2:21:12command the customizable nature of Linux
  3077. 2:21:15allows you to drop the graphical
  3078. 2:21:17interface temporarily or permanently or
  3079. 2:21:20to start up after the system has been
  3080. 2:21:22running most Linux distributions give an
  3081. 2:21:25option during installation or have more
  3082. 2:21:28than one version of the install media to
  3083. 2:21:30choose between desktop with a graphical
  3084. 2:21:32desktop and server usually without one
  3085. 2:21:36Linux production servers are usually
  3086. 2:21:38installed without the guei and even if
  3087. 2:21:40it is installed usually do not launch it
  3088. 2:21:43during the system startup removing the
  3089. 2:21:45graphical interface from a production
  3090. 2:21:47server can be very helpful in
  3091. 2:21:49maintaining a lean system which can be
  3092. 2:21:52easier to support and keep
  3093. 2:21:59secure VT or virtual terminals are
  3094. 2:22:02console sessions that use the entire
  3095. 2:22:03display and keyboard outside of a
  3096. 2:22:05graphical environment such terminals are
  3097. 2:22:07considered virtual because although
  3098. 2:22:10there can be multiple active terminals
  3099. 2:22:12only one terminal remains visible at a
  3100. 2:22:14time a VT is not quite the same as a
  3101. 2:22:17command line terminal window you can
  3102. 2:22:19have many of those visible at once on a
  3103. 2:22:21graphical desktop one virtual terminal
  3104. 2:22:25usually number one or seven is reserved
  3105. 2:22:28for the graphical environment and text
  3106. 2:22:30logins are enabled on the unused VTS
  3107. 2:22:33Ubuntu uses vt7 but s OAS and real and
  3108. 2:22:36openi use vt1 for the graphical display
  3109. 2:22:40an example of a situation where using
  3110. 2:22:41VTS is helpful is when you run into
  3111. 2:22:44problems with the graphical desktop in
  3112. 2:22:46this situation you can switch to one of
  3113. 2:22:48the text VTS and trouble shoot to switch
  3114. 2:22:52between VTS press control alt function
  3115. 2:22:55key for for the VT for example press
  3116. 2:22:58control alt F6 for vt6 actually you only
  3117. 2:23:02have to press the alt F6 key combination
  3118. 2:23:05if you are in a VT and want to switch to
  3119. 2:23:07another
  3120. 2:23:12VT Linux distributions can start and
  3121. 2:23:15stop the graphical desktop in various
  3122. 2:23:17ways the exact method differs from
  3123. 2:23:19distribution and among distribution
  3124. 2:23:21versions for the newer system MD based
  3125. 2:23:24distributions the display manager is run
  3126. 2:23:27as a service you can stop the guey
  3127. 2:23:29desktop with the system control utility
  3128. 2:23:32and most distributions will also work
  3129. 2:23:34with the uh T init command as in pseudo
  3130. 2:23:38system control stop gdm or studo telet 3
  3131. 2:23:43and restart it after logging into the
  3132. 2:23:46console with pseudo system control start
  3133. 2:23:50start gdm Oro pseudo Talent 5 on move to
  3134. 2:23:55versions before 18.04 LTS substitute
  3135. 2:23:58light DM for
  3136. 2:24:03gdm in this section we will discuss how
  3137. 2:24:06to accomplish basic operations from the
  3138. 2:24:08command line these include how to log in
  3139. 2:24:11and log out from the system restart or
  3140. 2:24:14shut down the system locate applications
  3141. 2:24:16access directories identify absolute and
  3142. 2:24:18relative paths and EXP for the file
  3143. 2:24:24system an available text terminal will
  3144. 2:24:27prompt for a user name with the string
  3145. 2:24:29login and password when typing your
  3146. 2:24:32password nothing is displayed on the
  3147. 2:24:34terminal not even a an asri to indicate
  3148. 2:24:37that you typed in something and this is
  3149. 2:24:39to prevent others from seeing your
  3150. 2:24:40password after you've logged into the
  3151. 2:24:42system you can perform basic
  3152. 2:24:45operations once your session is started
  3153. 2:24:47either by logging into a text terminal
  3154. 2:24:50or via a graphical terminal program you
  3155. 2:24:53can also connect and log into remote
  3156. 2:24:55systems by using SSH for example by
  3157. 2:24:59typing SSH student remotes server.com
  3158. 2:25:02SSH would control would connect securely
  3159. 2:25:05to the remote machine or remotes
  3160. 2:25:07server.com and give student that's the
  3161. 2:25:10user a command line terminal window
  3162. 2:25:12either using a password as with regular
  3163. 2:25:15logins or a cryptographic key to sign in
  3164. 2:25:17without providing a password to a
  3165. 2:25:19verified the
  3166. 2:25:25identity the preferred method to shut
  3167. 2:25:27down or reboot the system is to use the
  3168. 2:25:29shutdown command this sends a warning
  3169. 2:25:32message and then prevents further users
  3170. 2:25:34from logging in the init process will
  3171. 2:25:37then control shutting down or rebooting
  3172. 2:25:39the system it's important to always shut
  3173. 2:25:41down properly failure to do so can
  3174. 2:25:44result in damage to the system and or
  3175. 2:25:46loss of data the Halt and power off
  3176. 2:25:50commands issue shutdown DH to Hal the
  3177. 2:25:54system reboot issue shutd down- R and
  3178. 2:25:58causes the machine to reboot instead of
  3179. 2:26:00just shutting down both rebooting and
  3180. 2:26:03shutting down from the command line
  3181. 2:26:05requires super user or root access when
  3182. 2:26:09administering a multi-user system you
  3183. 2:26:12have the option of notifying all users
  3184. 2:26:13prior shutdown as in pseudo shutdown DH
  3185. 2:26:18uh 10:00 shutting down for scheduled
  3186. 2:26:25maintenance depending on the specifics
  3187. 2:26:27of your particular distributions policy
  3188. 2:26:30programs and software packages can be
  3189. 2:26:33installed in various directories in
  3190. 2:26:35general executable programs and scripts
  3191. 2:26:37should live in the SL bin or SL user bin
  3192. 2:26:41or/ sbin or/ user sbin directories or
  3193. 2:26:45somewhere under slop they can also
  3194. 2:26:47appear in the/ user looc /bin or/ user
  3195. 2:26:51locsin or in a directory in a user's
  3196. 2:26:53account space such as slome student /bin
  3197. 2:26:57one way to locate programs is to employ
  3198. 2:27:00the witch utility for example to find
  3199. 2:27:02out exactly where the diff program
  3200. 2:27:04resides on the file system you can do
  3201. 2:27:07which diff SL user bin diff if which
  3202. 2:27:13does not find the program where is is a
  3203. 2:27:15good alternative because it looks for
  3204. 2:27:17packages in a broader range of system
  3205. 2:27:20directories so where is
  3206. 2:27:26diff when you first log into a system or
  3207. 2:27:30open a terminal the default directory
  3208. 2:27:32should be your home directory you can PR
  3209. 2:27:35you can print the exact path of this by
  3210. 2:27:37typing Echo home many Linux
  3211. 2:27:40distributions actually open new
  3212. 2:27:41graphical terminals in the dollar China
  3213. 2:27:43home/ desktop the following commands are
  3214. 2:27:46useful for directory navigation
  3215. 2:27:56let's get some practice navigating among
  3216. 2:27:58directories at the command line so
  3217. 2:28:01suppose I go to the temp directory
  3218. 2:28:05cdmp I do PWD for print working
  3219. 2:28:08directory I'm at TMP I could do go to
  3220. 2:28:11the home directory by doing CD dollar
  3221. 2:28:14home you see PWD now is home student if
  3222. 2:28:18I do cd. dot I go up one level to just
  3223. 2:28:23home another way to navigate is to use
  3224. 2:28:26the push D and pop D commands so I could
  3225. 2:28:28do push
  3226. 2:28:30D
  3227. 2:28:32temp okay and it show me my previous
  3228. 2:28:35history I was at Temp and uh I was at
  3229. 2:28:37home and I go to Temp now if I do pop
  3230. 2:28:41D it puts me back at the home
  3231. 2:28:44directory another thing I can do is CD
  3232. 2:28:48Dash and that takes me to the previous
  3233. 2:28:51directory just like popd did so that's
  3234. 2:28:55some basic day-to-day practices of
  3235. 2:28:57navigating directories that one does all
  3236. 2:28:59the time on a Linux
  3237. 2:29:05system there are two ways to identify
  3238. 2:29:08paths absolute path name which an
  3239. 2:29:11absolute path name begins with the root
  3240. 2:29:13directory and follows the tree branch by
  3241. 2:29:16Branch until it reaches the desired
  3242. 2:29:18directory or file Absolut paths always
  3243. 2:29:20start with a slash or the relative PA
  3244. 2:29:24path name a relative path name starts
  3245. 2:29:26from the present working directory
  3246. 2:29:28relative paths never start with a slash
  3247. 2:29:30multiple slashes between directories and
  3248. 2:29:33files are allowed but all but one slash
  3249. 2:29:36between elements in the path name is
  3250. 2:29:38ignored by the system so if you have a
  3251. 2:29:40bunch of slashes it's valid but it's
  3252. 2:29:42just seen as just having a single slash
  3253. 2:29:44by the system most of the time it's most
  3254. 2:29:47convenient to use relative paths which
  3255. 2:29:50require less typing usually you take
  3256. 2:29:52advantage of the shortcuts provided by
  3257. 2:29:55use dot for present directory do dot for
  3258. 2:29:58Parent Directory or the tilty for your
  3259. 2:30:00home directory for example suppose
  3260. 2:30:02you're currently working in your home
  3261. 2:30:04directory and wish to move to the/ user
  3262. 2:30:07spin directory the following two ways
  3263. 2:30:09will bring you to the same directory
  3264. 2:30:11from your home directory there is the
  3265. 2:30:13absolute path name method and the
  3266. 2:30:15relative path name method in this case
  3267. 2:30:18the absolute path name method requires
  3268. 2:30:20less
  3269. 2:30:24typing traversing up and down the file
  3270. 2:30:27system tree can get tedious the tree
  3271. 2:30:29command is a good way to get a bird's
  3272. 2:30:31eye view of the file system tree use
  3273. 2:30:33tree- D just to view just the
  3274. 2:30:35directories and to suppress listing the
  3275. 2:30:38names the following commands can help in
  3276. 2:30:41exploring the file system
  3277. 2:31:00let's get started with how to explore
  3278. 2:31:02the file system to access SL
  3279. 2:31:06USR
  3280. 2:31:08looc from the/ USR directory using
  3281. 2:31:12absolute path at command prompt type cd/
  3282. 2:31:17USR SL looc
  3283. 2:31:20SL live and press enter go back to/ USR
  3284. 2:31:25directory by typing
  3285. 2:31:27cd/ USR and press enter to access SL USR
  3286. 2:31:34looc from the/ USR directory using
  3287. 2:31:38relative path at command prompt type CD
  3288. 2:31:42local
  3289. 2:31:43/li and press enter get to the root
  3290. 2:31:46directory at the command prompt type the
  3291. 2:31:48cd/ command
  3292. 2:31:51and press enter to get a list of the
  3293. 2:31:53files and directory in the present
  3294. 2:31:54working directory at the command prompt
  3295. 2:31:57type the ls command and press enter to
  3296. 2:32:00get a list of hidden files and hidden
  3297. 2:32:02directories at the command prompt type
  3298. 2:32:05the ls- a command and press enter to get
  3299. 2:32:09a tree view of the file system at the
  3300. 2:32:11command prompt type the tree command and
  3301. 2:32:14press enter to get a treeview of only
  3302. 2:32:17directories in the file system at the
  3303. 2:32:20command prompt type the
  3304. 2:32:22tree-
  3305. 2:32:24d/ command and press
  3306. 2:32:33enter the inutility is used to create
  3307. 2:32:36hard links and with the- s option soft
  3308. 2:32:39links also known as symbolic links or
  3309. 2:32:42Sim links these two kinds of links that
  3310. 2:32:44are very useful in Unix based operating
  3311. 2:32:47systems suppose that file one already
  3312. 2:32:49exists a hard link called file two is
  3313. 2:32:51created with the with this
  3314. 2:32:56command note that two files now appear
  3315. 2:32:59to exist however a closer inspection of
  3316. 2:33:02the file listing shows that this is not
  3317. 2:33:04quite true so we'll do ls- Li file one
  3318. 2:33:08name file two and the- I option to LS
  3319. 2:33:11prints out in the First Column the inode
  3320. 2:33:14number which is a unique quantity for
  3321. 2:33:17each file object this field is the same
  3322. 2:33:19for both these
  3323. 2:33:20so what is really going on here is that
  3324. 2:33:22there's only one file but has more than
  3325. 2:33:24one name associated with it as indicated
  3326. 2:33:26by the two that appears in the ls output
  3327. 2:33:30thus there was already another object
  3328. 2:33:32linked to file one before the command
  3329. 2:33:34was executed hard links are very useful
  3330. 2:33:37and they save space but you have to be
  3331. 2:33:39careful with their use sometimes in
  3332. 2:33:42subtle ways for one thing if you remove
  3333. 2:33:44either file one or file two in the
  3334. 2:33:46example the inode object and the
  3335. 2:33:48remaining file name will remain which
  3336. 2:33:51might be undesirable as it may lead to
  3337. 2:33:53subtle errors later if you recreate a
  3338. 2:33:55file of that name if you edit one of the
  3339. 2:33:58files exactly what happens depends on
  3340. 2:34:01your editor most editors including V and
  3341. 2:34:05gedit will retain the link by default
  3342. 2:34:08but it's possible that modifying one of
  3343. 2:34:10the names may break the link and result
  3344. 2:34:12in the creation of two
  3345. 2:34:18objects soft or symbolic links are
  3346. 2:34:20created with a-s option as in ln- s file
  3347. 2:34:251 file 3 or ls- Li file one file three
  3348. 2:34:29notice file three no longer appears to
  3349. 2:34:31be a regular file and it clearly points
  3350. 2:34:33to file one and has a different enode
  3351. 2:34:36number symbolic links take no extra
  3352. 2:34:38space on the file system unless their
  3353. 2:34:40names are very long they're extremely
  3354. 2:34:42convenient as they can easily be
  3355. 2:34:44modified to point to different places an
  3356. 2:34:47easy way to create a shortcut from your
  3357. 2:34:49home home directory to long path names
  3358. 2:34:52is to create a symbolic link unlike hard
  3359. 2:34:55links soft links can point to objects
  3360. 2:34:58even on different file systems
  3361. 2:35:00partitions and or Diss and other media
  3362. 2:35:03which may or may not be currently
  3363. 2:35:05available or even exist in the case
  3364. 2:35:07where the link does not point to a
  3365. 2:35:09currently available or existing object
  3366. 2:35:11you obtain a dangling
  3367. 2:35:17link the CD command remembers where you
  3368. 2:35:21were last and let you get back there
  3369. 2:35:23with CD dash for remembering more than
  3370. 2:35:26just the last directory visited use push
  3371. 2:35:29D to change the directory instead of CD
  3372. 2:35:32this pushes your starting directory onto
  3373. 2:35:34a list using popd will then send you
  3374. 2:35:37back to those directories walking in
  3375. 2:35:40reverse order the most recent directory
  3376. 2:35:42will be the first one retrieve with popd
  3377. 2:35:45the list of directories is displayed
  3378. 2:35:47with the dur command
  3379. 2:35:53Linux provides many commands that help
  3380. 2:35:55you with viewing the contents of a file
  3381. 2:35:57creating a new file or an empty file
  3382. 2:35:59changing the timestamp of a file and
  3383. 2:36:01moving removing and renaming a file or
  3384. 2:36:04directory these commands help you in
  3385. 2:36:06managing your data and files and and in
  3386. 2:36:09ensuring that the correct data is
  3387. 2:36:11available at the correct location in
  3388. 2:36:13this section you will learn how to
  3389. 2:36:15manage
  3390. 2:36:15files let's get a feel for how to look
  3391. 2:36:18at some of the lines in a given text
  3392. 2:36:21file on your machine so we have on all
  3393. 2:36:25our Linux Foundation virtual machines a
  3394. 2:36:27file called Ready for. sh which I'm
  3395. 2:36:31using word count to show me it has
  3396. 2:36:355,127 lines if I just want to type the
  3397. 2:36:39whole file out I could do that with the
  3398. 2:36:42cat utilities so let me just do
  3399. 2:36:45that but it went very very fast and in
  3400. 2:36:48fact if I do cat
  3401. 2:36:51dasn it shows me the line numbers as it
  3402. 2:36:54goes and it is indeed
  3403. 2:36:575127 the way to page your way through is
  3404. 2:37:01to use the less utility so then I would
  3405. 2:37:03do less
  3406. 2:37:06ready
  3407. 2:37:08forsh and then I get one screen at a
  3408. 2:37:11time if I hit the space bar I see the
  3409. 2:37:14second screen third screen Etc and I can
  3410. 2:37:18keep going all the way through the file
  3411. 2:37:20as fast as I want and by the way I can
  3412. 2:37:23also do the less- capital
  3413. 2:37:26in option and then I also get line
  3414. 2:37:28numbers I did with cat Dash in so
  3415. 2:37:33similar thing now suppose I just want to
  3416. 2:37:35look at the first few lines of the file
  3417. 2:37:38I could do head ready4
  3418. 2:37:43Dosh and you see that only gave me I
  3419. 2:37:45believe 10 lines if I wanted to get 20
  3420. 2:37:48lines I could just give that as an
  3421. 2:37:52argument okay so there we see the first
  3422. 2:37:5420 lines likewise with
  3423. 2:37:58tail by default I get the last 10 lines
  3424. 2:38:01if I wanted to see the last 20
  3425. 2:38:04lines I would do tail
  3426. 2:38:07-20 and if you want to have some fun you
  3427. 2:38:09can use the TAC
  3428. 2:38:12utility where you'll notice that Tac is
  3429. 2:38:16cat
  3430. 2:38:17backwards and that just gives do the
  3431. 2:38:19entire file
  3432. 2:38:21backwards so these are day-to-day
  3433. 2:38:24utilities one uses just to look at the
  3434. 2:38:26contents of text
  3435. 2:38:33files touch is often used to set or
  3436. 2:38:36update the access change and modify
  3437. 2:38:38times of files by default it resets a
  3438. 2:38:41file's timestamp to match the current
  3439. 2:38:43time however you can also create an
  3440. 2:38:46empty file using touch uh like this
  3441. 2:38:49touch and then the file name this is
  3442. 2:38:51normally done to create an empty file as
  3443. 2:38:52a placeholder for a later purpose touch
  3444. 2:38:56provides several useful options for
  3445. 2:38:58example the- T option allows you to set
  3446. 2:39:01the date and timestamp of the file to a
  3447. 2:39:03specific value as in touch DT and then
  3448. 2:39:07we put the value uh and then the file
  3449. 2:39:12name maker is used to create a deck
  3450. 2:39:15directory such as maker samper it
  3451. 2:39:19creates the sample directory named
  3452. 2:39:20samper under the current directory maker
  3453. 2:39:24user samper will create a sample
  3454. 2:39:26directory called samper under SL user
  3455. 2:39:31removing a directory is done with rmd or
  3456. 2:39:34remove directory the directory must be
  3457. 2:39:36empty or the command will fail to remove
  3458. 2:39:39a directory and all of its contents you
  3459. 2:39:41have to do rm-rf
  3460. 2:39:47note that MV B does double duty in that
  3461. 2:39:51it can simply rename a file or move a
  3462. 2:39:55file to another location while possibly
  3463. 2:39:57changing its name at the same
  3464. 2:40:00time if you're not certain about
  3465. 2:40:03removing files that match a pattern use
  3466. 2:40:05Supply it's always good to run RM in
  3467. 2:40:08interactively rm-- I to prompt before
  3468. 2:40:12every
  3469. 2:40:17removal rmd IR Works only on empty
  3470. 2:40:21directories otherwise you get an error
  3471. 2:40:23so while typing rm-- RF is a fast and
  3472. 2:40:26easy way to remove a whole file system
  3473. 2:40:27tree recursively it's extremely
  3474. 2:40:30dangerous and should be used with the
  3475. 2:40:31utmost care especially when used by root
  3476. 2:40:35recall that recursive means drilling
  3477. 2:40:37down through all subdirectories all the
  3478. 2:40:39way down a
  3479. 2:40:44tree the PS1 variable is the character
  3480. 2:40:47string that is displayed as the prompt
  3481. 2:40:49on the command line most distributions
  3482. 2:40:52set PS1 to a known default value which
  3483. 2:40:55is suitable in most cases however users
  3484. 2:40:58may want custom information shown on the
  3485. 2:41:00command line for example some system
  3486. 2:41:04administrators require the user and the
  3487. 2:41:06host system name to show up on the
  3488. 2:41:09command line as in this
  3489. 2:41:13example this could prove useful if
  3490. 2:41:16you're working in multiple roles and
  3491. 2:41:18want to be always reminded of who you
  3492. 2:41:20are and what machine you are on the
  3493. 2:41:22prompt above could be implemented by
  3494. 2:41:25setting the PS1 variable to the
  3495. 2:41:30following for example you could do that
  3496. 2:41:33with this command
  3497. 2:41:37here by convention most systems are set
  3498. 2:41:40up so that the root user has a pound
  3499. 2:41:43sign as their
  3500. 2:41:45prompt let's gain some experience with
  3501. 2:41:47day-to-day basic fire file operations on
  3502. 2:41:50a Centos stream system this would be the
  3503. 2:41:54same on any Linux system so first let's
  3504. 2:41:57create a couple of files uh they could
  3505. 2:41:59be empty or they could be small uh one
  3506. 2:42:02way to do it is to use the echo command
  3507. 2:42:04and just say Echo and direct actually
  3508. 2:42:08nothing into file one another way to do
  3509. 2:42:11it is with the touch command I'll say
  3510. 2:42:13Touch file two then if I do ls- a file
  3511. 2:42:18one and file
  3512. 2:42:192 I see two very small files that are
  3513. 2:42:23both created uh at the same time
  3514. 2:42:26basically uh if I want to rename one of
  3515. 2:42:28them I could rename it with the move
  3516. 2:42:30command like move file one to file
  3517. 2:42:36one new
  3518. 2:42:40name and then if I
  3519. 2:42:42do ls- L star file
  3520. 2:42:46star I see there it is uh it it it it
  3521. 2:42:50has the new name now if I want to remove
  3522. 2:42:53them I can simply say RM File
  3523. 2:42:572 and it just work it's a good idea
  3524. 2:43:00though to always use the eye option for
  3525. 2:43:02interactive when doing removal then I
  3526. 2:43:05would say
  3527. 2:43:06rm- I file one new name and it'll ask me
  3528. 2:43:10if I really want to do it uh many
  3529. 2:43:13distributions will set up the eye option
  3530. 2:43:15to be the default so that you always
  3531. 2:43:17have a chance uh to change your mind
  3532. 2:43:20about removing something before you do
  3533. 2:43:22it now how would I make a directory I
  3534. 2:43:25could do make
  3535. 2:43:26deer uh deer
  3536. 2:43:29one in fact I can make more than one
  3537. 2:43:31directory on the same line I can do make
  3538. 2:43:34deer deer 2 and deer
  3539. 2:43:373 and if I look now I see I have three
  3540. 2:43:40different directories they're all
  3541. 2:43:41actually empty so let me put a couple of
  3542. 2:43:44files in one of the directories so I'll
  3543. 2:43:46do touch deer 2 to file
  3544. 2:43:51one and I'll do touch deer to file
  3545. 2:43:55two so if I do ls- LR just to see
  3546. 2:43:59everything that's there in the directory
  3547. 2:44:02files uh so I'll see deer one is empty
  3548. 2:44:06deer 2 has these two files and deer
  3549. 2:44:09three uh is also empty now the command
  3550. 2:44:12for removing directories is RM deer so
  3551. 2:44:16let's say I just try to remove them all
  3552. 2:44:19with a RM deer deer
  3553. 2:44:23star uh you
  3554. 2:44:25notice it got rid of deer 1 and deer 2
  3555. 2:44:28but it couldn't remove deer deer 1 and
  3556. 2:44:30deer 3 I should say it couldn't get rid
  3557. 2:44:32of deer 2 because there's files in it to
  3558. 2:44:35do that instead of using RM deer I would
  3559. 2:44:37say
  3560. 2:44:38RM RF deer
  3561. 2:44:422 and then that goes and descends into
  3562. 2:44:45the directory and gets rid of all the
  3563. 2:44:46files be very careful with the rm-rf
  3564. 2:44:50uh command because if you give the bad
  3565. 2:44:53argument you could even wipe out your
  3566. 2:44:55whole system but that is the standard
  3567. 2:44:57way to get rid of a whole directory Tre
  3568. 2:45:00so that's just some of the very basic
  3569. 2:45:03commands for renaming files moving them
  3570. 2:45:06creating directories removing them
  3571. 2:45:14Etc when commands are executed by
  3572. 2:45:17default there are three standard file
  3573. 2:45:19streams or descriptors always open for
  3574. 2:45:22use standard
  3575. 2:45:24input standard output and standard error
  3576. 2:45:30usually standard in input is your
  3577. 2:45:32keyboard and standard output and
  3578. 2:45:34standard error are printed on your
  3579. 2:45:35terminal standard error is often
  3580. 2:45:38redirected to an error logging file
  3581. 2:45:41while standard in is supplied by
  3582. 2:45:42directing input to to come from a file
  3583. 2:45:44or from the output of a previous command
  3584. 2:45:46through a pipe standard out is also
  3585. 2:45:49often redirected into a file since
  3586. 2:45:51standard error is where error messages
  3587. 2:45:53are written usually nothing will go
  3588. 2:45:55there in Linux all open files are
  3589. 2:45:58represented internally by what are
  3590. 2:46:00called file descriptors simply put these
  3591. 2:46:03are represented by numbers starting at
  3592. 2:46:05zero standard in is file descriptor zero
  3593. 2:46:08standard out is file descriptor one
  3594. 2:46:10Standard air is file descriptor 2
  3595. 2:46:12typically if other files are opened in
  3596. 2:46:14addition to these three which are open
  3597. 2:46:16by default they will start at the file
  3598. 2:46:18descrip scriptor 3 and increase from
  3599. 2:46:20there in the next section and in the
  3600. 2:46:23chapters ahead you'll see examples which
  3601. 2:46:25alter where a where a running command
  3602. 2:46:28gets its input where it writes its
  3603. 2:46:30output or where it prints diagnostic or
  3604. 2:46:33error
  3605. 2:46:39messages through the command shell we
  3606. 2:46:41can redirect the three standard file
  3607. 2:46:43stream so that we can get input from
  3608. 2:46:45either a file or another command instead
  3609. 2:46:47of from our keyboard and we can write
  3610. 2:46:49output and errors to files or use them
  3611. 2:46:51to provide input for subsequent
  3612. 2:46:54commands for example if we have a
  3613. 2:46:57program called do something that reads
  3614. 2:46:59from standard in and writes to standard
  3615. 2:47:03out and standard error we can change its
  3616. 2:47:06input source by using the less than sign
  3617. 2:47:09followed by the name of the file to be
  3618. 2:47:11consumed for input data here's an
  3619. 2:47:16example if you want to send the output
  3620. 2:47:18to a file use the greater than sign as
  3621. 2:47:21in this
  3622. 2:47:23example because standard error is not
  3623. 2:47:25the same as standard out air messages
  3624. 2:47:28will still will still be seen on the
  3625. 2:47:30terminal windows in the above example if
  3626. 2:47:33you want to redirect standard error to a
  3627. 2:47:35separate file you use standard errors
  3628. 2:47:38file descriptor number two the greater
  3629. 2:47:41than sign followed by the name of the
  3630. 2:47:43file you want to hold everything the
  3631. 2:47:45running command writes to standard error
  3632. 2:47:48so here's how you would do that a
  3633. 2:47:51special shorthand notation can send
  3634. 2:47:53anything written to file descriptor 2
  3635. 2:47:55standard erir to the same place as file
  3636. 2:47:58descriptor one standard out you can do
  3637. 2:48:00it like
  3638. 2:48:02this bash perits an easier Syntax for
  3639. 2:48:05the above which is like
  3640. 2:48:13so the unix/linux philosophy is to have
  3641. 2:48:16many simple and short programs or
  3642. 2:48:19commands cooperate together to produce
  3643. 2:48:22quite complex results rather than have
  3644. 2:48:24one complex program with many possible
  3645. 2:48:27options and modes of operation in order
  3646. 2:48:30to accomplish this extensive use of
  3647. 2:48:32pipes is made you can pipe the output of
  3648. 2:48:35one Commander program into another as
  3649. 2:48:37its input in order to do this we use the
  3650. 2:48:40vertical bar pipe symbol between
  3651. 2:48:43commands as in this example
  3652. 2:48:47here this represents what we often call
  3653. 2:48:49a pipeline and allows Linux to combine
  3654. 2:48:52the actions of several commands into one
  3655. 2:48:54this is extraordinary efficient because
  3656. 2:48:57Command 2 and command 3 do not have to
  3657. 2:48:59wait for the previous pipeline commands
  3658. 2:49:02to complete before they can begin
  3659. 2:49:04hacking at the data in their input
  3660. 2:49:06streams on multiple CPU or core systems
  3661. 2:49:10the available computing power is much
  3662. 2:49:12better utilized and things get done
  3663. 2:49:14quicker furthermore there is no need to
  3664. 2:49:16save output in temporary files between
  3665. 2:49:19the stages in the pipeline which saves
  3666. 2:49:22disk space and reduces reading and
  3667. 2:49:23writing from disk which is often the
  3668. 2:49:26slowest bottleneck in getting something
  3669. 2:49:32done being able to quickly find the
  3670. 2:49:35files you are looking for will save you
  3671. 2:49:37time and enhance productivity you can
  3672. 2:49:39search for files in both your home
  3673. 2:49:41directory space or in any other
  3674. 2:49:43directory or system or or location on
  3675. 2:49:46the system the main tools for doing this
  3676. 2:49:48are the locate and find utilities we'll
  3677. 2:49:51also show how to use wild cards and Bash
  3678. 2:49:55in order to specify any file which
  3679. 2:49:57matches a given generalized
  3680. 2:50:02request the locate utility program
  3681. 2:50:05performs a search taking advantage of a
  3682. 2:50:07previously constructed database of files
  3683. 2:50:10and directories on your system matching
  3684. 2:50:13all entries that contain a specified
  3685. 2:50:15character string this can sometimes
  3686. 2:50:17result in a very long list to get a
  3687. 2:50:20shorter and possibly more relevant list
  3688. 2:50:23we can use the grep program as a filter
  3689. 2:50:26grep will print only the lines that
  3690. 2:50:28contain one or more specified string as
  3691. 2:50:31in this example which will list all the
  3692. 2:50:33files and directories with both zip and
  3693. 2:50:36Bin in their name we'll cover grap in
  3694. 2:50:39much more detail later notice the use of
  3695. 2:50:42the pipe or the vertical line to pipe
  3696. 2:50:44the two commands together locate
  3697. 2:50:47utilizes a database base created by a
  3698. 2:50:49related utility update DB most Linux
  3699. 2:50:53systems run this automatically once a
  3700. 2:50:56day however you can update it at any
  3701. 2:50:58time by just running update DB from the
  3702. 2:51:00command line as the root user let's get
  3703. 2:51:03some practice with locating and finding
  3704. 2:51:06files on an Ubuntu system so suppose I
  3705. 2:51:10want to find all files that have the
  3706. 2:51:12string lfs 300 in them so I could do
  3707. 2:51:15locate lfs 300
  3708. 2:51:19and it finds indeed just one file that's
  3709. 2:51:21in the home student directory on the
  3710. 2:51:24subd directory there and I could also
  3711. 2:51:28find it by doing find dot meaning the
  3712. 2:51:32current directory name lfs 300
  3713. 2:51:35star and then I'll see it finds it and
  3714. 2:51:39if I want to find out a little more I
  3715. 2:51:41can give the ls option which will show
  3716. 2:51:43me who owns it what group they're in the
  3717. 2:51:46length of the file the iode the date
  3718. 2:51:50Etc now if I create another
  3719. 2:51:53file just by doing Echo into lfs 300 so
  3720. 2:51:57it creates essentially an empty file the
  3721. 2:52:00find command will find the new file as
  3722. 2:52:03well as the old one but the locate
  3723. 2:52:07command will not because I need to
  3724. 2:52:10update the database that uh that the
  3725. 2:52:14locate command uses and I do that by
  3726. 2:52:16running as roots so I need SU do as you
  3727. 2:52:19do update
  3728. 2:52:22DB and that was pretty quick uh and then
  3729. 2:52:26I say locate it now it finds both files
  3730. 2:52:30okay and um just to get rid of the file
  3731. 2:52:33I didn't really need I'll remove it I
  3732. 2:52:36run update DB
  3733. 2:52:38again well I need it to be root so I
  3734. 2:52:41have to say s you do and then once again
  3735. 2:52:44locate fs300 won find this new file now
  3736. 2:52:48I can configure update DB and locate to
  3737. 2:52:51do a bunch of things so if I go to the
  3738. 2:52:53ETC directory you'll see there's a file
  3739. 2:52:57called update
  3740. 2:53:01db.
  3741. 2:53:04com and it controls where update DB does
  3742. 2:53:08not look where locate does not look so
  3743. 2:53:11for instance under prun task it says
  3744. 2:53:13don't look in these places like the temp
  3745. 2:53:15directory because they're temporary and
  3746. 2:53:17you don't want to keep TR of what's
  3747. 2:53:19there particularly and prun Fs these are
  3748. 2:53:22file systems really pseudo file systems
  3749. 2:53:25that are not real file systems that you
  3750. 2:53:28shouldn't look in because they're also
  3751. 2:53:30the uh contents change every time you
  3752. 2:53:32boot let's say uh so for instance you
  3753. 2:53:34don't look in the proc directory or the
  3754. 2:53:36CIS FS directory or the dev directory uh
  3755. 2:53:41well Dev FS directory because these
  3756. 2:53:43things disappear every time you
  3757. 2:53:45reboot uh and so that's pretty easy to
  3758. 2:53:48configure there's some other things you
  3759. 2:53:50can do which you can learn by looking at
  3760. 2:53:51the documentation on your
  3761. 2:53:57system you can search for a file name
  3762. 2:54:00containing specific characters using
  3763. 2:54:02wild cards to search for files using the
  3764. 2:54:06question mark Wild Card replace each
  3765. 2:54:08unknown character with question mark for
  3766. 2:54:11example if you know only the first two
  3767. 2:54:13letters are ba of a three-letter file
  3768. 2:54:16name without an extension you can type
  3769. 2:54:19this to search for files using the Wild
  3770. 2:54:22Card replace the unknown string with the
  3771. 2:54:25aster for example if you remember only
  3772. 2:54:28that the extension was out type LS as.
  3773. 2:54:34out let's get some experience using wild
  3774. 2:54:37cards on an auntu system so I've gone to
  3775. 2:54:40the VAR log directory and let me just do
  3776. 2:54:42an LS to see what's there so for
  3777. 2:54:46instance uh let me use the DU or dis
  3778. 2:54:49usage utility which tells me all the
  3779. 2:54:51bytes that are being used by a given
  3780. 2:54:54file or subdirectory I could do
  3781. 2:54:56something like
  3782. 2:55:00D.S H uh
  3783. 2:55:03AAR and you'll see these are all the
  3784. 2:55:06different things under a uh some are
  3785. 2:55:09directories like app the others are just
  3786. 2:55:11files if I only wanted to look at ones
  3787. 2:55:15which have log in the name I could do du
  3788. 2:55:18s s h a star log star and so only ones
  3789. 2:55:23that have log and their names if I only
  3790. 2:55:25wanted to look at the ones that start
  3791. 2:55:29from the letter P or later in the
  3792. 2:55:31alphabet I could do du.
  3793. 2:55:34sh a and then I could say uh square
  3794. 2:55:40brackets p through
  3795. 2:55:43Z Star you see it neglected the
  3796. 2:55:47alternative one
  3797. 2:55:49uh which would have done that if I just
  3798. 2:55:51want to look at uh ones which have a
  3799. 2:55:54certain character in them I could do
  3800. 2:55:56something like
  3801. 2:55:58duar
  3802. 2:55:59do uh one character do star so those are
  3803. 2:56:05all the ones that have a substring in
  3804. 2:56:08them with one character uh here it's
  3805. 2:56:10always a number but it wouldn't have to
  3806. 2:56:12be um surrounded by periods on both
  3807. 2:56:15sides now you have to be careful with
  3808. 2:56:17wild cards that the system doesn't quote
  3809. 2:56:20glob what you are doing the string that
  3810. 2:56:23you are putting in so to give you an
  3811. 2:56:24example uh you'll notice there's a bunch
  3812. 2:56:27of different files here that start with
  3813. 2:56:29the name VMware well they're all over in
  3814. 2:56:31the right column here so suppose I try
  3815. 2:56:34to do uh uh
  3816. 2:56:37appg install VMware star and I should
  3817. 2:56:40make that Su
  3818. 2:56:44do well it's actually looking for
  3819. 2:56:46packages with all these names like
  3820. 2:56:48VMware Network one VM VSC Route 2 that
  3821. 2:56:53log and there are of course no packages
  3822. 2:56:55with silly names like that but I could
  3823. 2:56:57do something like this now let me put
  3824. 2:57:00the VMware star in
  3825. 2:57:04quotes and you see it actually uh did
  3826. 2:57:06find things it found two packages VMware
  3827. 2:57:09NSX common VMware manager and it wants
  3828. 2:57:14to install them and it needs these other
  3829. 2:57:15Utilities in order for them to work
  3830. 2:57:18uh I'm not going to do this because I
  3831. 2:57:20don't need these guys so I'll just say
  3832. 2:57:22no so when you put something in quotes
  3833. 2:57:26it says don't look in the current
  3834. 2:57:28directory to like fill out the names to
  3835. 2:57:30expand what you're doing uh instead
  3836. 2:57:32looking in this case in the database of
  3837. 2:57:35packages um so you have to be careful
  3838. 2:57:38and you'll often see people use quotes
  3839. 2:57:40even when there's no need for them just
  3840. 2:57:42to be safe so that's a little bit of
  3841. 2:57:44demonstration of the use of wild cards
  3842. 2:57:51find is an extremely useful and often
  3843. 2:57:54used utility program in the daily life
  3844. 2:57:56of a Linux system administrator it
  3845. 2:57:59recurses down the file system tree from
  3846. 2:58:02any particular directory or set of
  3847. 2:58:04directories and locates files that match
  3848. 2:58:06specified conditions the default path
  3849. 2:58:09name is always the present working
  3850. 2:58:11directory for example administrators
  3851. 2:58:14sometimes scan for potentially large
  3852. 2:58:16core files which contain diagnostic
  3853. 2:58:19information after a program fails
  3854. 2:58:21they're more than several weeks old in
  3855. 2:58:23order to remove them it's also common to
  3856. 2:58:26remove files that are not essential or
  3857. 2:58:29that are outdated in the/ TMP directory
  3858. 2:58:34especially those that have not been
  3859. 2:58:35accessed recently many Linux
  3860. 2:58:38distributions use shell scripts that run
  3861. 2:58:40periodically through cron to perform
  3862. 2:58:43such house cleaning
  3863. 2:58:49when no arguments are given find list
  3864. 2:58:52all files in the current directory and
  3865. 2:58:54all of its subdirectories commonly used
  3866. 2:58:56options to shorten the list include -
  3867. 2:58:59name which only list files with a
  3868. 2:59:01certain pattern in their name - iame
  3869. 2:59:04also ignore the case of the file names
  3870. 2:59:06and dash type which will restrict the
  3871. 2:59:09results to files of a certain specifi
  3872. 2:59:11type such as D for directory L for
  3873. 2:59:15symbolic link or F for a regular file
  3874. 2:59:18here's how you can search for files and
  3875. 2:59:19directories named
  3876. 2:59:21GCC here's how to search only for
  3877. 2:59:23directories named GCC here's how to
  3878. 2:59:26search for only for regular files named
  3879. 2:59:33GCC another good use of find is being
  3880. 2:59:36able to run commands on the files that
  3881. 2:59:39match your search criteria the dash EXA
  3882. 2:59:42option is used for this purpose to find
  3883. 2:59:45and remove all files that end with s swp
  3884. 2:59:49you can use
  3885. 2:59:51this the squiggly brackets are a
  3886. 2:59:54placeholder that will be filled with all
  3887. 2:59:56the file names that result from the find
  3888. 2:59:58expression and the proceeding command
  3889. 3:00:01will be run on each one
  3890. 3:00:03individually please note that you have
  3891. 3:00:05to end the command with either a
  3892. 3:00:08semicolon including the single quote or
  3893. 3:00:11a SL semicolon both forms are fine one
  3894. 3:00:15can also use the- okay option which
  3895. 3:00:18behaves the same as- exact except that
  3896. 3:00:22fine will prompt you for permission
  3897. 3:00:24before executing the command this makes
  3898. 3:00:27it a good way to test your results
  3899. 3:00:30before blindly executing any potentially
  3900. 3:00:33dangerous
  3901. 3:00:38commands it is sometimes the case that
  3902. 3:00:40you wish to find files according to
  3903. 3:00:43attributes such as when they were
  3904. 3:00:46created last used or based on their size
  3905. 3:00:49it's easy to perform such searches to
  3906. 3:00:52find files based on time you can use
  3907. 3:00:55this here- C time is when the enode
  3908. 3:00:59metadata or the the file in ownership
  3909. 3:01:01that permissions last change it's often
  3910. 3:01:04but not necessarily when the file was
  3911. 3:01:06first created you can also search files
  3912. 3:01:08based on when they were accessed or last
  3913. 3:01:10read or based on when they were modified
  3914. 3:01:12or last written the number is the number
  3915. 3:01:15of days and can be expressed in either a
  3916. 3:01:18number n that means exactly that Value
  3917. 3:01:21Plus n which means greater than the
  3918. 3:01:23number or minus n which means less than
  3919. 3:01:26that number there are similar options
  3920. 3:01:28for times and minutes as in the- cmen D
  3921. 3:01:32aen and DM Min to find files based on
  3922. 3:01:37sizes you can do
  3923. 3:01:38this note that the size here is in 52
  3924. 3:01:42byte blocks by default you can also
  3925. 3:01:44specify bytes kilobytes megabytes
  3926. 3:01:47gigabytes Etc as with the time numbers
  3927. 3:01:50above file sizes can also be exact
  3928. 3:01:52numbers for details consult the man page
  3929. 3:01:54to finded for example to find files
  3930. 3:01:57greater than 10 megabytes in size and
  3931. 3:01:59running a command on those files you can
  3932. 3:02:02use this
  3933. 3:02:05command let's gain some experience using
  3934. 3:02:08a very powerful find utility on a
  3935. 3:02:11nobuntu system and I'll work in the VAR
  3936. 3:02:14log directory so suppose I wanted to see
  3937. 3:02:17every file here that's uh underneath our
  3938. 3:02:21log and let me do it as Su do because
  3939. 3:02:24otherwise it will give me error messages
  3940. 3:02:26about not having permissions to look at
  3941. 3:02:28some files so do s you do find Dot and I
  3942. 3:02:32get a very long list of every single
  3943. 3:02:35file and directory that's underneath
  3944. 3:02:37here if I wanted to restrict it just to
  3945. 3:02:39directories I would do type
  3946. 3:02:43D and you'll see this just shows me the
  3947. 3:02:46directories and subdirectories
  3948. 3:02:48okay cuz like some of them like live
  3949. 3:02:50vert have multiple directories if I add
  3950. 3:02:52to that another parameter
  3951. 3:02:56Max Def
  3952. 3:03:00One you see it suppressed the
  3953. 3:03:02subdirectories here I only see live ver
  3954. 3:03:04now so I only went down a depth of one
  3955. 3:03:07and actually I could do two three or
  3956. 3:03:09whatever is necessary though here it
  3957. 3:03:11doesn't go that deep anyway now you can
  3958. 3:03:13always add commands um to
  3959. 3:03:18any fine command so I could do fine DOT
  3960. 3:03:24type
  3961. 3:03:26f and then I can say exact grip DH uh
  3962. 3:03:32log and I put in that parentheses uh
  3963. 3:03:36pair there and then let's say
  3964. 3:03:39slash
  3965. 3:03:40um semicolon you can also do a single
  3966. 3:03:43Dash semicolon single
  3967. 3:03:45Dash and it search to every single file
  3968. 3:03:48that had the word log in it and printed
  3969. 3:03:50out all the different things that were
  3970. 3:03:53there or to keep it a little simpler I
  3971. 3:03:55could have done
  3972. 3:03:57exec just ls-
  3973. 3:04:02L and it would give me listings of all
  3974. 3:04:04these files okay now there actually is a
  3975. 3:04:08LS
  3976. 3:04:09option built into find so I didn't
  3977. 3:04:12really have to do that and it will just
  3978. 3:04:14show me that kind of information there's
  3979. 3:04:17other things things I can do like
  3980. 3:04:19find size
  3981. 3:04:22zero it's finding all the files I should
  3982. 3:04:26have done Su do but all the files that
  3983. 3:04:28have a size of zero and if I want to
  3984. 3:04:31verify that I'll add the ls option you
  3985. 3:04:34see these are all files of the name with
  3986. 3:04:37size zero uh you can also do things like
  3987. 3:04:40find uh let's say I want to find
  3988. 3:04:42everything that's newer than this file
  3989. 3:04:45BM here I could do something like Su do
  3990. 3:04:50find. uh
  3991. 3:04:54newer B
  3992. 3:04:56temp and it show me everything that's
  3993. 3:04:58been done since then there's a million
  3994. 3:05:01options to find you can be used on a lot
  3995. 3:05:03of complicated ways you can negate any
  3996. 3:05:07parameter you want to put in by saying
  3997. 3:05:09not uh you can combine uh different
  3998. 3:05:13search criteria and I recommend heavily
  3999. 3:05:16that you really read up on mind if
  4000. 3:05:18you're going to use it CU it's a little
  4001. 3:05:20hard to describe in a few seconds but
  4002. 3:05:22there's a million things you can do with
  4003. 3:05:28it the core parts of a Linux
  4004. 3:05:30distribution and most of its add-on
  4005. 3:05:32software are installed via the package
  4006. 3:05:35management system each package contains
  4007. 3:05:38the files and other instructions needed
  4008. 3:05:41to make one software component work well
  4009. 3:05:43and cooperate with the other components
  4010. 3:05:46that comprise the entire system system
  4011. 3:05:48packages can depend on each other for
  4012. 3:05:50example a package for a web-based
  4013. 3:05:53application written in PHP can depend on
  4014. 3:05:56the PHP package there are two broad
  4015. 3:05:59families of packages package managers
  4016. 3:06:02those based on Debian and those which
  4017. 3:06:04use RPM as their low-level package
  4018. 3:06:06manager the two systems are incompatible
  4019. 3:06:09but broadly speaking provide the same
  4020. 3:06:11features and satisfy the same needs
  4021. 3:06:14there are some other systems used by
  4022. 3:06:16more specialized Linux distributions in
  4023. 3:06:18this section you will learn how to
  4024. 3:06:20install remove or search for packages
  4025. 3:06:23from the command line using these two
  4026. 3:06:25package Management
  4027. 3:06:31Systems both package Management Systems
  4028. 3:06:33operate on two distinct levels a
  4029. 3:06:36low-level tool such as dpkg or RPM takes
  4030. 3:06:40care of the details of unpacking
  4031. 3:06:42individual packages running scripts
  4032. 3:06:45getting the software installed correctly
  4033. 3:06:47while a highle tool such as aptg dnf yum
  4034. 3:06:51or zipper works with groups of packages
  4035. 3:06:54downloads packages from the vendor and
  4036. 3:06:56figures out
  4037. 3:06:58dependencies most of the time users need
  4038. 3:07:01to work only with the highlevel tool
  4039. 3:07:03which will take care of calling the
  4040. 3:07:05low-level tool as needed dependency
  4041. 3:07:08resolution is a particularly important
  4042. 3:07:11feature of the highlevel tool as it
  4043. 3:07:13handles the details of finding and
  4044. 3:07:15installing each dependency for you
  4045. 3:07:18be careful however as installing a
  4046. 3:07:20single package could result in many
  4047. 3:07:22dozens or even hundreds of dependent
  4048. 3:07:24packages being
  4049. 3:07:30installed the advanced packaging tool
  4050. 3:07:32apt is the underlying package management
  4051. 3:07:35system that manages software on Deviant
  4052. 3:07:37based systems while it forms the back
  4053. 3:07:40end for graphical package managers such
  4054. 3:07:42as the yuntu software Center and
  4055. 3:07:44synaptic its native user interface is at
  4056. 3:07:47the command line with programs that
  4057. 3:07:50include apt or appg and apt cach dnf is
  4058. 3:07:55the op Source command line package
  4059. 3:07:57management utility for the RPM
  4060. 3:07:59compatible Linux systems that belongs to
  4061. 3:08:01the red hat family dnf has both command
  4062. 3:08:05line and graphical user interfaces
  4063. 3:08:08Fedora and real 8 replaced the older yum
  4064. 3:08:11utility with dnf thereby eliminating a
  4065. 3:08:13lot of historical baggage as well as
  4066. 3:08:15introducing many nice new cap abilities
  4067. 3:08:18dnf is pretty much backwards compatible
  4068. 3:08:21with yum for day-to-day commands zipper
  4069. 3:08:24is the package management system for the
  4070. 3:08:26Susi or open Susi family and it's also
  4071. 3:08:29based on RPM zipper also allows you to
  4072. 3:08:32manage repositories from the command
  4073. 3:08:35line zipper is fairly straightforward to
  4074. 3:08:37use and resembles dnf or yum quite
  4075. 3:08:41closely to learn the basic package
  4076. 3:08:43commands take a look at these basic
  4077. 3:08:46packaging commands
  4078. 3:09:05let's get some practice with the basic
  4079. 3:09:07low-level command for the Debian
  4080. 3:09:09packaging system
  4081. 3:09:12dpkg or D package so to get a list of
  4082. 3:09:16all the pack packages on the system I
  4083. 3:09:18can simply type
  4084. 3:09:21dpkg
  4085. 3:09:25d-list and I'll just pipe that into list
  4086. 3:09:28because it's a long
  4087. 3:09:29list okay actually if I don't use list
  4088. 3:09:33for some reason it's more
  4089. 3:09:35compact okay so there are a lot of
  4090. 3:09:37different packages on the
  4091. 3:09:39system now if I want to see some
  4092. 3:09:42information just about a particular
  4093. 3:09:44package I could just grap let's say bzip
  4094. 3:09:482 to see what's going on with bzip 2 and
  4095. 3:09:51that's the information about bzip 2 that
  4096. 3:09:53tells us the version number the
  4097. 3:09:56architecture which here is
  4098. 3:09:58amd64 and it's description as a
  4099. 3:10:00highquality block sorting file
  4100. 3:10:02compressor utility so it's a more
  4101. 3:10:05advanced program with better compression
  4102. 3:10:08than gzip or the oldfashioned zip
  4103. 3:10:11program if I want to see what's actually
  4104. 3:10:15contained in that package I can do DP
  4105. 3:10:19kg list files and then the name of it
  4106. 3:10:24and then I'll go slower by putting it
  4107. 3:10:26into
  4108. 3:10:27less and you'll see there's the
  4109. 3:10:29executables in the bin directory and
  4110. 3:10:32then what's under user is basically
  4111. 3:10:35documentation under user share doc user
  4112. 3:10:38sh man
  4113. 3:10:42Etc if I try to remove the package let's
  4114. 3:10:46see what happens
  4115. 3:10:48so do su do
  4116. 3:10:50dpkg I of course have to have root
  4117. 3:10:52privilege to remove the
  4118. 3:10:55package so I'm removing bzip 2 D package
  4119. 3:10:58remove bzip
  4120. 3:11:002 and it's telling me I cannot do this
  4121. 3:11:04because I need the develop in package
  4122. 3:11:07dpkg-dev that would be headers and stuff
  4123. 3:11:10for programs which use uh this in a
  4124. 3:11:14library version and firew raller with
  4125. 3:11:17which is a archive extraor that's common
  4126. 3:11:19on Linux systems so I would have to
  4127. 3:11:22remove all three of them we'll see later
  4128. 3:11:24when we use tools like appg it's easier
  4129. 3:11:26to deal with these
  4130. 3:11:31dependencies but now get some practice
  4131. 3:11:34using the low-level RPM command in order
  4132. 3:11:37to look at a package try to remove it
  4133. 3:11:40Etc so we're going to type RPM dqa for
  4134. 3:11:43query and look at all packages on the
  4135. 3:11:46system and then then we're going to grip
  4136. 3:11:48to look for the package bzip
  4137. 3:11:512 okay and you see there's actually two
  4138. 3:11:54RPM packages which have bzip 2 in there
  4139. 3:11:58names the actual bzip 2 program and then
  4140. 3:12:01bzip 2 lives which is libraries that
  4141. 3:12:04depend on bzip
  4142. 3:12:072
  4143. 3:12:08so let's take a look more at information
  4144. 3:12:12about bzip 2 if I do
  4145. 3:12:15RPM if I do RP m-q for query I for
  4146. 3:12:20information and then L for a list of
  4147. 3:12:22files and that's a lot so I'll pipe it
  4148. 3:12:24through
  4149. 3:12:26less oops I forgot to give the name of
  4150. 3:12:28the package so bzip
  4151. 3:12:332 you see the name is bzip 2 you see
  4152. 3:12:36it's version
  4153. 3:12:381.06 um we see it's Source RPM here we
  4154. 3:12:44see when it was released in November
  4155. 3:12:462015
  4156. 3:12:47at of sos.org
  4157. 3:12:50and then a description of what it does
  4158. 3:12:53it's a freely available patent-free
  4159. 3:12:55highquality data compressor Etc and then
  4160. 3:12:58a list of the files that are part of
  4161. 3:13:00bzip
  4162. 3:13:012 if I want to get a little bit more
  4163. 3:13:04detailed look at what's in there I could
  4164. 3:13:07do something a little fancier like
  4165. 3:13:10RPM that Q L be zip 2 we just list the
  4166. 3:13:16files and then uh I'll make that a shell
  4167. 3:13:19command and substitute for it and do an
  4168. 3:13:22ls- LF on that so this will give me a
  4169. 3:13:25detailed listing and then I'll pipe it
  4170. 3:13:27into
  4171. 3:13:29less and these are actual files that are
  4172. 3:13:32in the package in a little bit more
  4173. 3:13:33detail like their length and what type
  4174. 3:13:35of files you'll notice for instance B
  4175. 3:13:38unzip 2 and bzip 2 are really the same
  4176. 3:13:41file it's just a symbolic link and the
  4177. 3:13:45system knows what to do or I should say
  4178. 3:13:47the application knows what to do whether
  4179. 3:13:50to zip or unzip depending on how it's
  4180. 3:13:55called now let's see what happens if I
  4181. 3:13:58try to remove the
  4182. 3:14:00package so I I would should be a root to
  4183. 3:14:03do that so do an Su do and then I'll do
  4184. 3:14:06RPM d e for erase and then just to be
  4185. 3:14:10extra careful I'll use the dash dash
  4186. 3:14:12test which means it won't actually do
  4187. 3:14:14anything with this option it'll just see
  4188. 3:14:16if it could do it bzip 2 so I try to
  4189. 3:14:20remove it and it's telling me that I
  4190. 3:14:23can't do that because it's need by those
  4191. 3:14:25following three packages as well as the
  4192. 3:14:28file roller program uh which is an
  4193. 3:14:32archiving program present on basically
  4194. 3:14:35all Linux
  4195. 3:14:36distributions and then I can get a
  4196. 3:14:38little more information in a different
  4197. 3:14:40way with RPM
  4198. 3:14:42dq--
  4199. 3:14:44what provides BZ zip
  4200. 3:14:482 and you'll see it's the bzip 2
  4201. 3:14:53package and if I do what
  4202. 3:15:00requires I get the same information
  4203. 3:15:03about the three packages that would like
  4204. 3:15:06that need to have bzip 2 installed for
  4205. 3:15:09them to behave properly and not crash or
  4206. 3:15:13anything a little bit later we're going
  4207. 3:15:15to discuss yum and zipper and also dnf
  4208. 3:15:19which are higher level programs that can
  4209. 3:15:21handle dependencies in robust fashion
  4210. 3:15:23RPM is really designed for individual
  4211. 3:15:27packages which are listed on the command
  4212. 3:15:30line or groups of packages listed on the
  4213. 3:15:32command
  4214. 3:15:37line let's get some practice using dnf
  4215. 3:15:40from the command line on a recent Fedora
  4216. 3:15:42system so in order to do that first
  4217. 3:15:45we'll have to bring up the command line
  4218. 3:15:47so I'll do that with activities and I'll
  4219. 3:15:48click on the terminal icon at the bottom
  4220. 3:15:50and I got a nice command line terminal
  4221. 3:15:53and I'll make it a little bit bigger
  4222. 3:15:55because the the fonts bigger that is
  4223. 3:15:57because uh it's hard to see with the
  4224. 3:15:59smaller fonts and then first let's get a
  4225. 3:16:02list of all
  4226. 3:16:04packages that have the string bzip 2 in
  4227. 3:16:08their
  4228. 3:16:09name so I'll do that with dnf list and
  4229. 3:16:13the first packages that will come up
  4230. 3:16:15will be the ones that are already
  4231. 3:16:17installed so let me scroll up a little
  4232. 3:16:19because there's a really long list here
  4233. 3:16:21so there I have the actual program bc2 a
  4234. 3:16:25development package in case I want to
  4235. 3:16:28write code that uses bzip 2 in
  4236. 3:16:31internally and then uh bzip 2 lives
  4237. 3:16:34would be used by programs that have bzip
  4238. 3:16:362 in already built into them the two I'm
  4239. 3:16:40going to be interested in installing
  4240. 3:16:42here are the lb
  4241. 3:16:44zip2 packages
  4242. 3:16:47bzip 2 is a parallel version of bzip 2
  4243. 3:16:50that can separate the amount of work
  4244. 3:16:52into a number of pieces that can be done
  4245. 3:16:54simultaneously so for instance if you
  4246. 3:16:57had four processors or cores you could
  4247. 3:16:59split the work up into four pieces and
  4248. 3:17:02do them all at the same time and then
  4249. 3:17:03merge them at the end and in theory it
  4250. 3:17:06could run almost four times as quickly
  4251. 3:17:09so let's try to install the utilities
  4252. 3:17:12package I'll do su do dnf install
  4253. 3:17:17Live bzip
  4254. 3:17:222 yeah I guess it's lb zip2 bzip 2
  4255. 3:17:31utils and you'll see yes it's happy to
  4256. 3:17:34do that but it also needs the lb zip 2
  4257. 3:17:36package which it depends on so I say yes
  4258. 3:17:39I'll just type
  4259. 3:17:41Y and it will install the two
  4260. 3:17:44packages um I probably have a program
  4261. 3:17:47now called lb zip 2 but let's check if
  4262. 3:17:50that's the
  4263. 3:17:51case with
  4264. 3:17:57which and yes I do so I could go ahead
  4265. 3:18:00and use it now if I wanted if I don't
  4266. 3:18:03really want these install and I want to
  4267. 3:18:05clean up with them I could do um
  4268. 3:18:07something like Su do dnf remove lb zip 2
  4269. 3:18:16and you notice it's happy to remove it
  4270. 3:18:18but it's telling me that because lb zip
  4271. 3:18:212 utils depends on lb zip 2 if I remove
  4272. 3:18:25lb zip 2 I better remove them both
  4273. 3:18:28otherwise I'll have an unsatisfied
  4274. 3:18:29dependency so I'll just say
  4275. 3:18:32yes so that's just a really simple uh
  4276. 3:18:36example of using dnf in the command line
  4277. 3:18:39unfortunately recent redhead based
  4278. 3:18:41systems do not have a really good
  4279. 3:18:43graphical package management utility
  4280. 3:18:46pedora has something called dnf Dragon
  4281. 3:18:49but it can be rather slow to load and a
  4282. 3:18:52little bit buggy and there's nothing at
  4283. 3:18:54all for Red Hat 8 or Centos S8 so
  4284. 3:18:58experienced developers will just always
  4285. 3:19:00tend to do things from the command
  4286. 3:19:06line let's demonstrate some basic
  4287. 3:19:09package management functions on an open
  4288. 3:19:12Su system using the zipper utility so
  4289. 3:19:16first first let's look for all packages
  4290. 3:19:19with
  4291. 3:19:20zipper search that have the string new
  4292. 3:19:23clot in
  4293. 3:19:25them and we see a number of packages
  4294. 3:19:28let's concentrate on the documentation
  4295. 3:19:30package so suppose I try to install that
  4296. 3:19:33and for that I have to be a super user
  4297. 3:19:36for an installation so I do su do zipper
  4298. 3:19:40install new
  4299. 3:19:41plot
  4300. 3:19:44Dot and you notice it's telling me I not
  4301. 3:19:47only have to install new plot. do I
  4302. 3:19:50would have to install new plot which is
  4303. 3:19:52the actual program that new plot.
  4304. 3:19:56do-to uh documents so I'll say sure
  4305. 3:20:03yes and it's been done successfully if I
  4306. 3:20:06want to get some information about the
  4307. 3:20:09package I can do RPM
  4308. 3:20:11dqi new plot dto and for this once again
  4309. 3:20:15I do not have to be root
  4310. 3:20:18and it's telling me the name the version
  4311. 3:20:20the size all sorts of things and under
  4312. 3:20:23the purpose it's telling me it concludes
  4313. 3:20:25the man and the info Pages for this
  4314. 3:20:28rather useful plotting program now
  4315. 3:20:31suppose I want to remove this package I
  4316. 3:20:34can do
  4317. 3:20:35zipper remove G
  4318. 3:20:38new plot let's say I try to remove gplot
  4319. 3:20:41not not new plot. th
  4320. 3:20:46and it's telling me that if I remove new
  4321. 3:20:49plot I also have to remove new plot. do-
  4322. 3:20:53do because otherwise there would be
  4323. 3:20:54unmet dependency so say yes for
  4324. 3:20:57sure and now both of them are gone so
  4325. 3:21:00that's basic steps you would take to
  4326. 3:21:04look for package install it get some
  4327. 3:21:07information about it and remove it using
  4328. 3:21:15zipper so let's do some basic package
  4329. 3:21:19Management on an auntu system using
  4330. 3:21:21Debian packaging we're going to use the
  4331. 3:21:24high level utilities which understand
  4332. 3:21:27dependencies app cash and
  4333. 3:21:29appg so first let's look for all
  4334. 3:21:34packages that contain the
  4335. 3:21:38string W get 2 so we do that with app
  4336. 3:21:41cash search W
  4337. 3:21:44get2 and it comes up with WG 2 and W
  4338. 3:21:47get2 Dev this is uh an enhancement to
  4339. 3:21:51the standard W get utility which is used
  4340. 3:21:54for recursive downloading of the content
  4341. 3:21:57of a website or some other kinds of uh
  4342. 3:22:01resources so let's just try and install
  4343. 3:22:03so I do su
  4344. 3:22:05do get install W get2
  4345. 3:22:11ddev and it's telling me it also needs
  4346. 3:22:14to install W live W get 0 and W get 2 it
  4347. 3:22:19shouldn't be that
  4348. 3:22:21surprising that you need to install the
  4349. 3:22:24base packages on which the development
  4350. 3:22:26packag is built on and it will download
  4351. 3:22:30264 kilobytes of archives but once
  4352. 3:22:33everything's installed it will expand
  4353. 3:22:35out to 805 kilobytes so let's just say
  4354. 3:22:39yes I'll type
  4355. 3:22:41Y and it quickly goes ahead and does all
  4356. 3:22:44that now suppose I want
  4357. 3:22:47remove W get to Dev well more
  4358. 3:22:51interesting let's try to
  4359. 3:22:54remove W
  4360. 3:22:56get uh
  4361. 3:23:00itself so what does it doing oh I
  4362. 3:23:04shouldn't have removed W get I meant W
  4363. 3:23:06get two w get I do not want to remove so
  4364. 3:23:09I'll type it again with the
  4365. 3:23:11two and you see it wants to remove W
  4366. 3:23:14get to Dev as well because without W get
  4367. 3:23:19W get2 Dev isn't have much meaning okay
  4368. 3:23:22and we no longer need live W get
  4369. 3:23:25zero um it's sort of offened out but
  4370. 3:23:29we'll leave it there for now so I'll
  4371. 3:23:31just say
  4372. 3:23:34yes and I have removed things from my
  4373. 3:23:37system so that's the most basic
  4374. 3:23:40operations you would need to do on an
  4375. 3:23:43Ubuntu system using Debbie and packaging
  4376. 3:23:53you have completed chapter 7 let's
  4377. 3:23:54summarize the key Concepts we covered
  4378. 3:23:57virtual terminals or VT and Linux are
  4379. 3:24:00consoles or commandline terminals that
  4380. 3:24:03use the connected Monitor and keyboard
  4381. 3:24:06different Linux distributions start and
  4382. 3:24:09stop the graphical desktop in different
  4383. 3:24:11ways a terminal emulator program on the
  4384. 3:24:15graphical desktop works by emulating a
  4385. 3:24:17terminal within a window on the desktop
  4386. 3:24:20the Linux system allows you to either
  4387. 3:24:23log in via text terminal or remotely via
  4388. 3:24:26the console when typing your password
  4389. 3:24:29nothing is printed to the terminal not
  4390. 3:24:31even a generic symbol to indicate that
  4391. 3:24:34you typed the preferred method to shut
  4392. 3:24:37down or reboot the system is to use the
  4393. 3:24:40shutdown
  4394. 3:24:41command there are two types of path
  4395. 3:24:44names absolute and relative an absolute
  4396. 3:24:48path name begins with the root directory
  4397. 3:24:50and follows the tree branch by Branch
  4398. 3:24:52until it reaches the desired directory
  4399. 3:24:54or file a relative path name starts with
  4400. 3:24:57the present working directory using hard
  4401. 3:25:01and soft symbolic links is extremely
  4402. 3:25:03useful in Linux CD remembers where you
  4403. 3:25:07were last and lets you get back there
  4404. 3:25:09with CD Dash locate performs a database
  4405. 3:25:13search to find all file names that match
  4406. 3:25:16a given pattern find locates files
  4407. 3:25:19recursively from a given directory or
  4408. 3:25:21set of directories find is able to run
  4409. 3:25:24commands on the files that it lists when
  4410. 3:25:27used with the DX exec options touch is
  4411. 3:25:31used to set the access change and edit
  4412. 3:25:33time to files as well as to create empty
  4413. 3:25:36files the advanced package tool
  4414. 3:25:39packaging tool AP this package
  4415. 3:25:41management system is used to manage
  4416. 3:25:43installed software on dbm based such
  4417. 3:25:46systems you can use the dnf command line
  4418. 3:25:49package development utility for the RPM
  4419. 3:25:52based Red Hat Family Linux
  4420. 3:25:55distributions the zipper package
  4421. 3:25:57management system is based on RPM and
  4422. 3:26:00used for open
  4423. 3:26:05Susi by the end of this chapter you
  4424. 3:26:08should be able to use different sources
  4425. 3:26:11of documentation use the Man pages
  4426. 3:26:15access the new info system use the help
  4427. 3:26:19command and the d-el option use other
  4428. 3:26:22documentation
  4429. 3:26:27sources whether you are an inexperienced
  4430. 3:26:30user or a veteran you'll not always know
  4431. 3:26:32or remember the proper use of various
  4432. 3:26:35Linux programs and utilities what is the
  4433. 3:26:38command to type what options does it
  4434. 3:26:40take Etc you'll need to consult help
  4435. 3:26:42documentation regularly because Linux
  4436. 3:26:44based systems draw from from a large
  4437. 3:26:46variety of sources there are numerous
  4438. 3:26:49reservoirs of documentation and ways of
  4439. 3:26:51getting help Distributors consolidate
  4440. 3:26:53this material and present it in a
  4441. 3:26:55comprehensive and easy to use manner
  4442. 3:26:58important Linux documentation sources
  4443. 3:27:01include the Man pages short for manual
  4444. 3:27:04pages new info the help command and Das
  4445. 3:27:08Das help option other documentation
  4446. 3:27:11sources like the ginu handbook
  4447. 3:27:17The Man pages are the most often used
  4448. 3:27:19source of Linux documentation they
  4449. 3:27:22provide in-depth documentation about
  4450. 3:27:24many programs and utilities as well as
  4451. 3:27:26other topics including configuration
  4452. 3:27:28files and programming apis for system
  4453. 3:27:31calls library library routines and the
  4454. 3:27:34kernel they are present on all Linux
  4455. 3:27:36distributions and are always at your
  4456. 3:27:38fingertips the M Pages infrastructure
  4457. 3:27:40was first introduced in the early Unix
  4458. 3:27:43versions in the beginning of the 1970s
  4459. 3:27:46the name man is just an abbreviation for
  4460. 3:27:48manual typing man with a topic name as
  4461. 3:27:51an argument retrieves the information
  4462. 3:27:52stored in the Topic's Man pages the man
  4463. 3:27:55program searches formats and displays
  4464. 3:27:58the information contained in the man
  4465. 3:27:59page system because many topics have
  4466. 3:28:02copious amounts of relevant information
  4467. 3:28:04output is piped through a pager program
  4468. 3:28:08such as less to be viewed one page at a
  4469. 3:28:10time at the same time the information is
  4470. 3:28:13formatted for a good visual display a
  4471. 3:28:16given topic may have multiple Man pages
  4472. 3:28:19associated with it and there is a
  4473. 3:28:21default order determining which one is
  4474. 3:28:22displayed when no options or section
  4475. 3:28:25number is specified to list all pages on
  4476. 3:28:27the topic use the- f option to list all
  4477. 3:28:30pages that discuss a specific topic even
  4478. 3:28:33if the specified topic is not present in
  4479. 3:28:35the name use the d-k
  4480. 3:28:38option let's use the Manu ility to get
  4481. 3:28:40some information about sockets on our
  4482. 3:28:43system if I just type man socket
  4483. 3:28:47I get chapter
  4484. 3:28:49two of the Linux programmers
  4485. 3:28:52manual I get the page in there in
  4486. 3:28:54chapter two that has to do with sockets
  4487. 3:28:56and this is a pretty General page that
  4488. 3:28:59tells me a lot of information about
  4489. 3:29:01sockets and different protocols that
  4490. 3:29:03they can
  4491. 3:29:04use if I want to get a list of all the
  4492. 3:29:08pages that are called socket I do man-
  4493. 3:29:11focket you'll see there's actually five
  4494. 3:29:13of them in different chapters that by
  4495. 3:29:16the way is exactly the same as saying
  4496. 3:29:18what is
  4497. 3:29:19Socket so man DF and apropo are the same
  4498. 3:29:24if I want to see a particular page say
  4499. 3:29:26chapter 7 I can do man 7 socket and I'm
  4500. 3:29:30getting the man page in chapter
  4501. 3:29:347 which is rather detailed if I want to
  4502. 3:29:38see them all at once I can see man- a
  4503. 3:29:41socket for all I
  4504. 3:29:43guess and I can space my way through
  4505. 3:29:46through this one if I hit Q it's telling
  4506. 3:29:49me if I hit return I'll see the next one
  4507. 3:29:513p so let's do
  4508. 3:29:53that I'll hit Q again you see if I want
  4509. 3:29:56to get out rather than going through the
  4510. 3:29:58rest of them the next one would be seven
  4511. 3:30:00I can hit contrl Ctrl D would just skip
  4512. 3:30:03the next one if I want to see all Man
  4513. 3:30:07pages that have the word socket in their
  4514. 3:30:09Des basic
  4515. 3:30:11description I do that with man- K and
  4516. 3:30:15it's a rather list because sockets are
  4517. 3:30:17pretty basic and involve all sorts of
  4518. 3:30:20things on your system man- K is exactly
  4519. 3:30:23the same just type it appropo socket and
  4520. 3:30:27I get the exact same thing so that's
  4521. 3:30:30just some basic day-to-day functioning
  4522. 3:30:33of using man to get information you
  4523. 3:30:35should play around with different Man
  4524. 3:30:37pages and look at the real contents in
  4525. 3:30:40them and see how they differ from page
  4526. 3:30:41to page
  4527. 3:30:47the next source of Linux documentation
  4528. 3:30:49is the new info system this is the new
  4529. 3:30:52project standard documentation format
  4530. 3:30:54which it prefers as an alternative to
  4531. 3:30:57man the info system is basically free
  4532. 3:31:00form and supports linked subsections
  4533. 3:31:03functionally info resembles man in many
  4534. 3:31:05ways however topics are connected using
  4535. 3:31:07links even though its design predates
  4536. 3:31:10the worldwide web information can be
  4537. 3:31:12viewed through either a command line
  4538. 3:31:14interface a graphical help utility
  4539. 3:31:17printed or viewed online typing info
  4540. 3:31:20with no arguments in a terminal window
  4541. 3:31:22displays an index of available topics
  4542. 3:31:25you can browse through the topic list
  4543. 3:31:27using the regular movement Keys arrows
  4544. 3:31:29page up and page down you can view help
  4545. 3:31:32for a particular topic by typing info
  4546. 3:31:34topic name the system then searches for
  4547. 3:31:37the topic in all available info files
  4548. 3:31:40some useful keys are Q to quit a for
  4549. 3:31:42help and enter to select a menu item
  4550. 3:31:48the topic which you view in an info page
  4551. 3:31:50is called a node this table lists the
  4552. 3:31:52basic keystrokes for moving between
  4553. 3:31:54nodes nodes are essentially sections and
  4554. 3:31:57subsections in the documentation you can
  4555. 3:31:59move between nodes or view each node
  4556. 3:32:02sequentially each node may contain menus
  4557. 3:32:04and links subtopics or items items
  4558. 3:32:08function like browser links and are
  4559. 3:32:10identified by an aster at the beginning
  4560. 3:32:13of the item name named items side menu
  4561. 3:32:16are identified with double colons at the
  4562. 3:32:19end of the item name items can refer to
  4563. 3:32:21other nodes within the file or to other
  4564. 3:32:25files let's gain some experience using
  4565. 3:32:28the info command for
  4566. 3:32:30documentation so suppose I type info
  4567. 3:32:33make I will get information about the
  4568. 3:32:35make utility used by all
  4569. 3:32:39programmers and this takes me to the top
  4570. 3:32:42of the info page or the head node if I
  4571. 3:32:45want to look for a particular topic I
  4572. 3:32:47can hit slash and you'll see at the
  4573. 3:32:49bottom it's prompting me for search so
  4574. 3:32:51I'll say
  4575. 3:32:53example and it brought me down here to
  4576. 3:32:55rule
  4577. 3:32:57example if I just hit
  4578. 3:33:00return I get that page now at the top
  4579. 3:33:03you'll
  4580. 3:33:04notice it says the not is root example
  4581. 3:33:07the next one is Rule syntax so if I hit
  4582. 3:33:10an
  4583. 3:33:11N I get the rule syntax it says the next
  4584. 3:33:14one is prere quisite types if I hit n
  4585. 3:33:17again I get prerequisite
  4586. 3:33:19types if I hit P I will go back to the
  4587. 3:33:22previous one so I hit beat rule syntax
  4588. 3:33:25if I want to look again for example I
  4589. 3:33:28can just hit the slash again and it it's
  4590. 3:33:31prompting me for the same string so I'll
  4591. 3:33:34just hit return and I'm finding a later
  4592. 3:33:37example about wild card examples and if
  4593. 3:33:39I hit return I find out above that if I
  4594. 3:33:42want to go all the way up I can hit a u
  4595. 3:33:46it takes me to the top of section
  4596. 3:33:494.4 I hit you again I'm at chapter 4 I
  4597. 3:33:53hit youu again I'm at the very top of
  4598. 3:33:55everything if I want to get information
  4599. 3:33:58on the various key stroke bindings I can
  4600. 3:34:01hit an H for help and you'll see in the
  4601. 3:34:03bottom window where the focus is shifted
  4602. 3:34:06to it lists all the possible key strokes
  4603. 3:34:09and what they can
  4604. 3:34:11do so that's basically how I would use
  4605. 3:34:14info if I hit Q I am out of it and the
  4606. 3:34:18rest you can learn by navigating within
  4607. 3:34:21the info page of any topic that
  4608. 3:34:23interests
  4609. 3:34:28you another important source of Linux
  4610. 3:34:30documentation is the use of the --el
  4611. 3:34:33option most commands have an available
  4612. 3:34:35short description which can be viewed
  4613. 3:34:37using the --el or the DH option along
  4614. 3:34:40with the command or application for
  4615. 3:34:43example to learn more about the man
  4616. 3:34:45command you can type man- dhel the d-el
  4617. 3:34:49option is useful as a quick reference
  4618. 3:34:51and it displays information faster than
  4619. 3:34:53the man or info
  4620. 3:34:58pages when running within a bash command
  4621. 3:35:01shell some popular commands such as Echo
  4622. 3:35:04and CD actually run especially built-in
  4623. 3:35:07bash versions of the commands rather
  4624. 3:35:09than the usual binaries found on the
  4625. 3:35:11file system it's more efficient to do so
  4626. 3:35:13as execution is faster because as fewer
  4627. 3:35:16resources are used one should note that
  4628. 3:35:18there can be some usually small
  4629. 3:35:21differences in the two versions of the
  4630. 3:35:23command to view a synopsis of these
  4631. 3:35:26built-in commands you can simply type
  4632. 3:35:29help as shown in this screenshot for
  4633. 3:35:32these built-in commands help performs
  4634. 3:35:34the same basic function as the DH and
  4635. 3:35:37--el arguments perform for Standalone
  4636. 3:35:44programs in addition to the Man pages
  4637. 3:35:46the new info system and the help command
  4638. 3:35:49there are other sources of Linux
  4639. 3:35:51documentation some of some examples of
  4640. 3:35:54which include desktop help system
  4641. 3:35:56package documentation and online
  4642. 3:36:03resources you have completed chapter 8
  4643. 3:36:06let's summarize the key Concepts covered
  4644. 3:36:09the main sources of Linux documentation
  4645. 3:36:12are the Man pages new info and the help
  4646. 3:36:15option and commands and a rich variety
  4647. 3:36:17of online documentation sources the man
  4648. 3:36:21utility searches formats and displays
  4649. 3:36:24Man pages The Man pages provide in-depth
  4650. 3:36:27documentation about programs and other
  4651. 3:36:30topics about the system including
  4652. 3:36:32configuration files system calls Library
  4653. 3:36:36routines and the kernel the new info
  4654. 3:36:39system was created by the new project as
  4655. 3:36:42a as its standard documentation it's
  4656. 3:36:45robust and it's accessible via command
  4657. 3:36:47line web and graphical tools short
  4658. 3:36:51descriptions for commands are usually
  4659. 3:36:52displayed with the -8 or d-el argument
  4660. 3:36:56you can type help at the command line to
  4661. 3:36:58display a synopsis of built-in commands
  4662. 3:37:01there are many other help resources both
  4663. 3:37:03on your system and on the
  4664. 3:37:09Internet by the end of this chapter you
  4665. 3:37:11should be able to describe what a
  4666. 3:37:14process is and distinguish between types
  4667. 3:37:16of processes enumerate process
  4668. 3:37:19attributes manage processes using PS and
  4669. 3:37:23top understand the use of load averages
  4670. 3:37:26and other process metrics manipulate
  4671. 3:37:29processes by putting them in background
  4672. 3:37:32and restoring them to foreground use at
  4673. 3:37:35cron and sleep to schedule processes in
  4674. 3:37:38the future or pause
  4675. 3:37:42them a process is simply an instant of
  4676. 3:37:45one or more related tasks threads
  4677. 3:37:48executing on your computer it's not the
  4678. 3:37:50same as a program or a command a single
  4679. 3:37:53command may actually start several
  4680. 3:37:55processes
  4681. 3:37:56simultaneously some processes are
  4682. 3:37:59independent of each other and others are
  4683. 3:38:01related a failure of one process may or
  4684. 3:38:04may not affect the others running on the
  4685. 3:38:07on the system processes use many system
  4686. 3:38:09resources such as memory CPU cycles and
  4687. 3:38:13peripheral devices such as network cards
  4688. 3:38:16hard drives printers and displays the
  4689. 3:38:19operating system especially the kernel
  4690. 3:38:21is responsible for allocating a proper
  4691. 3:38:23share of these resources to each process
  4692. 3:38:26and ensuring overall optimized system
  4693. 3:38:32utilization a terminal window one kind
  4694. 3:38:35of command shell is a process that runs
  4695. 3:38:37as long as needed it allows users to
  4696. 3:38:40execute programs and access resources in
  4697. 3:38:42an interactive environment you can also
  4698. 3:38:45run programs in the background which
  4699. 3:38:47means they become detached from the
  4700. 3:38:49shell processes can be of different
  4701. 3:38:51types according to the task being
  4702. 3:38:54performed here are some different
  4703. 3:38:56process types along with their descript
  4704. 3:38:58descriptions and
  4705. 3:39:11examples a critical kernel function
  4706. 3:39:14called the scheduler consistently shifts
  4707. 3:39:16processes on and off the CPU sharing
  4708. 3:39:18time according to the relative priority
  4709. 3:39:21how much time is needed and how much has
  4710. 3:39:23already been granted to a task when a
  4711. 3:39:26process is in a so-called running state
  4712. 3:39:29it means it's either currently executing
  4713. 3:39:31instructions on a CPU or it's waiting to
  4714. 3:39:33be granted a share of time a Time slice
  4715. 3:39:36so it can execute all processes in this
  4716. 3:39:39state reside on what is called a run que
  4717. 3:39:42and on a computer with multiple CPUs or
  4718. 3:39:44cores the there's a run que on each CPU
  4719. 3:39:47or core however sometimes processes go
  4720. 3:39:50into what is called a sleep State
  4721. 3:39:53generally when they're waiting for
  4722. 3:39:54something to happen before they can
  4723. 3:39:56resume perhaps for the user to type
  4724. 3:39:59something in this condition a process is
  4725. 3:40:02said to be sitting in a weight queue
  4726. 3:40:04there are some other less frequent
  4727. 3:40:06process States especially when a process
  4728. 3:40:08is terminating sometimes a child process
  4729. 3:40:11completes but its parent process has not
  4730. 3:40:14asked about its state amusingly such a
  4731. 3:40:16process is said to be called a said to
  4732. 3:40:18be in a zombie State it's not really
  4733. 3:40:21alive but still shows up in the
  4734. 3:40:22systems's list of
  4735. 3:40:27processes at any given time there are
  4736. 3:40:29always multiple processes being executed
  4737. 3:40:32the operating system keeps track of them
  4738. 3:40:34by assigning each of each a unique
  4739. 3:40:36process ID or p number the p is used to
  4740. 3:40:40track process State CPU usage me memory
  4741. 3:40:43use precisely where resource are located
  4742. 3:40:46in memory and other characteristics new
  4743. 3:40:49PS are usually assigned in ascending
  4744. 3:40:51order as processes are born thus P1
  4745. 3:40:55denotes the init process and and su su
  4746. 3:40:58succeeding processes are gradually
  4747. 3:41:00assigned higher numbers the table
  4748. 3:41:03explains the P ID types and their
  4749. 3:41:05descriptions
  4750. 3:41:16at some point one of your applications
  4751. 3:41:18may stop working properly how do you
  4752. 3:41:21eliminate it to terminate a process you
  4753. 3:41:24can type kill Das Sig kill P ID or K-9
  4754. 3:41:28PID note however you can only kill your
  4755. 3:41:31own processes those belonging to another
  4756. 3:41:33user are off limits unless you're
  4757. 3:41:39root many users can access a system
  4758. 3:41:42simultaneously and each user can run
  4759. 3:41:45multiple processes the operating system
  4760. 3:41:47identifies the user who starts the
  4761. 3:41:49process by the real user ID or the ru ID
  4762. 3:41:53assigned to the user the user who
  4763. 3:41:55determines the access rights for the
  4764. 3:41:57users is identified by the effective uid
  4765. 3:42:01the euid the euid may or may not be the
  4766. 3:42:04same as the
  4767. 3:42:06ruid users can be categorized into
  4768. 3:42:09various groups each group is identified
  4769. 3:42:12by the real group ID or the RG ID the
  4770. 3:42:15access rights of the group are
  4771. 3:42:16determined by the effective group ID the
  4772. 3:42:19EG ID each user can be a member of one
  4773. 3:42:22or more groups most of the time we
  4774. 3:42:25ignore these details and just talk about
  4775. 3:42:27the user ID the U ID and the group ID
  4776. 3:42:34GID at any given time many processes are
  4777. 3:42:37running on the system however a CPU can
  4778. 3:42:40actually accommodate only one task at a
  4779. 3:42:43time just like a car can have only one
  4780. 3:42:45driver at a time some processes are more
  4781. 3:42:49important than others so Linux allows
  4782. 3:42:50you to set and manipulate process
  4783. 3:42:52priority higher priority processes get
  4784. 3:42:55preferential access to the CPU the
  4785. 3:42:58priority for a process can be set by
  4786. 3:43:00specifying a nice value or niceness for
  4787. 3:43:04the process for the the lower the nice
  4788. 3:43:07value the higher the priority low values
  4789. 3:43:09are assigned to important processes
  4790. 3:43:11while high values are assigned to
  4791. 3:43:13processes that can wait longer a process
  4792. 3:43:15with a high nice value simply allows
  4793. 3:43:17other processes to be executed first in
  4794. 3:43:20Linux a nice value of -20 represents the
  4795. 3:43:23highest priority and positive 19
  4796. 3:43:25represents the lowest while this may
  4797. 3:43:27sound backwards this convention goes
  4798. 3:43:30back to the earliest days of Unix you
  4799. 3:43:33can also assign a so-called realtime
  4800. 3:43:35priority to time sensitive tasks such as
  4801. 3:43:38controlling machines through a computer
  4802. 3:43:40or collecting incoming data this is just
  4803. 3:43:43a very high priority and is not to be
  4804. 3:43:45confused with what is called hard real
  4805. 3:43:48time which is conceptually different and
  4806. 3:43:50has more to do with making sure a job
  4807. 3:43:52gets completed within a very well-
  4808. 3:43:54defined time
  4809. 3:43:56window so now let's
  4810. 3:43:59show how to see what the niceness or
  4811. 3:44:02priority of a process is and how you can
  4812. 3:44:04change it with the rice command or how
  4813. 3:44:07you can do it actually from a graphical
  4814. 3:44:09user
  4815. 3:44:10interface so let's look at the uh
  4816. 3:44:14processes and current screen with the PS
  4817. 3:44:16command which we will discuss in detail
  4818. 3:44:19later and we see this current bash shell
  4819. 3:44:22is
  4820. 3:44:243077 to see the priority I can run PS
  4821. 3:44:27with the options
  4822. 3:44:29LF and there you see
  4823. 3:44:323077
  4824. 3:44:34here is is uh here is the bash command
  4825. 3:44:39and the niceness is zero so let's try to
  4826. 3:44:42change the niess I can do rece
  4827. 3:44:46um + 5
  4828. 3:44:513077 and you see it did change the
  4829. 3:44:54priority to five which I can see once
  4830. 3:44:56again with the PS command it has made it
  4831. 3:44:59five here notice that the child process
  4832. 3:45:02I ran off there the command pslf also
  4833. 3:45:05has a niess of five is there anything
  4834. 3:45:08else I create in this shell will have
  4835. 3:45:10that new
  4836. 3:45:11niceness so this is a lower priority
  4837. 3:45:14remember in inreasing the NCIS lowers
  4838. 3:45:16the priority so now suppose I try to
  4839. 3:45:20increase the priority by decreasing the
  4840. 3:45:22NCIS to Minus
  4841. 3:45:255 you notice it says I can't do that
  4842. 3:45:28that's because only the super user or
  4843. 3:45:30root is allowed to increase the priority
  4844. 3:45:32of a process but if I type the same
  4845. 3:45:35command over again with
  4846. 3:45:37Su it work just fine and I can verify
  4847. 3:45:40that once again with
  4848. 3:45:42pslf and there you see it's set up to be
  4849. 3:45:46minus5 now as well as the new
  4850. 3:45:49um the new uh PS command that I issued
  4851. 3:45:53now if I want to do this from a
  4852. 3:45:54graphical utility I can run gnome system
  4853. 3:45:57monitor I'll start from the command line
  4854. 3:46:00here though I could get it uh from a
  4855. 3:46:03menu and uh this is on the first
  4856. 3:46:07possible screen here on
  4857. 3:46:09processes so if I hear that was process
  4858. 3:46:1330 uh that was process is 3077 it's
  4859. 3:46:16right here and you notice it says
  4860. 3:46:18priority High I could rightclick on
  4861. 3:46:22there and I can go to change
  4862. 3:46:24priority and I can just say
  4863. 3:46:27low and now you see that it's low and if
  4864. 3:46:31I get out of the graphical utility and I
  4865. 3:46:35look at the niess
  4866. 3:46:37again you see now the priority has come
  4867. 3:46:40up to
  4868. 3:46:42five I not the the niess of five so that
  4869. 3:46:45means it's low priority
  4870. 3:46:46again so that's how you can manipulate
  4871. 3:46:49the priority of a process from the
  4872. 3:46:51command line or from a graphical
  4873. 3:46:56utility the load average is the average
  4874. 3:46:59of the load number for a given period of
  4875. 3:47:01time it takes into account processes
  4876. 3:47:03that are actively running on a CPU
  4877. 3:47:07considered runnable but waiting for a
  4878. 3:47:09CPU to become available or sleeping I.E
  4879. 3:47:12waiting for some kind of resource to
  4880. 3:47:14become available the load average can be
  4881. 3:47:16viewed by running W top or uptime the
  4882. 3:47:20load average is displayed using three
  4883. 3:47:22numbers such as 0.45 0.17 and 0.12 in
  4884. 3:47:27this screenshot assuming our system is a
  4885. 3:47:30single CPU system the three load average
  4886. 3:47:32numbers are interpreted as follows 0.45
  4887. 3:47:36means for the last minute the system has
  4888. 3:47:38been 45% utilized on average .17 means
  4889. 3:47:42for the last 5 minutes utilization has
  4890. 3:47:44been 17% and 12 is for the last 15
  4891. 3:47:48minutes utilization has been 12% if we
  4892. 3:47:51saw a value of 1 in the second position
  4893. 3:47:54that would imply the single CPU system
  4894. 3:47:56was 100% utilized on average over the
  4895. 3:47:58past 5 minutes this is good if we want
  4896. 3:48:01to fully use a system value over one for
  4897. 3:48:04a single CPU system implies that the
  4898. 3:48:05system was over utilized there were more
  4899. 3:48:08processes needing CPU than CPU was
  4900. 3:48:11available if we had more than one CPU
  4901. 3:48:13say a quad CP CPU system we would divide
  4902. 3:48:16the load average numbers by the number
  4903. 3:48:18of CPUs in this case for example seeing
  4904. 3:48:21a 1 minute load average of 4.0 implies
  4905. 3:48:24that the system as a whole was 100% 4id
  4906. 3:48:28by 4 utilized during the last minute
  4907. 3:48:30short-term increases are usually not a
  4908. 3:48:33problem a high peak you see is likely a
  4909. 3:48:35burst of activity not a new level for
  4910. 3:48:38example at start up many processes start
  4911. 3:48:40and then act and then activity settles
  4912. 3:48:42down the high peak is seen in the five
  4913. 3:48:45and 15 minute load averages it may be
  4914. 3:48:47caused for
  4915. 3:48:51concern Lin supports background and
  4916. 3:48:54foreground job processing a job in this
  4917. 3:48:57context is just a command launched from
  4918. 3:48:59a terminal window foreground jobs run
  4919. 3:49:02directly from the shell and when one
  4920. 3:49:04foreground job is running other jobs
  4921. 3:49:06need to wait for Shell access at least
  4922. 3:49:09in that terminal window if using the the
  4923. 3:49:11guey until it's completed this is fine
  4924. 3:49:14when when jobs complete quickly but this
  4925. 3:49:16can have an adverse effect if the
  4926. 3:49:18current job is going to take a long time
  4927. 3:49:21even several hours to complete in such
  4928. 3:49:23cases you can run the job in the
  4929. 3:49:25background and free the shell for other
  4930. 3:49:28tasks the background job will be
  4931. 3:49:30executed at lower priority which in turn
  4932. 3:49:33will allow smooth execution of the
  4933. 3:49:34interactive tasks and you can type other
  4934. 3:49:37commands in the terminal window while
  4935. 3:49:39the background job is running by default
  4936. 3:49:42all jobs are executed in the foreground
  4937. 3:49:44you can put a job in the background by
  4938. 3:49:46suffixing and or the Amper sand to the
  4939. 3:49:49command for example update DB Amper sand
  4940. 3:49:52you can either use contrl Z to suspend a
  4941. 3:49:55foreground job or contrl C to terminate
  4942. 3:49:58a foreground job and you can always use
  4943. 3:50:00the BG and FG commands to run a process
  4944. 3:50:04in the background and foreground
  4945. 3:50:09respectively the job utility displays
  4946. 3:50:12all jobs running in the background the
  4947. 3:50:15display shows the job ID State and
  4948. 3:50:18command name as shown here jobs- L
  4949. 3:50:21provides the same information as jobs
  4950. 3:50:23and adds the P ID of the background jobs
  4951. 3:50:27the background jobs are connected to the
  4952. 3:50:30terminal window so if you log off the
  4953. 3:50:33job utility will not show the one
  4954. 3:50:34started from that
  4955. 3:50:39window PS provides information about
  4956. 3:50:42currently running processes keyed by P
  4957. 3:50:44ID if you want a repetitive update of
  4958. 3:50:47this status you can use top or other
  4959. 3:50:50commonly installed variants such as htop
  4960. 3:50:53or aop from the command line or invoke
  4961. 3:50:56your distributions graphical system
  4962. 3:50:58monitor application PS has many options
  4963. 3:51:01for specifying exactly which tasks to
  4964. 3:51:04examine what information to display
  4965. 3:51:06about them and precisely what output
  4966. 3:51:08format should be used without options PS
  4967. 3:51:11will display all processes running under
  4968. 3:51:14the current shell you can use the dasu
  4969. 3:51:17option to display information of
  4970. 3:51:19processes for a specified username the
  4971. 3:51:22command ps- EF displays all the
  4972. 3:51:25processes in the system in full detail
  4973. 3:51:28the command ps- EF goes one step further
  4974. 3:51:32and displays one line of information for
  4975. 3:51:34every thread remember a process can
  4976. 3:51:36contain multiple
  4977. 3:51:40threads PS has another style of option
  4978. 3:51:44specification
  4979. 3:51:45which stems from the BSD variety of Unix
  4980. 3:51:48where options are specified without
  4981. 3:51:50proceeding dashes for example the
  4982. 3:51:52command PS Au displays all processes of
  4983. 3:51:55all users the command PS axo allows you
  4984. 3:51:59to specify which attributes you want to
  4985. 3:52:01view this screenshot shows a stample
  4986. 3:52:03output of PS with the aux and axo
  4987. 3:52:07qualifiers the PS utility is used very
  4988. 3:52:10often at the command line to gather
  4989. 3:52:12information about what is running on on
  4990. 3:52:14the system about the various processes
  4991. 3:52:17and tasks which were running what
  4992. 3:52:19resource they were using what
  4993. 3:52:21relationship they have to each other Etc
  4994. 3:52:24if I just type PS without any arguments
  4995. 3:52:27I get the processes which have been
  4996. 3:52:30launched underneath this particular
  4997. 3:52:32terminal window and uh in order to make
  4998. 3:52:35it more interesting I have a background
  4999. 3:52:37processes running I have a cat a aulus
  5000. 3:52:40which is the file manager and Evin which
  5001. 3:52:43is the PDF viewer I can get more
  5002. 3:52:45information if I type ps-
  5003. 3:52:48f which you see now also tells me the
  5004. 3:52:52parent process ID so you notice bash has
  5005. 3:52:57a process ID of
  5006. 3:52:592942 and that's the parent process for
  5007. 3:53:02both the cat and the Nautilus which I
  5008. 3:53:04launched directly out of the shell as
  5009. 3:53:07well as the PS command
  5010. 3:53:09itself uh the evince command is actually
  5011. 3:53:13has something else as a pair for
  5012. 3:53:15complicated reasons having to do with
  5013. 3:53:17how the gnome shell runs if I want to
  5014. 3:53:20get a different piece of information I
  5015. 3:53:22can do ps-
  5016. 3:53:26L and now uh I am also seeing
  5017. 3:53:30information in these two columns about
  5018. 3:53:32the priority and the niceness which on
  5019. 3:53:36most Linux systems is just a a a
  5020. 3:53:38numerical shift okay from uh a neutral
  5021. 3:53:42niess of zero means the default priority
  5022. 3:53:45of 80 which is what all normal processes
  5023. 3:53:48start out
  5024. 3:53:49with okay now I can do more than this if
  5025. 3:53:53I want to give additional arguments so I
  5026. 3:53:55do
  5027. 3:53:57ps-
  5028. 3:53:59EF uh this will tell me about all
  5029. 3:54:02processes on a system and let me type it
  5030. 3:54:05into less so it doesn't go too quickly
  5031. 3:54:08so you can see this is everything which
  5032. 3:54:09is actually running on my system you'll
  5033. 3:54:12notice that the first bunch processes uh
  5034. 3:54:15in this rather long list all have these
  5035. 3:54:17square brackets around them that means
  5036. 3:54:20they were not started by a user program
  5037. 3:54:23they're running inside the kernel to do
  5038. 3:54:25various kinds of uh background tasks
  5039. 3:54:29that run in the kernel all the time
  5040. 3:54:30handle moving things from one CPU to
  5041. 3:54:33another for instance and all kinds of
  5042. 3:54:35other things uh and you see they have
  5043. 3:54:39different priorities uh they minus 20
  5044. 3:54:42here uh minus 20 there that means
  5045. 3:54:45they're higher priorities okay it's kind
  5046. 3:54:48of backwards the lower the priority
  5047. 3:54:50number here the higher the priorities is
  5048. 3:54:53if I page down to the bottom I will
  5049. 3:54:55eventually get to tests which are not
  5050. 3:54:58running inside the kernel which are uh
  5051. 3:55:01running for instance uh under my name
  5052. 3:55:04here Coupe and so you see these are the
  5053. 3:55:07actual user processes and uh they
  5054. 3:55:09they're quite a bit different now one
  5055. 3:55:12reason the PS command can be a little
  5056. 3:55:15confusing is that there are different
  5057. 3:55:18kinds of options those which have a dash
  5058. 3:55:20and which those which do not so for
  5059. 3:55:22instance ps- e is different than PS
  5060. 3:55:26space e uh one commonly set of options
  5061. 3:55:30is PS aux without a dot
  5062. 3:55:33dash and there you see uh one nice
  5063. 3:55:37additional piece of information is the
  5064. 3:55:39percentage of CPU being used and of
  5065. 3:55:42course uh there isn't much going on in
  5066. 3:55:44the system right now so that tends to be
  5067. 3:55:47zero so you can customize what the
  5068. 3:55:51output of the PS command is uh if you
  5069. 3:55:55look at the man page for PS you'll see
  5070. 3:55:57there's ways to have it print out only
  5071. 3:55:59the columns that you want if you want to
  5072. 3:56:01produce some customized reports Etc but
  5073. 3:56:04a standard Linux system administrator
  5074. 3:56:07probably uses PS every day for one thing
  5075. 3:56:09or another
  5076. 3:56:14PS3 displays the processes running on
  5077. 3:56:17the system in the form of a tree diagram
  5078. 3:56:19showing the relationship between a
  5079. 3:56:21process and its parent process and any
  5080. 3:56:24other processes that it created repeated
  5081. 3:56:26entries of a process are not displayed
  5082. 3:56:29and threads are displayed in curly
  5083. 3:56:34braces while a static view of what the
  5084. 3:56:37system is doing is useful monitoring the
  5085. 3:56:40system performance live over time is
  5086. 3:56:42also valuable one of option would be to
  5087. 3:56:45run PS at regular intervals say every
  5088. 3:56:48few seconds a better alternative is to
  5089. 3:56:51use top to get constant realtime updates
  5090. 3:56:54until you exit by typing q. toop this
  5091. 3:56:58clearly highlights which processes are
  5092. 3:57:00consuming the most CPU cycles and memory
  5093. 3:57:03using appropriate commands from within
  5094. 3:57:06top the first line of the top output
  5095. 3:57:08displays a quick summary of what is
  5096. 3:57:10happening in the system including how
  5097. 3:57:13long the system has been up how many
  5098. 3:57:15users are logged on and what is the load
  5099. 3:57:19average the load average determines how
  5100. 3:57:21busy the system is load average of 1.0
  5101. 3:57:25per CPU indicates a fully subscribed but
  5102. 3:57:27not overloaded system if the load
  5103. 3:57:29average goes above the value it
  5104. 3:57:31indicates that the processes are
  5105. 3:57:32competing for CPU time if the load
  5106. 3:57:35average is very high it might indicate
  5107. 3:57:37that the system is having a problem such
  5108. 3:57:39as a runaway process a process in a
  5109. 3:57:42nonresponding state the second line of
  5110. 3:57:45the top output displays the total number
  5111. 3:57:48of processes the number of running
  5112. 3:57:51sleeping stopped and zombie processes
  5113. 3:57:54comparing the number of running
  5114. 3:57:56processes with the load average helps
  5115. 3:57:58determine if the system has reached its
  5116. 3:58:01capacity or perhaps a particular user is
  5117. 3:58:04running too many processes the stopped
  5118. 3:58:07processes should be examined to see if
  5119. 3:58:09everything is running correctly the
  5120. 3:58:11third line of the top output indic
  5121. 3:58:14indicates how the CPU time is being
  5122. 3:58:16divided between the users and the kernel
  5123. 3:58:19by displaying the percentage of CPU time
  5124. 3:58:21used for each the percentage of user
  5125. 3:58:24jobs running at a lower priority
  5126. 3:58:27niceness dni is then listed idle mode or
  5127. 3:58:32ID should be low if the load average is
  5128. 3:58:34high and vice versa the percentage of
  5129. 3:58:36jobs waiting wa for Io is listed
  5130. 3:58:39interrupts include the percentage of
  5131. 3:58:42Hardware or hi vers software interrupts
  5132. 3:58:45SI steel time St is generally used with
  5133. 3:58:49virtual machines which has some of its
  5134. 3:58:51idle CPU time taken for other uses the
  5135. 3:58:55fourth and fifth lines of the top output
  5136. 3:58:58indicate memory usage which is divided
  5137. 3:59:01in two categories physical memory or Ram
  5138. 3:59:06displayed on line 4 and swap space
  5139. 3:59:09displayed on line five both categories
  5140. 3:59:12display total memory used memory and
  5141. 3:59:15free space you need to monitor memory
  5142. 3:59:19usage very carefully to ensure good
  5143. 3:59:21system performance once the physical
  5144. 3:59:24memory is exhausted the system starts
  5145. 3:59:27using swap space or temporary storage
  5146. 3:59:30space on the hard drive as an extended
  5147. 3:59:33memory pool and since accessing disk is
  5148. 3:59:36much slower than access accessing memory
  5149. 3:59:39this will negatively affect the system
  5150. 3:59:41performance if the system starts using
  5151. 3:59:44swap often you can add more swap space
  5152. 3:59:47however adding more physical memory
  5153. 3:59:49should also be considered each line in
  5154. 3:59:52the process list of the top output
  5155. 3:59:55displays information about a process by
  5156. 3:59:57default processes are ordered by highest
  5157. 4:00:00CPU usage the following information
  5158. 4:00:03about each process is displayed process
  5159. 4:00:05identification number P ID process owner
  5160. 4:00:09the user priority PR and nice values ni
  5161. 4:00:14virtual physical and shared memory
  5162. 4:00:17status s a percentage of CPU and memory
  5163. 4:00:22used execution time the time plus and
  5164. 4:00:26command besides reporting information
  5165. 4:00:28top can be utilized interactively for
  5166. 4:00:31monitoring and controlling processes
  5167. 4:00:33while top is running in a terminal
  5168. 4:00:35window you can enter single letter
  5169. 4:00:37commands to change its behavior for
  5170. 4:00:39example you can view the top ranked
  5171. 4:00:41processes based on CPU or memory usage
  5172. 4:00:45if needed you can alter the priorities
  5173. 4:00:47of running processes or you can stop or
  5174. 4:00:50kill a process this table lists what
  5175. 4:00:53happens when pressing various Keys when
  5176. 4:00:55running
  5177. 4:01:01top the top utility is used to
  5178. 4:01:04interactively monitor what processes and
  5179. 4:01:07tests are doing on your system to start
  5180. 4:01:10it up all you have to do is type top
  5181. 4:01:14and it will refresh itself at some
  5182. 4:01:17interval of I think by default two or 3
  5183. 4:01:19seconds it's easily changed uh it shows
  5184. 4:01:23you standard information about each
  5185. 4:01:25process similar to what you get with the
  5186. 4:01:27PS command such as the process ID the
  5187. 4:01:30user the priority and niceness some
  5188. 4:01:33information about how the memory is
  5189. 4:01:35being used by the process U the state as
  5190. 4:01:38being meaning sleeping for instance and
  5191. 4:01:41by default it is sorted by CPU time and
  5192. 4:01:45then there's also memory the total time
  5193. 4:01:47and what the actual command is the lines
  5194. 4:01:50at the top are are have been designed
  5195. 4:01:53over the years to convey a lot of
  5196. 4:01:54information so in the first one you see
  5197. 4:01:56how long the system has been up how many
  5198. 4:01:59users there are the load average or uh
  5199. 4:02:02or rolling averages of how much time has
  5200. 4:02:04been spent in the last I believe 1
  5201. 4:02:07minute 5 minutes Etc there are currently
  5202. 4:02:10295 tasks running on the system but
  5203. 4:02:13really only one is is running the others
  5204. 4:02:14are
  5205. 4:02:15sleeping um and this shows you the CPU
  5206. 4:02:19time percentages used by the user
  5207. 4:02:21processes by the system by so-called
  5208. 4:02:24nice
  5209. 4:02:25processes um and then uh
  5210. 4:02:28idle and uh how many would be waiting
  5211. 4:02:31how many are high priority and and and
  5212. 4:02:33some other details like that then you
  5213. 4:02:35have basic information about the memory
  5214. 4:02:37such how much is being used how much
  5215. 4:02:39swap there is available being used how
  5216. 4:02:42much is in cash Etc if I type the letter
  5217. 4:02:45one I get statistics for each CPU
  5218. 4:02:49instead of uh just The Amalgamated total
  5219. 4:02:52and that can be rather useful one will
  5220. 4:02:55take it back again if I hit H I get a
  5221. 4:02:59listing of what the possible keys I can
  5222. 4:03:02hit are and what they do uh I wouldn't
  5223. 4:03:04make sense to try to run through much of
  5224. 4:03:06that here but I highly recommend that
  5225. 4:03:08you run top and play with these
  5226. 4:03:10different keys and try to understand
  5227. 4:03:12what kind of information you can
  5228. 4:03:14extract well top is how you can do it
  5229. 4:03:17from the command line and if you hit q
  5230. 4:03:19that will kill the program you can get
  5231. 4:03:22similar information by going to your
  5232. 4:03:23menus and finding system
  5233. 4:03:26monitor and then uh let me drag that
  5234. 4:03:28over to this
  5235. 4:03:30screen uh the processes paint on here is
  5236. 4:03:33pretty much the same as tops got the
  5237. 4:03:35same information it's easier to do
  5238. 4:03:37things that could Resort because I could
  5239. 4:03:39just click on memory and get it sorted
  5240. 4:03:41by how much memory is used by clicking
  5241. 4:03:43again I'll get it in descending order uh
  5242. 4:03:47priorities CPU Etc you can also once
  5243. 4:03:51again change the priority of processes
  5244. 4:03:53you can kill them Etc so uh you can do a
  5245. 4:03:56lot and if you want to see the graph
  5246. 4:03:58just click on resources you can see
  5247. 4:04:00what's going with a constantly redrawn
  5248. 4:04:03graph and with file systems you can see
  5249. 4:04:06um how much of your file systems on the
  5250. 4:04:08computer are actually full uh where
  5251. 4:04:11they're mounted Etc so that's a brief
  5252. 4:04:14explanation of top and some related
  5253. 4:04:20issues suppose you need to perform a
  5254. 4:04:22task on a specific day sometime in the
  5255. 4:04:24future however you know you will be away
  5256. 4:04:26from the machine on that day how will
  5257. 4:04:29you perform the task you can use the at
  5258. 4:04:32utility program to execute any
  5259. 4:04:34non-interactive command at a specified
  5260. 4:04:37time as Illustrated in this screenshot
  5261. 4:04:44Kon is a time-based scheduling utility
  5262. 4:04:47program it can launch routine background
  5263. 4:04:50jobs at specific times and or days on an
  5264. 4:04:54ongoing basis KRON is driven by a
  5265. 4:04:57configuration file called the cron table
  5266. 4:05:01which contains the various shell
  5267. 4:05:02commands that need to be run at the
  5268. 4:05:05properly scheduled times there are both
  5269. 4:05:07systemwide cron tab files and individual
  5270. 4:05:11user-based ones each line of the Chron
  5271. 4:05:13tab file represents a job and is
  5272. 4:05:15composed of a so-called Chron expression
  5273. 4:05:18followed by a shell command to execute
  5274. 4:05:21typing Chron t-e will open the Chron tab
  5275. 4:05:24Editor to edit existing jobs or to
  5276. 4:05:26create new jobs each line of the cron
  5277. 4:05:28tab file will contain six
  5278. 4:05:36fields and here are some examples
  5279. 4:05:53sometimes a command or job must be
  5280. 4:05:54delayed or suspended suppose for example
  5281. 4:05:57an application has read the and process
  5282. 4:06:00the contents of a data file and then
  5283. 4:06:02needs to save a report on a backup
  5284. 4:06:05system if the backup system is currently
  5285. 4:06:07busy or not available the application
  5286. 4:06:10can be made to sleep or wait until it
  5287. 4:06:13can complete its work such a delay might
  5288. 4:06:16might be to mount the backup device and
  5289. 4:06:18prepare it for writing sleep suspends
  5290. 4:06:21execution for at least the specified
  5291. 4:06:23period of time which can be given as the
  5292. 4:06:25number of seconds the default minutes
  5293. 4:06:28hours or days after that time has passed
  5294. 4:06:32or an interrupting signal has been
  5295. 4:06:33received execution will resume the
  5296. 4:06:36syntax is sleep and the number and then
  5297. 4:06:38the suffix where the suffix may be S for
  5298. 4:06:41seconds the default m for minutes H for
  5299. 4:06:44hours or D for days sleep and at or at
  5300. 4:06:49are quite different sleep delays
  5301. 4:06:51execution for a specific period while at
  5302. 4:06:55starts execution at a later
  5303. 4:07:01time youve completed chapter nine let's
  5304. 4:07:04summarize the key Concepts covered
  5305. 4:07:07processes are used to perform various
  5306. 4:07:09tasks on the system processes can be
  5307. 4:07:12single-threaded or multi-threaded
  5308. 4:07:15processes can be of different types such
  5309. 4:07:17as interactive and
  5310. 4:07:19non-interactive every process has a
  5311. 4:07:21unique identifier the PID to enable the
  5312. 4:07:23operating system to keep track of it the
  5313. 4:07:26nice value or niess can be used to set
  5314. 4:07:29priority PS provides information about
  5315. 4:07:32the currently running processes you can
  5316. 4:07:35use top to get constant real time
  5317. 4:07:37updates about overall system performance
  5318. 4:07:40as well as information about the
  5319. 4:07:41processes running on the system
  5320. 4:07:44load average indicates the amount of
  5321. 4:07:46utilization the system is under at
  5322. 4:07:49particular times Linux supports
  5323. 4:07:51background and foreground processing for
  5324. 4:07:54a job at executes any non-interactive
  5325. 4:07:58command at a specified time KRON is used
  5326. 4:08:02to schedule tasks that need to be
  5327. 4:08:03performed at regular
  5328. 4:08:09intervals by the end of this chapter you
  5329. 4:08:11should be able to explore explore the
  5330. 4:08:14file system and its hierarchy explain
  5331. 4:08:17the file system architecture compare
  5332. 4:08:19files and identify different file types
  5333. 4:08:22and backup and compress
  5334. 4:08:27data in Linux and all Unix like
  5335. 4:08:30operating systems it is often said
  5336. 4:08:32everything is a file or at least at
  5337. 4:08:35least it's treated as such this means
  5338. 4:08:38whenever you are dealing with normal
  5339. 4:08:39data files and documents or with devices
  5340. 4:08:42such as sound card cards and printers
  5341. 4:08:44you interact with them through the same
  5342. 4:08:46kind of input output operations this
  5343. 4:08:49simplifies things you open a file and
  5344. 4:08:51perform normal operations like reading
  5345. 4:08:53the file and writing on it which is one
  5346. 4:08:56reason why text editors which you will
  5347. 4:08:57learn about in in an upcoming section
  5348. 4:08:59are so important on many systems
  5349. 4:09:02including Linux the file system is
  5350. 4:09:05structured like a tree the tree is
  5351. 4:09:07usually portrayed as inverted and starts
  5352. 4:09:10at what is most often called the root
  5353. 4:09:12directory
  5354. 4:09:13which marks the beginning of the
  5355. 4:09:15hierarchial file system and is also
  5356. 4:09:18sometimes referred to as the trunk or
  5357. 4:09:20simply denoted by a slash the root
  5358. 4:09:23directory is not the same as the root
  5359. 4:09:25user the hierarchial file system also
  5360. 4:09:28contains other elements in the path or
  5361. 4:09:30directory names which are separated by
  5362. 4:09:32forward slashes as in user
  5363. 4:09:35Spinx where the last element is the
  5364. 4:09:38actual file name in this section you
  5365. 4:09:40will learn about some basic concepts
  5366. 4:09:42including the file system hierarchy as
  5367. 4:09:45well as about disk
  5368. 4:09:50partitions Linux supports a number of
  5369. 4:09:53native file system types expressly
  5370. 4:09:56created by Linux developers such as ext3
  5371. 4:10:01ext4 uh squash fs and
  5372. 4:10:04btrfs it also offers implementations of
  5373. 4:10:07file systems used on other alien
  5374. 4:10:10operating systems such as those from
  5375. 4:10:12Windows SGI IBM or Mac OS many older
  5376. 4:10:17Legacy file systems such as fat are also
  5377. 4:10:25supported each file system on a Linux
  5378. 4:10:28system occupies a disk partition
  5379. 4:10:31partitions help to organize the contents
  5380. 4:10:33of diss according to the kind and use of
  5381. 4:10:36the data contained for example important
  5382. 4:10:38programs required to run the system are
  5383. 4:10:40often kept on a separate partition known
  5384. 4:10:44as root or slash this is a separate
  5385. 4:10:47partition than the one that contains
  5386. 4:10:48files owned by regular users of the
  5387. 4:10:50system in slome in addition temporary
  5388. 4:10:53files created and destroyed during the
  5389. 4:10:55normal operation of Linux may be located
  5390. 4:10:58on dedicated partitions one advantage of
  5391. 4:11:01this kind of isolation by type and
  5392. 4:11:03variability is that when all available
  5393. 4:11:06space on a particular partition is
  5394. 4:11:08exhausted the system may still operate
  5395. 4:11:11normally this picture shows the use of
  5396. 4:11:14the G parted utility which displays the
  5397. 4:11:16partition layout on a system which has
  5398. 4:11:18four operating systems on it R eight8 C
  5399. 4:11:21os7 Ubuntu and
  5400. 4:11:26Windows before you can start using a
  5401. 4:11:29file system you need to mount it on the
  5402. 4:11:31file system tree at the mount point this
  5403. 4:11:34is simply a directory which may or may
  5404. 4:11:36not be empty where the file system is to
  5405. 4:11:38be grafted on sometimes you may need to
  5406. 4:11:41create the directory if if it does not
  5407. 4:11:43already exist but keep in mind this
  5408. 4:11:46warning if you mount a file system on a
  5409. 4:11:48non-empty directory the former contents
  5410. 4:11:50of that directory are covered up and not
  5411. 4:11:53accessible until the file system is
  5412. 4:11:55unmounted thus Mount points are usually
  5413. 4:11:58empty
  5414. 4:11:59directories the mount command is used to
  5415. 4:12:01attach a file system which can be local
  5416. 4:12:04to the computer or on a network
  5417. 4:12:06somewhere within the file system tree
  5418. 4:12:09the basic arguments are the device node
  5419. 4:12:12and the mount point for example studo
  5420. 4:12:15Mount or /dev sda5 slome will attach the
  5421. 4:12:19file system contained in the dis
  5422. 4:12:21partition associated with the /dev sda5
  5423. 4:12:24device node into the file system tree at
  5424. 4:12:27the /home mount point there are other
  5425. 4:12:30ways to specify the partition other than
  5426. 4:12:32the device node such as using the dis
  5427. 4:12:33label or The UU ID to unmount the
  5428. 4:12:36partition the command would be pseudo
  5429. 4:12:38umount slome note the command is umount
  5430. 4:12:42not unmount
  5431. 4:12:43only a root user has the privilege to
  5432. 4:12:46run these commands unless the system has
  5433. 4:12:48been otherwise configured if you want it
  5434. 4:12:51to be automatically available every time
  5435. 4:12:53the system starts up you need to edit
  5436. 4:12:55the /c/ fstab accordingly looking at
  5437. 4:12:59this file will show you the
  5438. 4:13:00configuration of all preconfigured file
  5439. 4:13:03systems man fstab will display how this
  5440. 4:13:06file is used and how to configure it
  5441. 4:13:08executing Mount without any arguments
  5442. 4:13:10will show all presently mounted file
  5443. 4:13:12system systems the command df- th dis
  5444. 4:13:16free will display information about
  5445. 4:13:17mounted file systems including the file
  5446. 4:13:19system type and usage statistics about
  5447. 4:13:22currently used and available
  5448. 4:13:27space it's often necessary to share data
  5449. 4:13:29across physical systems which may be
  5450. 4:13:32either in the same location or anywhere
  5451. 4:13:34that can be reached by the internet a
  5452. 4:13:36network or distributed file system may
  5453. 4:13:40have all data on one machine or have it
  5454. 4:13:42spread out out on more than one network
  5455. 4:13:44node a variety of different file systems
  5456. 4:13:47can be used locally on the individual
  5457. 4:13:50machines a network file system can be
  5458. 4:13:52thought of as a grouping of lower level
  5459. 4:13:55file systems of varying types many
  5460. 4:13:58system administrators Mount remote users
  5461. 4:14:00home directories on a server in order to
  5462. 4:14:02give them access to the same files and
  5463. 4:14:04configuration files across multiple
  5464. 4:14:06client systems this allows the users to
  5465. 4:14:09log into different computers you still
  5466. 4:14:11have access to the same files and
  5467. 4:14:13resources the most common such file
  5468. 4:14:15systems is named simply NFS the network
  5469. 4:14:18file system it has a very long history
  5470. 4:14:21and was first developed by Sun
  5471. 4:14:22Microsystems another common
  5472. 4:14:24implementation is cifs also termed Samba
  5473. 4:14:28which has Microsoft
  5474. 4:14:33roots in this section you will learn to
  5475. 4:14:35identify and differentiate between the
  5476. 4:14:37most important directories found in
  5477. 4:14:39Linux we start with ordinary users home
  5478. 4:14:42directory space each user has a home
  5479. 4:14:45directory usually placed under the slome
  5480. 4:14:48the/ root directory on Modern Linux
  5481. 4:14:51systems is no more than the home
  5482. 4:14:53directory of the root user or super user
  5483. 4:14:56or system administrator account on
  5484. 4:14:58multi-user systems the slome directory
  5485. 4:15:01infrastructure is often mounted as a
  5486. 4:15:04separate file system on its own
  5487. 4:15:05partition or even exported remotely on a
  5488. 4:15:08network through NFS sometimes you may
  5489. 4:15:11group users based on their department or
  5490. 4:15:13function you can then create
  5491. 4:15:15subdirectories under the slome directory
  5492. 4:15:17for each of these groups for example a
  5493. 4:15:20school May organized slome with
  5494. 4:15:22something like the following slome facty
  5495. 4:15:25slome staff slome students the /bin and
  5496. 4:15:28SL sbin
  5497. 4:15:32directory the /bin directory contains
  5498. 4:15:35executable binaries essential commands
  5499. 4:15:38used to boot the system and essential
  5500. 4:15:40commands required by all system users
  5501. 4:15:42such as cat CP LS MV PS and RM likewise
  5502. 4:15:46the/ sbin directory is intended for
  5503. 4:15:49essential binaries related to system
  5504. 4:15:51administration such as FSS and IP to
  5505. 4:15:55view of list of these programs you can
  5506. 4:15:56type
  5507. 4:15:58lsbs spin commands that are not
  5508. 4:16:00essential for the system to boot or
  5509. 4:16:03operate in single user mode are placed
  5510. 4:16:05in the/ user bin and/ userin directories
  5511. 4:16:10historically this was done so/ user
  5512. 4:16:12could be mounted as a separate file
  5513. 4:16:14system that could be mounted at a later
  5514. 4:16:15stage of system startup or even over a
  5515. 4:16:17network however nowadays most find this
  5516. 4:16:20distinction is obsolete in fact many
  5517. 4:16:23distributions have been discovered to be
  5518. 4:16:24unable to boot with this separation as
  5519. 4:16:27this modality had not been used or
  5520. 4:16:30tested for a long time thus on some of
  5521. 4:16:32the newest Linux distributions sluser
  5522. 4:16:35spin and/ spin are actually just
  5523. 4:16:38symbolically linked together as are/
  5524. 4:16:41userin and/ spin
  5525. 4:16:46certain file systems like the one
  5526. 4:16:48mounted at slpr are called pseudo file
  5527. 4:16:51systems because they have no permanent
  5528. 4:16:53presence anywhere on the disk the slpr
  5529. 4:16:56file system contains virtual files files
  5530. 4:16:59that only exist in memory that permit
  5531. 4:17:01viewing constantly changing kernel data
  5532. 4:17:04slpr contains files and directories that
  5533. 4:17:06mimic kernel structures and
  5534. 4:17:08configuration information it does not
  5535. 4:17:11contain real files but onetime system
  5536. 4:17:13information IG system memory devices
  5537. 4:17:16mounted Hardware configuration Etc some
  5538. 4:17:19important entries in SL proc are the
  5539. 4:17:23following slpr has subdirectories as
  5540. 4:17:26well including the following the first
  5541. 4:17:29example shows there is a directory for
  5542. 4:17:32every process running on a system which
  5543. 4:17:34contains Vital Information about it the
  5544. 4:17:37second example shows a virtual directory
  5545. 4:17:40that contains a lot of information about
  5546. 4:17:42the entire system in particular its
  5547. 4:17:44hardware and configuration the slpr file
  5548. 4:17:48system is very useful because the
  5549. 4:17:50information it reports is gathered only
  5550. 4:17:52as needed and never needs storage on the
  5551. 4:17:58dis the /dev directory contains device
  5552. 4:18:01nodes a type of pseudo file used by most
  5553. 4:18:05hardware and software devices except for
  5554. 4:18:08network devices this directory is empty
  5555. 4:18:10on the dis partition when it's not
  5556. 4:18:12mounted and also contains entries which
  5557. 4:18:14are created by the UDF system which
  5558. 4:18:17creates and manages device nodes on
  5559. 4:18:19Linux creating them dynamically when
  5560. 4:18:22devices are found the /dev directory
  5561. 4:18:25contains items such as /dev sda1 the
  5562. 4:18:29first partition on the first hard disk
  5563. 4:18:31/d lp1 the second printer SL da random a
  5564. 4:18:35source of random
  5565. 4:18:39numbers the SL ofar directory contains
  5566. 4:18:42files that are expected to change in
  5567. 4:18:44size and content as the system is
  5568. 4:18:46running VAR stands for a variable such
  5569. 4:18:49as the entries in the following
  5570. 4:18:50directories system log files /ar log and
  5571. 4:18:54packages and database files like slf
  5572. 4:18:56farli print cues /ar SLS poool and
  5573. 4:19:00temporary files /var TMP the /var
  5574. 4:19:03directory may be put on its own file
  5575. 4:19:06system so that growth of the files can
  5576. 4:19:08be accommodated and any exploding file
  5577. 4:19:10sizes do not fatally affect the system
  5578. 4:19:13network service directories such asfar
  5579. 4:19:16FP the FTP Service inar www the HTTP web
  5580. 4:19:22service are also found under SLB
  5581. 4:19:27bar the SLC directory is the home for
  5582. 4:19:31system config configuration files it
  5583. 4:19:34contains no binary programs although
  5584. 4:19:36there are some executable scripts for
  5585. 4:19:38example /c/ resolve. conf tells the
  5586. 4:19:41system where to go on the network to
  5587. 4:19:43obtain host to IP address mappings DNS
  5588. 4:19:47files like password Shadow and group for
  5589. 4:19:49managing user accounts are found in the
  5590. 4:19:51SLC directory well some distributions
  5591. 4:19:54have historically had their own
  5592. 4:19:55extensive infrastructure under
  5593. 4:19:58SLC with the Adent of system MD there's
  5594. 4:20:01much more uniformity among distributions
  5595. 4:20:03today note that/ Etc is for systemwide
  5596. 4:20:06configuration files and only the super
  5597. 4:20:08user can modify files there user
  5598. 4:20:11specific configuration files are always
  5599. 4:20:13found under their home
  5600. 4:20:18directory the SL boot directory contains
  5601. 4:20:20the few essential files needed to boot
  5602. 4:20:22the system for every alternative kernel
  5603. 4:20:24installed on the system there are these
  5604. 4:20:26four files VM Li nuz which is the
  5605. 4:20:29compressed Linux kernel required for
  5606. 4:20:32booting in it Ram FS which is the
  5607. 4:20:34initial Ram file system required for
  5608. 4:20:36booting sometimes called init Rd not
  5609. 4:20:39init Ram fs and then config the kernel
  5610. 4:20:42configuration file only used for
  5611. 4:20:44debugging and bookkeeping and finally
  5612. 4:20:46system.map which is the kernel symbol
  5613. 4:20:49table only used for debugging each of
  5614. 4:20:51these files has a kernel version
  5615. 4:20:53appended to its name the grub files such
  5616. 4:20:56as boot SLG grub grub.com orboot grub2
  5617. 4:21:01grub2 CFG are also found under the/ boot
  5618. 4:21:05directory this screenshot shows an
  5619. 4:21:07example listing of the/ boot directory
  5620. 4:21:09taken from the real system that has
  5621. 4:21:11multiple installed kernels including
  5622. 4:21:14both distribution supplied and custom
  5623. 4:21:16compiled ones names will vary and things
  5624. 4:21:19will tend to look somewhat different on
  5625. 4:21:21a different
  5626. 4:21:25distribution SL Li contains libraries
  5627. 4:21:28which is which are common code shared by
  5628. 4:21:30applications and needed for them to run
  5629. 4:21:32it contains libraries for essential
  5630. 4:21:34programs in SLB and slin these Library
  5631. 4:21:38file names either start with LD or lib
  5632. 4:21:41here's an example
  5633. 4:21:43most of these are what is known as
  5634. 4:21:45dynamically loaded libraries also known
  5635. 4:21:48as shared libraries or shared objects on
  5636. 4:21:51some Linux distributions there exist a
  5637. 4:21:53SL lib64 directory containing 64-bit
  5638. 4:21:56libraries while SL lib contains 32-bit
  5639. 4:21:59versions on re recent Linux
  5640. 4:22:02distributions you can find this just
  5641. 4:22:05like for /bin and/ sbin the directories
  5642. 4:22:08just point to the those under SL user
  5643. 4:22:11kernel modules or colel code often
  5644. 4:22:13device drivers that can be loaded and
  5645. 4:22:15unloaded without restarting the system
  5646. 4:22:18are located in/ li/ modules SL and then
  5647. 4:22:22the kernel version
  5648. 4:22:26number one often uses removable media
  5649. 4:22:29such as USB driv CDs and DVDs to make
  5650. 4:22:32the material accessible through the
  5651. 4:22:33regular file system it has to be mounted
  5652. 4:22:36at a convenient location most Linux
  5653. 4:22:38systems are configured so any removable
  5654. 4:22:40media are automatically mounted when the
  5655. 4:22:42system notices something has been
  5656. 4:22:44plugged in while historically this was
  5657. 4:22:46done under the/ media directory modern
  5658. 4:22:49Linux distributions place these Mount
  5659. 4:22:51points under the/ run directory for
  5660. 4:22:54example a USB pin drive with a label my
  5661. 4:22:57USB drive for a usern named student will
  5662. 4:23:00be mounted atrun media studenty USB
  5663. 4:23:03drive the SL Mount directory has been
  5664. 4:23:06used since the early days of Unix for
  5665. 4:23:08temporarily mounting file systems these
  5666. 4:23:11can be those on removal able media but
  5667. 4:23:13more often they might be Network file
  5668. 4:23:15systems which are not normally mounted
  5669. 4:23:17or these can be temporary partitions or
  5670. 4:23:19so-called loop back file systems which
  5671. 4:23:22are files which pretend to be
  5672. 4:23:27partitions here are some additional
  5673. 4:23:29directories to be found under the root
  5674. 4:23:40directory the SL user directory tree
  5675. 4:23:43contains theoretically non-essential
  5676. 4:23:45programs and scripts in the sense that
  5677. 4:23:47they should not be needed to initially
  5678. 4:23:49boot the system and has at least the
  5679. 4:23:51following subdirectories shown
  5680. 4:24:00here now that you know about the file
  5681. 4:24:03system and its structure let's learn how
  5682. 4:24:05to manage files and directories diff is
  5683. 4:24:08used to compare files and directories
  5684. 4:24:11this often used utility program has many
  5685. 4:24:14useful options including the ones you
  5686. 4:24:16see
  5687. 4:24:21here to compare two files at the command
  5688. 4:24:23prompt type diff and options file name
  5689. 4:24:27one file name two diff is meant to be
  5690. 4:24:29used for text files for binary files one
  5691. 4:24:32can use CMP in this section you will
  5692. 4:24:34learn additional methods for comparing
  5693. 4:24:36files and how to apply patches to files
  5694. 4:24:43you can compare three files at once
  5695. 4:24:45using diff 3 which uses one file as the
  5696. 4:24:47reference basis for the other two for
  5697. 4:24:50example suppose you and a coworker both
  5698. 4:24:52have made modifications to the same file
  5699. 4:24:54working at the same time independently
  5700. 4:24:57diff 3 can show the differences based on
  5701. 4:25:00the common file you both started with
  5702. 4:25:03here's the Syntax for diff
  5703. 4:25:053 this graphic shows the use of diff 3
  5704. 4:25:09many modifications to source code and
  5705. 4:25:11configuration files are distributed
  5706. 4:25:13utilizing patches which are applied not
  5707. 4:25:16surprisingly with the patch program a
  5708. 4:25:18patch file contains the Deltas or
  5709. 4:25:20changes required to update an older
  5710. 4:25:22version of a file to the new one the
  5711. 4:25:25patch files are actually produced by
  5712. 4:25:26running diff with the correct options as
  5713. 4:25:29in this command Distributing just the
  5714. 4:25:32patch is more concise and efficient than
  5715. 4:25:34Distributing the entire file for example
  5716. 4:25:36if only one line needs to change in a
  5717. 4:25:39file that contains 1,000 lines the patch
  5718. 4:25:41file will be just a few a few lines long
  5719. 4:25:44to apply a patch you can just do either
  5720. 4:25:46of these two methods the first usage is
  5721. 4:25:49more common as it's often used to apply
  5722. 4:25:51changes to an entire directory tree
  5723. 4:25:54rather than just one file as in the
  5724. 4:25:56second example to understand the use of
  5725. 4:25:58the- P1 option and many others see the
  5726. 4:26:01man page for
  5727. 4:26:05patch in Linux a file's extension often
  5728. 4:26:08does not categorize it the way it might
  5729. 4:26:10in other operating system systems one
  5730. 4:26:13cannot assume that a file name file.txt
  5731. 4:26:15is a text file and not an executable
  5732. 4:26:18program in Linux a file name is
  5733. 4:26:20generally more meaningful to the user of
  5734. 4:26:22the system than the system itself in
  5735. 4:26:24fact most applications directly examine
  5736. 4:26:26a file's contents to see what kind of
  5737. 4:26:28app object it is rather than relying on
  5738. 4:26:31an extension this is very different from
  5739. 4:26:33the way Windows handles file names where
  5740. 4:26:35a file name ending in. exe for example
  5741. 4:26:39represents an executable binary file the
  5742. 4:26:41real nature nature of a file can be
  5743. 4:26:43determined by using the file utility for
  5744. 4:26:46the file names given as arguments it
  5745. 4:26:48examines the contents and certain
  5746. 4:26:51characteristics to determine whether the
  5747. 4:26:53files are plain text shared libraries
  5748. 4:26:56executable programs scripts or something
  5749. 4:27:02else there are many ways you can back up
  5750. 4:27:04data or even your entire system basic
  5751. 4:27:06ways to do so include the use of simple
  5752. 4:27:09coping with CP and use of the more
  5753. 4:27:11robust rsync both can be used to
  5754. 4:27:14synchronize entire directory trees
  5755. 4:27:17however our sync is more efficient
  5756. 4:27:18because it checks if the file being
  5757. 4:27:20copied already exists if the file exists
  5758. 4:27:24and there is no change in size or
  5759. 4:27:26modification time our sync will avoid an
  5760. 4:27:28unnecessary copy and save time
  5761. 4:27:31furthermore because R sync copies only
  5762. 4:27:33the parts of the file that have actually
  5763. 4:27:34changed it can be very fast CP can only
  5764. 4:27:38copy files two and from destinations on
  5765. 4:27:40the local machine but rsync can also be
  5766. 4:27:43used to copy files from one machine to
  5767. 4:27:45another locations are designated in the
  5768. 4:27:48Target colon path form where Target can
  5769. 4:27:51be the form of someone at host and the
  5770. 4:27:54someone at part is optional and used if
  5771. 4:27:56the remote user is different from the
  5772. 4:27:58local user our sync is very efficient
  5773. 4:28:01when recursively copying One Directory
  5774. 4:28:03tree to another because only the
  5775. 4:28:05differences are transmitted over the
  5776. 4:28:07network one often synchronizes the
  5777. 4:28:10destination directory tree with with the
  5778. 4:28:12origin using the dasr option to
  5779. 4:28:15recursively walk down the directory tree
  5780. 4:28:17copying all files and directories below
  5781. 4:28:19the one listed as the
  5782. 4:28:24source our sync is a very powerful
  5783. 4:28:26utility for example a very useful way to
  5784. 4:28:29back up a project directory might be to
  5785. 4:28:31use this
  5786. 4:28:35command note that rsync can be very
  5787. 4:28:38destructive accidental misuse can do a
  5788. 4:28:41lot of harm to data and programs by
  5789. 4:28:43inadvertently copying changes to where
  5790. 4:28:45they are not wanted take care to specify
  5791. 4:28:48the correct options and paths it's
  5792. 4:28:50highly recommended that you first test
  5793. 4:28:52your rsync command using the dash
  5794. 4:28:54dry-run option to ensure that it
  5795. 4:28:57provides the results that you want to
  5796. 4:28:59use rsync at the command prompt type
  5797. 4:29:01rsync source file destination file where
  5798. 4:29:04either file can be on the local machine
  5799. 4:29:06or on a network machine the contents of
  5800. 4:29:09source file will be copied to
  5801. 4:29:10destination file a good combination of
  5802. 4:29:13options is shown
  5803. 4:29:16here the file data is often compressed
  5804. 4:29:19to save dis space and reduce the time it
  5805. 4:29:21takes to transmit files over networks
  5806. 4:29:24Linux uses a number of methods to
  5807. 4:29:26perform this compression including
  5808. 4:29:32these these techniques vary in the
  5809. 4:29:35efficiency of the compression or how
  5810. 4:29:37much space is saved and how long they
  5811. 4:29:39take to compress generally the more
  5812. 4:29:41efficient techniques take longer
  5813. 4:29:43decompression time does not vary as much
  5814. 4:29:46across different
  5815. 4:29:50methods you have completed chapter 10
  5816. 4:29:54let's summarize the key Concepts covered
  5817. 4:29:57the file system tree of starts at what
  5818. 4:30:00is often called the root directory or
  5819. 4:30:01trunk or slash the file system
  5820. 4:30:04hierarchial standard FHS provides Linux
  5821. 4:30:07developers and system administrators a
  5822. 4:30:10standard directory structure for the the
  5823. 4:30:12file system partitions help to segregate
  5824. 4:30:15files according to usage ownership and
  5825. 4:30:18type file systems can be mounted
  5826. 4:30:20anywhere on the main file system tree at
  5827. 4:30:23a mount Point automatic file systems
  5828. 4:30:26mounting can be set up by editing Etc
  5829. 4:30:29FST tab NFS or network file system is a
  5830. 4:30:32useful method for sharing files and data
  5831. 4:30:34through the network systems file systems
  5832. 4:30:37like slpr are called studo file systems
  5833. 4:30:40because they exist only in memory
  5834. 4:30:42SL root is the home directory for the
  5835. 4:30:45root user /var may be put in its own
  5836. 4:30:49file system so that growth can be
  5837. 4:30:51contained and not fatally affect the
  5838. 4:30:53system/ boot contains the basic files
  5839. 4:30:56needed to boot the system patch is a
  5840. 4:30:59very useful tool in Linux many
  5841. 4:31:01modifications to source code and
  5842. 4:31:02configuration files are distributed with
  5843. 4:31:04patch files as they contain the Deltas
  5844. 4:31:07or changes to go from an old version of
  5845. 4:31:09a file to the new version of a file file
  5846. 4:31:12extensions in Linux do not necessarily
  5847. 4:31:14mean that a file is of a certain type CP
  5848. 4:31:18is used to copy files on the local
  5849. 4:31:20machine while rsync can be all can be
  5850. 4:31:23used to copy files from one machine to
  5851. 4:31:25another as well as synchronized
  5852. 4:31:30contents by the end of this chapter you
  5853. 4:31:32should be familiar with how to create
  5854. 4:31:35and edit files using the available Linux
  5855. 4:31:37text editors Nano a simple text based
  5856. 4:31:41editor gedit a simple graphical editor
  5857. 4:31:44VI and emac two Advanced editors with
  5858. 4:31:47both text based and graphical
  5859. 4:31:53interfaces at some point you will need
  5860. 4:31:55to manually edit text files you might be
  5861. 4:31:58composing an email offline writing a
  5862. 4:32:00script to be used for bash or other
  5863. 4:32:02command interpreters altering a system
  5864. 4:32:05or application configuration file or
  5865. 4:32:07developing source code for a programming
  5866. 4:32:10language such as C python or Java Linux
  5867. 4:32:13administrators May sidestep using a text
  5868. 4:32:15editor instead employing graphical
  5869. 4:32:17utilities for creating and modifying
  5870. 4:32:19system configuration files however this
  5871. 4:32:22can be more laborous than directly using
  5872. 4:32:24a text editor and be more limited in
  5873. 4:32:27capability note that word processing
  5874. 4:32:29applications including those that are
  5875. 4:32:31part of common Office application Suites
  5876. 4:32:34are not really basic text editors they
  5877. 4:32:37add a lot of extra usually invisible
  5878. 4:32:39formatting information that will
  5879. 4:32:41probably render system administration
  5880. 4:32:44configuration files unusable for their
  5881. 4:32:46intended purpose so knowing how to
  5882. 4:32:49confidently use one or more text editors
  5883. 4:32:51is really an essential skill to have for
  5884. 4:32:54Linux by now you have certainly realized
  5885. 4:32:57Linux is packed with choices when it
  5886. 4:32:59comes to text editors there are many
  5887. 4:33:02choices ranging from quite simple to
  5888. 4:33:05very complex including Nano gedit VI or
  5889. 4:33:10emac in this section we learn first
  5890. 4:33:13about the Nano and gedit editors which
  5891. 4:33:16are relatively simple and easy to learn
  5892. 4:33:18and then later the more complicated
  5893. 4:33:20choices VI and emac before we start
  5894. 4:33:24let's take a look at some cases where an
  5895. 4:33:26editor is not
  5896. 4:33:31needed sometimes you may want to create
  5897. 4:33:33a short file and don't want to bother
  5898. 4:33:35invoking a full text editor in addition
  5899. 4:33:38doing so can be quite useful when used
  5900. 4:33:41from within scripts even when creating
  5901. 4:33:43longer files you'll no doubt find
  5902. 4:33:45yourself using this method when you
  5903. 4:33:47start on the later chapters that cover
  5904. 4:33:49shell skip scripting if you want to
  5905. 4:33:51create a file without using an editor
  5906. 4:33:53there are two standard ways to create
  5907. 4:33:54one from the command Lin and fill it
  5908. 4:33:57with content the first one is to use
  5909. 4:33:59Echo repeatedly like shown here note
  5910. 4:34:03that while a single greater than sign
  5911. 4:34:06will send the output of a command to a
  5912. 4:34:08file two of them will appin the new out
  5913. 4:34:11output to an existing file the second
  5914. 4:34:14way is to use cat combined with
  5915. 4:34:17redirection uh as in this example here
  5916. 4:34:21both techniques produce a file with the
  5917. 4:34:24following lines in it line one line two
  5918. 4:34:27line three and are extremely useful when
  5919. 4:34:30employed by
  5920. 4:34:34scripts there are some text editors that
  5921. 4:34:37are pretty obvious they require no
  5922. 4:34:39particular experience to learn and are
  5923. 4:34:41actually quite capable even robust
  5924. 4:34:43particularly easy to use one is the text
  5925. 4:34:46terminal based editor Nano just invoke
  5926. 4:34:49Nano by giving a file name as an
  5927. 4:34:51argument all the help you need is
  5928. 4:34:53displayed at the bottom of the screen
  5929. 4:34:54and you should be able to proceed
  5930. 4:34:56without any problem as a graphical
  5931. 4:34:59editor gedit is part of the gnome
  5932. 4:35:01desktop system kri is associated with
  5933. 4:35:04KDE the gedit and kri editors are very
  5934. 4:35:08easy to use and are extremely capable
  5935. 4:35:10they're also very configured
  5936. 4:35:12they look a lot like notepad and windows
  5937. 4:35:14other variants such as Kate are also
  5938. 4:35:17supported by KDE Nano is easy to use and
  5939. 4:35:20requires very little effort to learn to
  5940. 4:35:22open a file type Nano and then the file
  5941. 4:35:24name and press enter if the file does
  5942. 4:35:27not exist it will be created Nano
  5943. 4:35:29provides a two-line shortcut at the
  5944. 4:35:32bottom of the screen that lists the
  5945. 4:35:34available commands some of these
  5946. 4:35:35commands are contrl G display the help
  5947. 4:35:38screen crl o WR to a file contrl X ex
  5948. 4:35:43exit a file contrl R insert contents
  5949. 4:35:45from another file to the current buffer
  5950. 4:35:48or contrl C show the cursor position
  5951. 4:35:51zedit is a simpl to ous graphical editor
  5952. 4:35:55that can only be run within a graphical
  5953. 4:35:58desktop environment it is visually quite
  5954. 4:36:01similar to the notepad text editor in
  5955. 4:36:03Windows but it's actually far more
  5956. 4:36:05capable and very configurable and has a
  5957. 4:36:07wealth of plugins available to extend
  5958. 4:36:09its capabilities further to open a new
  5959. 4:36:12file find the program in your desktop's
  5960. 4:36:15menu system or from the command line
  5961. 4:36:17type gedit and then the file name if the
  5962. 4:36:20file does not exist it will be created
  5963. 4:36:23using gedit is pretty straightforward
  5964. 4:36:25and does not require much training it's
  5965. 4:36:27interface is composed of quite familiar
  5966. 4:36:33elements developers and administrators
  5967. 4:36:37experienced in working on Unix like
  5968. 4:36:39systems almost always use one of the two
  5969. 4:36:42vable editing options VI and emac both
  5970. 4:36:46are present or easily available on all
  5971. 4:36:48distributions and are completely
  5972. 4:36:50compatible with the versions available
  5973. 4:36:52on other operating systems both VI and
  5974. 4:36:55emac have a basic purely text-based form
  5975. 4:36:58that can run in a non-graphical
  5976. 4:37:00environment they also have one or more
  5977. 4:37:03graphical interface forms with extended
  5978. 4:37:06capabilities these may be friendlier for
  5979. 4:37:08a less experienced user while VI and
  5980. 4:37:11Emil Max can have significantly steep
  5981. 4:37:13learning curves for new users they're
  5982. 4:37:15extremely efficient when when one has
  5983. 4:37:16learned how to use them usually the
  5984. 4:37:18actual program installed on your system
  5985. 4:37:20is vim which stands for Vi improved and
  5986. 4:37:25is Alias to the name VI even if you
  5987. 4:37:28don't want to use VI it's good to gain
  5988. 4:37:31some familiarity with it it's a standard
  5989. 4:37:33tool installed on virtually all Linux
  5990. 4:37:35distributions and Mac OS indeed there
  5991. 4:37:38may be times when there is no other
  5992. 4:37:40editor available on the system
  5993. 4:37:42and remember VI and them are going to be
  5994. 4:37:44very similar gome extends VI with a
  5995. 4:37:47graphical interface known as gvm and KDE
  5996. 4:37:50offers km either of these may be easier
  5997. 4:37:52to use at first when using VI all
  5998. 4:37:55commands are entered through the
  5999. 4:37:57keyboard you don't need to keep moving
  6000. 4:37:58your hands to use a pointer device such
  6001. 4:38:01as a mouse or touchpad unless you want
  6002. 4:38:03to do so when using one of the graphical
  6003. 4:38:05versions of the editor typing Vim tutor
  6004. 4:38:09launches a short but very comprehensive
  6005. 4:38:11tutorial for those who want to learn
  6006. 4:38:13their first VI commands even though it
  6007. 4:38:16provides only an introduction and just
  6008. 4:38:18seven lessons it has enough material to
  6009. 4:38:20make you a very proficient VI user
  6010. 4:38:23because it covers a large number of
  6011. 4:38:25commands after learning these basic ones
  6012. 4:38:28you can look up new tricks to
  6013. 4:38:29incorporate into your list of VI
  6014. 4:38:32commands because there are always more
  6015. 4:38:34optimal ways to do things in VI with
  6016. 4:38:36less typing VI provides three modes as
  6017. 4:38:40described in this table here here it's
  6018. 4:38:42vital to not lose track of which mode
  6019. 4:38:44you're in many keystrokes and commands
  6020. 4:38:46have quite different behave quite
  6021. 4:38:48differently in different
  6022. 4:38:55modes this table describes the most
  6023. 4:38:57important commands used to start exit
  6024. 4:39:00read and write files in VI the enter key
  6025. 4:39:03needs to be pressed after all of these
  6026. 4:39:08commands and this table describes the
  6027. 4:39:10most important keystrokes used when
  6028. 4:39:13changing cursor positions in VI line
  6029. 4:39:16mode commands those following a colon
  6030. 4:39:19require the enter key to be pressed
  6031. 4:39:21after the command is
  6032. 4:39:25typed let's get started on using modes
  6033. 4:39:27and cursor movements in VI open VI by
  6034. 4:39:31typing VI followed by the file name VI
  6035. 4:39:35opens in command mode type I to enter
  6036. 4:39:38insert mode VI's insert mode is
  6037. 4:39:41displayed type the following sentences
  6038. 4:39:44the quick brown fox jumped over the lazy
  6039. 4:39:47dog nobody expects the Spanish
  6040. 4:39:50Inquisition to exit insert mode and
  6041. 4:39:52switch to command mode press escape to
  6042. 4:39:56exit VI and save the file type colon WQ
  6043. 4:40:00and press
  6044. 4:40:02enter open the recently saved file and
  6045. 4:40:05place the cursor on the letter k in the
  6046. 4:40:07word quick in the first sentence to move
  6047. 4:40:10the cursor four characters to the left
  6048. 4:40:13type h four times the cursor is moved to
  6049. 4:40:16letter Q of the word quick to move the
  6050. 4:40:19cursor to the next line type J to move
  6051. 4:40:23the cursor to the beginning of the next
  6052. 4:40:24word type w the cursor is moved to the
  6053. 4:40:28beginning of the word expects to move
  6054. 4:40:31the cursor to the end type the dollar
  6055. 4:40:33sign the cursor is moved to the end of
  6056. 4:40:36the second sentence type I to enter
  6057. 4:40:39insert mode VI insert mode is displayed
  6058. 4:40:42to insert text at the end of the second
  6059. 4:40:44sentence type A and type history the
  6060. 4:40:48word history is displayed to the end of
  6061. 4:40:50the sentence to exit insert mode and
  6062. 4:40:52switch to command mode press escape to
  6063. 4:40:56exit VI and save the file type colon WQ
  6064. 4:41:00and press enter here you can see the
  6065. 4:41:03most important commands used when
  6066. 4:41:05searching for text in VI the enter key
  6067. 4:41:08should be pressed after typing the
  6068. 4:41:10search pattern
  6069. 4:41:12this table describes the most important
  6070. 4:41:14keystrokes used when searching for text
  6071. 4:41:17in VI and this table describes the most
  6072. 4:41:20important keystrokes used when changing
  6073. 4:41:22adding and deleting text in
  6074. 4:41:38VI typing the sh command opens an
  6075. 4:41:41external command shell when you exit the
  6076. 4:41:43shell you will resume your editing
  6077. 4:41:45session typing exclamation point
  6078. 4:41:48executes a command from within VI the
  6079. 4:41:51command follows the exclamation point
  6080. 4:41:53this technique is best suited for
  6081. 4:41:55non-interactive commands such as
  6082. 4:41:58exclamation point WC percentage typing
  6083. 4:42:00this will run the word count command on
  6084. 4:42:02the file the character the percentage
  6085. 4:42:04represents the file currently being
  6086. 4:42:07edited let's get started on using
  6087. 4:42:09external commands saving and closing in
  6088. 4:42:12Vim editor open VI editor by typing VI
  6089. 4:42:16followed by the file name VI opens in
  6090. 4:42:19command mode type I to enter insert mode
  6091. 4:42:23VI's insert mode is displayed type the
  6092. 4:42:26following sentences nobody expects the
  6093. 4:42:29Spanish Inquisition nobody expects the
  6094. 4:42:322020 Revolution to exit insert mode and
  6095. 4:42:35switch to command mode press escape to
  6096. 4:42:37write and quit the file type colon WQ
  6097. 4:42:41the file is updated with the changes and
  6098. 4:42:44closed open VI by typing VI followed by
  6099. 4:42:48the file name to count the words in the
  6100. 4:42:50current file type colon exclamation WC
  6101. 4:42:55percent the word count is displayed
  6102. 4:42:59press enter to continue editing to quit
  6103. 4:43:01if no edits were made in the file type
  6104. 4:43:04colon Q the file is closed open VI by
  6105. 4:43:07typing VI followed by file name to quit
  6106. 4:43:11without saving the file type colon Q
  6107. 4:43:14exclamation the file is closed without
  6108. 4:43:17saving the
  6109. 4:43:21changes the emac editor is a popular
  6110. 4:43:23competitor for Vi unlike VI it does not
  6111. 4:43:26work with modes emac is highly
  6112. 4:43:29customizable and includes a large number
  6113. 4:43:30of features it was initially designed
  6114. 4:43:32for use on a console but was soon
  6115. 4:43:34adopted to work with a guy as well emac
  6116. 4:43:38has many other capabilities other than
  6117. 4:43:40simple text Ting for example it can be
  6118. 4:43:42used for email debugging and many other
  6119. 4:43:44things rather than having different
  6120. 4:43:47modes for command and insert like VI
  6121. 4:43:50emac uses the control and meta or alt or
  6122. 4:43:53Escape keys for special commands here
  6123. 4:43:56you can see some of the most important
  6124. 4:43:58key combinations that are used when
  6125. 4:44:01starting exiting reading and writing
  6126. 4:44:03files in
  6127. 4:44:06emac but emac tutorial is a good place
  6128. 4:44:08to start learning basic commands it's
  6129. 4:44:11available anytime when in emac by simply
  6130. 4:44:14typing control h for help and then the
  6131. 4:44:16letter t for tutorial we will now
  6132. 4:44:20demonstrate some of the operations you
  6133. 4:44:22can do with emac in your daily work so
  6134. 4:44:25first let's get a file to edit so
  6135. 4:44:27working in the TMP directory let's get a
  6136. 4:44:30copy of Etc password and bring it over
  6137. 4:44:34here and then in order to work on it I
  6138. 4:44:37just have to say emac pass and the name
  6139. 4:44:40of the file
  6140. 4:44:42Now the default font here is a little
  6141. 4:44:44small so I'll play a trick and hit
  6142. 4:44:46control and the middle button of the
  6143. 4:44:49mouse to control the size of the
  6144. 4:44:51font and then I'll make the window a
  6145. 4:44:54little
  6146. 4:44:55bigger Okay so we've done that now
  6147. 4:44:58suppose I want to look for a certain
  6148. 4:44:59string let's say FTP I would hit contrl
  6149. 4:45:03s and type in the very bottom window the
  6150. 4:45:07very bottom line here FTP so you can see
  6151. 4:45:10down here and you'll see it brought me
  6152. 4:45:12to
  6153. 4:45:13FTP I'll go back to the beginning of the
  6154. 4:45:15line by hitting control a and then let's
  6155. 4:45:19say I want to change all occurrences of
  6156. 4:45:21the string FTP to something else I hit
  6157. 4:45:24Escape percent Mark and then I'll say
  6158. 4:45:27FTP again on the bottom line and then
  6159. 4:45:31let's just do it backwards in capitals
  6160. 4:45:34PTF and you see I hit space it does the
  6161. 4:45:37first one space it does the second one
  6162. 4:45:41space it does the third one if I had hit
  6163. 4:45:43an exclamation point it would have done
  6164. 4:45:45all of them in the entire
  6165. 4:45:49file suppose I want to remove a a line I
  6166. 4:45:52can just hit contrl K and it's gone
  6167. 4:45:54contrl K is gone again suppose I want to
  6168. 4:45:58remove a range of lines I hit control
  6169. 4:46:01space and then
  6170. 4:46:03I go down a few lines uh with either the
  6171. 4:46:07arrow key or crln I hit contrl w
  6172. 4:46:12and they're gone if I want to move them
  6173. 4:46:14further on in the file I go down a few
  6174. 4:46:17lines and I hit control y for
  6175. 4:46:19yank and they're back in there one nice
  6176. 4:46:23thing I can do with emac is open up
  6177. 4:46:25multiple windows at the same time so let
  6178. 4:46:28me hit crl
  6179. 4:46:30X2 and now I've got two windows and I
  6180. 4:46:33can switch to the bottom window by
  6181. 4:46:35hitting crl XO for other and then I hitr
  6182. 4:46:39XF I can put a different file in that
  6183. 4:46:42buffer so let's say I put in
  6184. 4:46:44ETC
  6185. 4:46:48group okay and once again I'll make the
  6186. 4:46:50font a little bigger by hitting control
  6187. 4:46:52in the middle button on the
  6188. 4:46:54mouse okay and you'll notice the bottom
  6189. 4:46:57line is actually uh right protected so I
  6190. 4:47:01can't really delete anything because it
  6191. 4:47:03belongs to root if I try to delete this
  6192. 4:47:05line it won't let me do it it says
  6193. 4:47:07buffer is read only but in general I if
  6194. 4:47:10I had two files with the same
  6195. 4:47:12permissions I could cut and paste and go
  6196. 4:47:14from one to the other to get back to
  6197. 4:47:17just one I can do control X1 and I have
  6198. 4:47:21only this but if I really wanted the
  6199. 4:47:23other window I could can hit control
  6200. 4:47:25XB and I'm back in the password file if
  6201. 4:47:29I want to rewrite it uh I can hit
  6202. 4:47:31control
  6203. 4:47:33xw contr X control W and that would let
  6204. 4:47:36me write it as a different name so I'll
  6205. 4:47:38say p WD
  6206. 4:47:42revised and it's there if I want to
  6207. 4:47:45terminate the program I sayr
  6208. 4:47:47XS to make sure things have been saved
  6209. 4:47:50and then controll
  6210. 4:47:51XC and I'm done so you can see we used
  6211. 4:47:55the control key quite a bit in neac the
  6212. 4:47:58position most keyboards put it in these
  6213. 4:48:00days is a little unnatural all the way
  6214. 4:48:03at the bottom left or right so veteran
  6215. 4:48:07emac users tend to remap the keyboard so
  6216. 4:48:09that the caps lock key also works as
  6217. 4:48:12control so that's some of the basic
  6218. 4:48:14operations you would do in day-to-day
  6219. 4:48:16use of
  6220. 4:48:23emac you have completed chapter 11 let's
  6221. 4:48:27summarize the key Concepts covered text
  6222. 4:48:30editors rather than word processing
  6223. 4:48:32programs are used quite often in Linux
  6224. 4:48:35for tasks such as creating or modifying
  6225. 4:48:37system configuration files writing
  6226. 4:48:39scripts developing sour code and more
  6227. 4:48:42Nano is an easyto use text based editor
  6228. 4:48:45that utilizes onscreen prompts gedit is
  6229. 4:48:48a graphical editor very similar to
  6230. 4:48:50notepad and windows the vi editor is
  6231. 4:48:53available on all Linux systems and is
  6232. 4:48:55very widely used graphical extension
  6233. 4:48:58versions of VI are widely available as
  6234. 4:49:01well emac is available on all Linux
  6235. 4:49:03systems as a popular alternative to VI
  6236. 4:49:06emac can support both a graphical user
  6237. 4:49:08interface and a text mode interface to
  6238. 4:49:11access the vi tutorial typee Vim tutor
  6239. 4:49:14at a command line window to access the
  6240. 4:49:16emac tutorial typ contrl H in then T
  6241. 4:49:19from within emac VI has three modes
  6242. 4:49:22command insert and line emac has only
  6243. 4:49:26one but requires use of special keys
  6244. 4:49:28such as control and Escape both editors
  6245. 4:49:31use various combinations of key strokes
  6246. 4:49:33to accomplish tasks the learning curve
  6247. 4:49:36to master these can be long but once
  6248. 4:49:39mastered using either editor is
  6249. 4:49:41extremely
  6250. 4:49:45efficient by the end of this chapter you
  6251. 4:49:47should be able to use and configure user
  6252. 4:49:50accounts and user groups use and set
  6253. 4:49:54environment variables use the previous
  6254. 4:49:56shell command
  6255. 4:49:58history use keyboard
  6256. 4:50:00shortcuts use and Define
  6257. 4:50:03aliases use and set file permissions and
  6258. 4:50:06ownership
  6259. 4:50:11as you know Linux is a multi-user
  6260. 4:50:13operating system meaning more than one
  6261. 4:50:16user can log on at the same time to
  6262. 4:50:20identify the current user type who am I
  6263. 4:50:23to list the currently logged on users
  6264. 4:50:25type who giving who the- a option will
  6265. 4:50:28give more detailed
  6266. 4:50:33information in Linux the command shell
  6267. 4:50:36program generally bash uses one or more
  6268. 4:50:39startup files to configure the user
  6269. 4:50:41environment files in the /c directory
  6270. 4:50:44define global settings for all users
  6271. 4:50:47while initialization files in the user's
  6272. 4:50:49home directory can include and or
  6273. 4:50:51override the global settings the startup
  6274. 4:50:54files can do anything the user would
  6275. 4:50:56like to do in every command shell such
  6276. 4:50:59as customizing The Prompt defining
  6277. 4:51:03command line shortcuts and aliases
  6278. 4:51:06setting the default text editor setting
  6279. 4:51:09the path for where to find executable
  6280. 4:51:12Pro or setting the path for where to
  6281. 4:51:14find executable
  6282. 4:51:18programs the standard prescription is
  6283. 4:51:21that when you first log into Linux /c/
  6284. 4:51:24profile is read and evaluated after
  6285. 4:51:27which the following files are searched
  6286. 4:51:29if they exist in this order bash profile
  6287. 4:51:33bash
  6288. 4:51:34loginprofile where the squiggly line/ do
  6289. 4:51:38denotes the user's home directory the
  6290. 4:51:40Linux login shell evaluates whatever
  6291. 4:51:42startup file that it comes across first
  6292. 4:51:45and ignores the rest this means that if
  6293. 4:51:47it finds bash profile it ignores bash
  6294. 4:51:51login and profile different
  6295. 4:51:54distributions may use different startup
  6296. 4:51:56files however every time you create a
  6297. 4:51:59new shell or terminal window you do not
  6298. 4:52:02have to perform a full system login only
  6299. 4:52:05a file name bashrc file is read and
  6300. 4:52:08evaluated although this file is not read
  6301. 4:52:10in evaluated along with the login shell
  6302. 4:52:12most distributions and or users include
  6303. 4:52:15the bashrc file from within one of the
  6304. 4:52:18three user owned startup files most
  6305. 4:52:21commonly users only fiddle with the bash
  6306. 4:52:24RC as it is it is invoked every time a
  6307. 4:52:27new command line shell initiates or
  6308. 4:52:29another program is launched from a
  6309. 4:52:31terminal window while the other files
  6310. 4:52:33are read and executed only when the user
  6311. 4:52:36first logs on to the system recent
  6312. 4:52:39distributions sometimes do not even have
  6313. 4:52:42bash profile and or bash login and some
  6314. 4:52:45just do little more than include bash
  6315. 4:52:52RC you can create customized commands or
  6316. 4:52:55modify the behavior of already existing
  6317. 4:52:57ones by creating aliases most often
  6318. 4:53:01these aliases are placed in your bash RC
  6319. 4:53:03file so they're available to any command
  6320. 4:53:06shell you create on Alias removes an
  6321. 4:53:09alias typ tying Alias with no argument
  6322. 4:53:12will list currently defined
  6323. 4:53:14aliases please note that there should
  6324. 4:53:16not be any spaces on either side of the
  6325. 4:53:19equal sign and the Alias definition
  6326. 4:53:21needs to be placed within either single
  6327. 4:53:24or double quotes if it contains any
  6328. 4:53:30spaces all Linux users are assigned a
  6329. 4:53:33unique user ID uid which is just an
  6330. 4:53:36integer normal users start with a uid of
  6331. 4:53:381,000 or greater Linux uses groups for
  6332. 4:53:41organizing users groups are collections
  6333. 4:53:43of accounts with certain shared
  6334. 4:53:45permissions control of group membership
  6335. 4:53:48is administered through the slcg group
  6336. 4:53:51file which shows a list of groups and
  6337. 4:53:53their members by default every user
  6338. 4:53:56belongs to a default or primary group
  6339. 4:53:58when a user logs in the group membership
  6340. 4:54:00is set for their primary group and all
  6341. 4:54:02the members enjoy the same level of
  6342. 4:54:04access and privilege permissions on
  6343. 4:54:07various files and directories can be
  6344. 4:54:09modified as the group level users also
  6345. 4:54:12have one or more group IDs GID including
  6346. 4:54:16a default one which is the same as the
  6347. 4:54:18user ID these numbers are associated
  6348. 4:54:20with names through the files SLC
  6349. 4:54:23password and slcg group groups are used
  6350. 4:54:26to establish a set of users who have
  6351. 4:54:29common interests for the purpose of
  6352. 4:54:31access rights Privileges and security
  6353. 4:54:34considerations access rights to files
  6354. 4:54:37and devices are granted on the basis of
  6355. 4:54:39the user and the group they belong
  6356. 4:54:44to distributions have straightforward
  6357. 4:54:47graphical interfaces for creating and
  6358. 4:54:49removing users and groups and
  6359. 4:54:52manipulating group membership however
  6360. 4:54:55it's often useful to do it from the
  6361. 4:54:57command line or from within shell
  6362. 4:54:59scripts only the root user can add and
  6363. 4:55:02remove users and groups adding a new
  6364. 4:55:05user is done with user ad and removing
  6365. 4:55:07an existing user is done with user Dell
  6366. 4:55:09and the simplest form and account for
  6367. 4:55:11the new user BJ moose would be done with
  6368. 4:55:14pseudo user ad BJ moose which by default
  6369. 4:55:18sets the home directory to slome BJ
  6370. 4:55:20moose populates it with some basic files
  6371. 4:55:23copied from SLC skll and adds a line to
  6372. 4:55:27the SLC password such as this and sets
  6373. 4:55:31the default shell to /bin/bash removing
  6374. 4:55:34a user account is as easy as typing user
  6375. 4:55:37Dell BJ moose however this will leave
  6376. 4:55:40slh home/ BJ moous directory intact this
  6377. 4:55:43might be useful if it's a temporary
  6378. 4:55:45inactivation to remove the home
  6379. 4:55:47directory while removing the account one
  6380. 4:55:48needs to use the- R option to user Dell
  6381. 4:55:53typing ID with no arguments gives gives
  6382. 4:55:55information about the current user as in
  6383. 4:55:59this ID if given the name of another
  6384. 4:56:02user as an argument ID will report
  6385. 4:56:05information about that other user let's
  6386. 4:56:08get some experience with creating
  6387. 4:56:11modifying and removing a new user
  6388. 4:56:13account we will do this on Ubuntu
  6389. 4:56:161704 there are some variations between
  6390. 4:56:20distributions about what exactly is
  6391. 4:56:22created when a new account is is created
  6392. 4:56:26and exactly which files are there Etc
  6393. 4:56:30this is mostly controlled by a file
  6394. 4:56:32under Etc default user ad appropriately
  6395. 4:56:37named so you can see for example in here
  6396. 4:56:40here the default shell is set to be
  6397. 4:56:42Shell bsh B
  6398. 4:56:45bsh now on some distributions such as
  6399. 4:56:48red hat this file is rather short and
  6400. 4:56:50not very well documented on auntu it's
  6401. 4:56:53rather long so let's create the account
  6402. 4:56:56so Su do uh user ad and I'll say- M to
  6403. 4:57:02make sure it creates a home directory
  6404. 4:57:05some uh some distributions do not do
  6405. 4:57:08that by default
  6406. 4:57:10two does not for instance and neither
  6407. 4:57:11does open Su I'll give the full name to
  6408. 4:57:15be Eric
  6409. 4:57:19dolphy I'll specify the default shell to
  6410. 4:57:22be bin bash with the S
  6411. 4:57:24option and here's the name e d o l p y e
  6412. 4:57:29DOI now I still have to pass a specify a
  6413. 4:57:33password so I'll do that with s do pass
  6414. 4:57:36wde e d o l py
  6415. 4:57:40and then I type
  6416. 4:57:41[Music]
  6417. 4:57:42something and now the accounts exists
  6418. 4:57:45and I can verify that by making sure
  6419. 4:57:48entries were
  6420. 4:57:49made uh in the
  6421. 4:57:53ETC password file and Etc group and
  6422. 4:57:58there we go notice it is now user
  6423. 4:58:011001 remember normal user start at 1,000
  6424. 4:58:05and student is user 1000 and so that's
  6425. 4:58:08appropriate
  6426. 4:58:10and also the other information I
  6427. 4:58:12specified is there such as the full
  6428. 4:58:14username and the shell bin
  6429. 4:58:17bash and the group is set to be
  6430. 4:58:21101 which is the same ID as the user all
  6431. 4:58:24users are created with at least one
  6432. 4:58:26group that has the same number as their
  6433. 4:58:30username now let's actually try to log
  6434. 4:58:32into that account and I'll do that with
  6435. 4:58:35SSH and e d o l py at Local Host
  6436. 4:58:41and I'll give the
  6437. 4:58:44password and I succeeded just fine so
  6438. 4:58:48let's see what's actually in that
  6439. 4:58:51directory and you'll see there isn't
  6440. 4:58:53much but these are files that all new
  6441. 4:58:55users
  6442. 4:58:56get um and let me log out now and that's
  6443. 4:59:00controlled by whatever is in the ETC
  6444. 4:59:03skel directory anything you put in there
  6445. 4:59:07let me uh do the a option anything you
  6446. 4:59:09put in there
  6447. 4:59:10will show up in any new
  6448. 4:59:14users uh
  6449. 4:59:16account so let's just clean up and I'll
  6450. 4:59:19do that with
  6451. 4:59:20user
  6452. 4:59:22d-r uh e
  6453. 4:59:25doy and the r is necessary to make sure
  6454. 4:59:30removes the home
  6455. 4:59:33directory you know I get a warning
  6456. 4:59:35message about uh not having created a m
  6457. 4:59:37spool file that's harmless and if we do
  6458. 4:59:40LSL on home now we see the account is
  6459. 4:59:43gone so we're all cleaned
  6460. 4:59:50up adding a new group is done with group
  6461. 4:59:53AD so you can use pseudo usergroup add a
  6462. 4:59:58new group the group can be removed with
  6463. 5:00:01studo userin group Dell a new group
  6464. 5:00:06adding a user to an already existing
  6465. 5:00:08group is done with user mod for example
  6466. 5:00:11when you would first look at what groups
  6467. 5:00:13the user already belongs
  6468. 5:00:17to and then add the new group pseudo
  6469. 5:00:21userin user- a-g a new group rjs
  6470. 5:00:26squirrel RJ squirrel and then groups RJ
  6471. 5:00:29squirrel will show the new group these
  6472. 5:00:31utilities update the /c/ group as
  6473. 5:00:34necessary make sure you use the- a
  6474. 5:00:37option for aend so as to avoid removing
  6475. 5:00:39r existing groups group mod can be used
  6476. 5:00:42to change group properties such as the
  6477. 5:00:45group ID with the dasg option or name
  6478. 5:00:48with the with the dash in option
  6479. 5:00:51removing a user from the group is
  6480. 5:00:53somewhat trickier the dasg option to
  6481. 5:00:56user mod must give a complete list of
  6482. 5:00:58groups thus if you do
  6483. 5:01:01pseudo user sbin ususer mod DG RJ
  6484. 5:01:06squirrel RJ squirrel and then do groups
  6485. 5:01:09RJ squirrel you'll see that only the RJ
  6486. 5:01:12squirrel group will be
  6487. 5:01:17left the root account is very powerful
  6488. 5:01:20and has full access to the system other
  6489. 5:01:22operating systems often call this the
  6490. 5:01:24administrator account in Linux it's
  6491. 5:01:26often called the super user account you
  6492. 5:01:29must be extremely cautious before
  6493. 5:01:31granting full rot access to a user it's
  6494. 5:01:33rarely if ever Justified external
  6495. 5:01:36attacks often consists of tricks used to
  6496. 5:01:38elevate the root account however you can
  6497. 5:01:40use pseudo to assign more limited
  6498. 5:01:43privileges to user accounts but only do
  6499. 5:01:46it on a temporary basis and only for a
  6500. 5:01:48specific subset of
  6501. 5:01:53commands when assigning elevated
  6502. 5:01:56privileges you can use the command Su
  6503. 5:02:00the switch or substitute user to launch
  6504. 5:02:02a new shelf running as another user you
  6505. 5:02:05must type the password of the user you
  6506. 5:02:07are becoming most often this user is
  6507. 5:02:10root and the new shell allows the use of
  6508. 5:02:13elevated privileges until it's until it
  6509. 5:02:15is exited it's almost always a bad
  6510. 5:02:18practice to use S Su to become root
  6511. 5:02:22resulting errors can include deletion of
  6512. 5:02:24vital files from the system and security
  6513. 5:02:27breaches granting privileges using
  6514. 5:02:30pseudo is less dangerous and is
  6515. 5:02:33preferred by default studo must be
  6516. 5:02:35enabled on a per user basis however some
  6517. 5:02:38distributions such as BTU enable it by
  6518. 5:02:41default for at least one main user or
  6519. 5:02:43give this as an installation
  6520. 5:02:49option to temporarily become the super
  6521. 5:02:52user for a series of commands you can
  6522. 5:02:54type Su and then be prompted for the
  6523. 5:02:57root
  6524. 5:02:58password to execute just one command
  6525. 5:03:01with root privileges type pseudo and
  6526. 5:03:04then the command when the command is
  6527. 5:03:06complete you will return to being a
  6528. 5:03:09normal un privileged user pseudo
  6529. 5:03:12configuration files are stored in the
  6530. 5:03:14/c/ pseudo file and in the SLC sudoers
  6531. 5:03:19DOD directory by default the pseudo s.d
  6532. 5:03:23directory is empty and whenever you talk
  6533. 5:03:26about pseudo in a course or article
  6534. 5:03:29you're basically required to show this
  6535. 5:03:31web comic by
  6536. 5:03:38XKCD and environment variables are
  6537. 5:03:41quantities that have specific values
  6538. 5:03:43which may be utilized by the command
  6539. 5:03:45shell such as bash or other utilities
  6540. 5:03:48and applications some environment
  6541. 5:03:50variables are given preset values by the
  6542. 5:03:53system which can usually be overridden
  6543. 5:03:55While others are set directly by the
  6544. 5:03:57user either at the command line or
  6545. 5:03:59within startup and other scripts an
  6546. 5:04:02environment variable is actually just a
  6547. 5:04:04character string that contains
  6548. 5:04:06information used by one or more
  6549. 5:04:08applications there are a number of ways
  6550. 5:04:11to view the values of currently set
  6551. 5:04:13environment variables one can type set
  6552. 5:04:16EMV or export depending on the state of
  6553. 5:04:19your system set May print out many more
  6554. 5:04:22lines than the other two
  6555. 5:04:27methods by default variables created
  6556. 5:04:29within a script are only available to
  6557. 5:04:31the current shell child processes
  6558. 5:04:34subshells will not have access to values
  6559. 5:04:37that have been set or modified allowing
  6560. 5:04:39child processes to see the values
  6561. 5:04:41requires use of the export
  6562. 5:04:50command you can also set environment
  6563. 5:04:53variables to be fed as a one shot to a
  6564. 5:04:56command as in the following this feeds
  6565. 5:04:59the values of the S dur and kroot
  6566. 5:05:03environment variables to the command
  6567. 5:05:05make modules install
  6568. 5:05:10home is an environment variable that
  6569. 5:05:13represents the home or login directory
  6570. 5:05:16of the user CD without arguments will
  6571. 5:05:18change the current working directory to
  6572. 5:05:20the value of Home note the ti character
  6573. 5:05:24is often used as an abbreviation for
  6574. 5:05:27home thus CD home and CD with utility
  6575. 5:05:31are completely equivalent statements
  6576. 5:05:46path is an ordered list of directories
  6577. 5:05:48the path which is scanned when a command
  6578. 5:05:51is given to find the appropriate program
  6579. 5:05:54or script to run each directory in the
  6580. 5:05:57path is separated by colons a null or
  6581. 5:06:00empty directory name or slash indicates
  6582. 5:06:03the current directory at any given time
  6583. 5:06:05so in this example there is a null
  6584. 5:06:07directory before the first call
  6585. 5:06:10similarly for this there is a null
  6586. 5:06:12directory between path 1 and path 2 to
  6587. 5:06:16prefix a private bin directory to to
  6588. 5:06:19your path you can use this
  6589. 5:06:27command the environment variable shell
  6590. 5:06:30points to the user's default command
  6591. 5:06:33shell the program that is handling
  6592. 5:06:35whatever you type in a command window
  6593. 5:06:37usually bash and it contains the Full
  6594. 5:06:40path name to the
  6595. 5:06:44Shell prompt statement or Ps is used to
  6596. 5:06:47customize your prompt string in your
  6597. 5:06:50terminal Windows to display the
  6598. 5:06:52information you want PS1 is the primary
  6599. 5:06:55prompt variable which controls what your
  6600. 5:06:58command line prompt looks like the
  6601. 5:07:00following special characters can be
  6602. 5:07:03included in
  6603. 5:07:07PS1 they must be surrounded in in single
  6604. 5:07:10quotes when they are used as in this
  6605. 5:07:21example bash keeps track of previously
  6606. 5:07:24entered commands and statements in a
  6607. 5:07:26history buffer you can recall previously
  6608. 5:07:29used commands simply by using the up and
  6609. 5:07:31down cursor keys to view the list of
  6610. 5:07:34previously executed commands you can
  6611. 5:07:36just type history at the command line
  6612. 5:07:40this list of commands is displayed with
  6613. 5:07:42the most recent command appearing last
  6614. 5:07:45in the list this information is stored
  6615. 5:07:47in the sl- bash history if you have
  6616. 5:07:51multiple terminals open the commands
  6617. 5:07:53typed in each session are not saved
  6618. 5:07:55until the session
  6619. 5:07:59terminates several Associated
  6620. 5:08:01environment variables can be used to get
  6621. 5:08:04information about the history pile his
  6622. 5:08:07file is the location of the history file
  6623. 5:08:09his file size is the maximum number of
  6624. 5:08:12lines in the history file default 500
  6625. 5:08:15his size is the maximum number of
  6626. 5:08:17commands in the history file hist
  6627. 5:08:20control is how commands are stored hist
  6628. 5:08:24ignore is which which command lines can
  6629. 5:08:27be unsaved for a complete description of
  6630. 5:08:30the the use of these environment
  6631. 5:08:31variables see the man page and
  6632. 5:08:36Bash there are specific keys to per
  6633. 5:08:39perform various tasks if you want to
  6634. 5:08:42recall a command in the history list but
  6635. 5:08:44do not want to press the arrow key
  6636. 5:08:46repeatedly you can press controlr to do
  6637. 5:08:49a reverse intelligent search as you
  6638. 5:08:51start typing the search goes back in
  6639. 5:08:53reverse order to the First Command that
  6640. 5:08:55matches the letters you have typed by
  6641. 5:08:57typing more successive letters you make
  6642. 5:09:00the match more and more
  6643. 5:09:05specific you can use keyboard shortcuts
  6644. 5:09:07to perform different tasks quick quickly
  6645. 5:09:10this table lists some of these keyboard
  6646. 5:09:12shortcuts and their uses note the case
  6647. 5:09:15of the hot key does not matter meaning
  6648. 5:09:18doing control a is the same as doing
  6649. 5:09:20control capital
  6650. 5:09:27A in Linux and other Unix Bas operating
  6651. 5:09:30systems every file is associated with a
  6652. 5:09:32user who is the owner every file is also
  6653. 5:09:35associated with a group a subset of all
  6654. 5:09:37users which has an interest in the file
  6655. 5:09:40and certain rights or permissions read
  6656. 5:09:42write and execute the following utility
  6657. 5:09:45programs involve user and group
  6658. 5:09:47ownership and permission
  6659. 5:09:56settings files have three kinds of
  6660. 5:09:59permissions read write and execute these
  6661. 5:10:02are generally represented as
  6662. 5:10:05rwx these permissions affect the three
  6663. 5:10:08groups of owners owner user owner group
  6664. 5:10:12and others as a result you have the
  6665. 5:10:15following three groups of three
  6666. 5:10:17permissions there are a number of
  6667. 5:10:19different ways to use CH mod for
  6668. 5:10:21instance to give the owner and others
  6669. 5:10:22execute permission and remove the group
  6670. 5:10:24write permission you can do this where
  6671. 5:10:28the U stands for user or owner o stands
  6672. 5:10:31for other world and G stands for group
  6673. 5:10:35this kind of syntax can be difficult to
  6674. 5:10:37type and remember so what often uses a
  6675. 5:10:39short hand which lets you set all the
  6676. 5:10:42permissions in one step this is done
  6677. 5:10:44with a simple algorithm and a single
  6678. 5:10:47digit suffices to specify all three
  6679. 5:10:49permission bits for each entity this
  6680. 5:10:52digit is the sum of four if read
  6681. 5:10:54permission is desired two if write
  6682. 5:10:56permission is desired one if execute
  6683. 5:10:59permission is is desired so seven means
  6684. 5:11:02read write execute six means read write
  6685. 5:11:05five means read execute when you apply
  6686. 5:11:08this to the the chod command you have to
  6687. 5:11:12give three digits for each degree of
  6688. 5:11:14Freedom such as chod 755 Su
  6689. 5:11:24file now let's see an example of
  6690. 5:11:27changing file ownership using CH own as
  6691. 5:11:30shown in this
  6692. 5:11:32screenshot first we create two empty
  6693. 5:11:35files using
  6694. 5:11:37touch notice it requires pseudo to
  6695. 5:11:39change the owner of file 2 to rout the
  6696. 5:11:42second CH own command changes both owner
  6697. 5:11:44and group at the same time finally only
  6698. 5:11:47the super user can remove the files now
  6699. 5:11:50let's see an example of changing the
  6700. 5:11:52group ownership using
  6701. 5:12:01chgrp you have completed chapter 12
  6702. 5:12:04let's summarize the key Concepts covered
  6703. 5:12:07Linux is a multi user system to find the
  6704. 5:12:11currently logged on users you can use
  6705. 5:12:13the who command to find the current user
  6706. 5:12:16ID you can use the who am I
  6707. 5:12:19command the root account has full access
  6708. 5:12:22to the system it's never sensible to
  6709. 5:12:25Grant full root access to a user you can
  6710. 5:12:28assign root privileges to regular user
  6711. 5:12:30accounts on a temporary basis using the
  6712. 5:12:33pseudo command the shell program or bash
  6713. 5:12:37uses multiple startup files to create
  6714. 5:12:38the user environment each file affects
  6715. 5:12:41the interactive environment in a
  6716. 5:12:43different way
  6717. 5:12:45/c/ profile provides the global
  6718. 5:12:48settings advantages of startup files
  6719. 5:12:50include that they customize the user's
  6720. 5:12:52prompt set the user's terminal type set
  6721. 5:12:55the command line shortcuts and aliases
  6722. 5:12:58and set the default text editor an
  6723. 5:13:01environment variable is a character
  6724. 5:13:03string that contains data used by one or
  6725. 5:13:05more applications the built-in shell
  6726. 5:13:07variables can be customized to suit your
  6727. 5:13:10requirements the history command recalls
  6728. 5:13:13a list of previous commands which can be
  6729. 5:13:16edited and recycled in Linux various
  6730. 5:13:19keyboard shortcuts can be used at the
  6731. 5:13:21command prompt instead of long actual
  6732. 5:13:24commands you can customize commands by
  6733. 5:13:27creating aliases adding an alias to the
  6734. 5:13:31sl. bashrc file will make it available
  6735. 5:13:34for other shells file permissions can be
  6736. 5:13:36changed by typing chod permission in the
  6737. 5:13:39file name file ownership is changed by
  6738. 5:13:42typing CH own then the owner and the
  6739. 5:13:44file name file group ownership is
  6740. 5:13:47changed by typing chgrp then the group
  6741. 5:13:50then the file
  6742. 5:13:54name by the end of this chapter you
  6743. 5:13:56should be able to display and append to
  6744. 5:14:00file contents using cat and Echo edit
  6745. 5:14:03and print file content contents using
  6746. 5:14:05SED and awk search for patterns using GP
  6747. 5:14:10use multiple other utilities for file
  6748. 5:14:12and text
  6749. 5:14:16manipulation irrespective of the role
  6750. 5:14:18you play with Linux such as system
  6751. 5:14:20administrator developer or user you
  6752. 5:14:23often need to browse through and parse
  6753. 5:14:25text files Andor extract data from them
  6754. 5:14:28these are file manipulation operations
  6755. 5:14:31thus it's essential for the Linux user
  6756. 5:14:33to become Adept at performing certain
  6757. 5:14:35operations on files most of the time
  6758. 5:14:38such file manipulation is done at the
  6759. 5:14:40command line which allows users to
  6760. 5:14:42perform tasks more efficiently than
  6761. 5:14:44while using a guey furthermore the
  6762. 5:14:47command line is more suitable for
  6763. 5:14:49automating often executed tasks indeed
  6764. 5:14:52experienced system administrators write
  6765. 5:14:54customized scripts to accomplish such
  6766. 5:14:56repetitive tasks standardized for each
  6767. 5:14:59particular environment we'll discuss
  6768. 5:15:01such scripting later in much detail in
  6769. 5:15:04this section we'll concentrate on
  6770. 5:15:06command line file and text manipulation
  6771. 5:15:08related U
  6772. 5:15:12utilities cat is short for concatenate
  6773. 5:15:16and is one of the most frequently used
  6774. 5:15:18Linux command line utilities it's often
  6775. 5:15:20used to read and print files as well as
  6776. 5:15:22for simply viewing file contents to view
  6777. 5:15:25a file use the following command cat and
  6778. 5:15:28then the file name for example cat
  6779. 5:15:31readme.txt will display the contents of
  6780. 5:15:33readme.txt on the terminal however the
  6781. 5:15:36main purpose of cat is often to combine
  6782. 5:15:39or concatenate multiple files together
  6783. 5:15:42you can perform the actions listed in
  6784. 5:15:45this table using
  6785. 5:15:50cat the TCH command or cat spelled
  6786. 5:15:53backwards prints the lines of a file in
  6787. 5:15:56reverse order each line Remains the Same
  6788. 5:15:58but the order of lines is inverted the
  6789. 5:16:00syntax of TAC is exactly the same as for
  6790. 5:16:02cat as in the
  6791. 5:16:06following cat can be used to read from
  6792. 5:16:08standard input such as the terminal
  6793. 5:16:10window if no files are specified you can
  6794. 5:16:13use the greater than operator to create
  6795. 5:16:15and add new lines to the file and the
  6796. 5:16:17double greater than operator to append
  6797. 5:16:19lines or files to an existing file to
  6798. 5:16:22create a new file at the command prompt
  6799. 5:16:24type cat greater than file name and
  6800. 5:16:27press the enter key this command creates
  6801. 5:16:30a new file and waits for the user to
  6802. 5:16:32edit or enter the text after you finish
  6803. 5:16:35typing the required text press contrl D
  6804. 5:16:38at the beginning of the next line to
  6805. 5:16:39save and exit the
  6806. 5:16:41editing let's demonstrate some of the
  6807. 5:16:44basic operations you can performed with
  6808. 5:16:47the cat utility where the word cat
  6809. 5:16:49stands for concatenate it's typically
  6810. 5:16:53used to copy files combine them Etc so
  6811. 5:16:56first we will need a couple of simple
  6812. 5:16:58text files to play with let's create one
  6813. 5:17:01using a text editor let's say Nano so
  6814. 5:17:04Nano file one.
  6815. 5:17:06text and I will just type in a couple of
  6816. 5:17:13lines actually three lines with a PL one
  6817. 5:17:16at the end I hit contr X for exit I say
  6818. 5:17:20yes I want to save the modified buffer
  6819. 5:17:22and I keep the name so now I can look at
  6820. 5:17:25the the file created with cat so do cat
  6821. 5:17:28file what.
  6822. 5:17:29text perfect now let's create another
  6823. 5:17:32one interactively using cat itself as we
  6824. 5:17:35talked about earlier so I can say cat
  6825. 5:17:39in Direction with eof and I'll put it
  6826. 5:17:42into file 2.
  6827. 5:17:44text and here is a second file with a
  6828. 5:17:49few lines and then I just type eof on a
  6829. 5:17:55line and that closes the input phase and
  6830. 5:17:59I can say c for l2.
  6831. 5:18:03text it's there if I want to see them
  6832. 5:18:06both together I can say C file one. text
  6833. 5:18:10file 2. text I see it combined or I
  6834. 5:18:14could send it into a third file file 3.
  6835. 5:18:18text and then clear the screen I can say
  6836. 5:18:22cat file
  6837. 5:18:233. text and I see they
  6838. 5:18:27combined two files in a third file so
  6839. 5:18:30this is how we use CAD it's an everyday
  6840. 5:18:32operation you rarely do anything that
  6841. 5:18:34much more complicated with it
  6842. 5:18:42system administrators need to work with
  6843. 5:18:44configuration files text files
  6844. 5:18:46documentation files and log files some
  6845. 5:18:49of these files may be larger or become
  6846. 5:18:51quite large as they accumulate data with
  6847. 5:18:53time these files will require both
  6848. 5:18:55viewing and administrative updating in
  6849. 5:18:58this section you will learn how to
  6850. 5:19:00manage such large files for example a
  6851. 5:19:02banking system might maintain one simple
  6852. 5:19:05large log file to record details of all
  6853. 5:19:07of One day's ATM transactions due to a
  6854. 5:19:10security attack or a malfunction the
  6855. 5:19:13administrator might be forced to check
  6856. 5:19:14for some data by navigating within the
  6857. 5:19:17file in such cases directly opening the
  6858. 5:19:20file in an editor will cause issues due
  6859. 5:19:22to high memory utilization as an editor
  6860. 5:19:25will usually try to read the whole file
  6861. 5:19:27into memory first however one can use
  6862. 5:19:30less to view the contents of such a
  6863. 5:19:32large file scrolling up and down Page by
  6864. 5:19:35Page without the system having to place
  6865. 5:19:37the entire file in memory before
  6866. 5:19:39starting this is much faster than using
  6867. 5:19:42a text editor viewing some file can be
  6868. 5:19:45done by typing either of the two
  6869. 5:19:46following commands less sum file or cat
  6870. 5:19:50Su file pipe less by default Man pages
  6871. 5:19:53are sent through the less command you
  6872. 5:19:56may have encountered the older more
  6873. 5:19:57utility which has some basic
  6874. 5:19:59functionality but fewer capabilities I.E
  6875. 5:20:01less is
  6876. 5:20:06more head reads the first few lines of
  6877. 5:20:08each named file Tim by default and
  6878. 5:20:11displays it on standard output you can
  6879. 5:20:13give a different number of lines in an
  6880. 5:20:15option for example if you want to print
  6881. 5:20:18the first five lines from Etc default
  6882. 5:20:21scrub we can use this command head- in
  6883. 5:20:24and then Etc deault scrub you can also
  6884. 5:20:27just do this head- 5 Etc deault
  6885. 5:20:34scrub tail prints the last few lines of
  6886. 5:20:37each named file and displays it on
  6887. 5:20:40standard output by default it's it
  6888. 5:20:42displays the last 10 lines you can give
  6889. 5:20:44a different number of lines as an option
  6890. 5:20:46tail is especially useful when you are
  6891. 5:20:49troubleshooting any issue using log
  6892. 5:20:51files as you probably want to see the
  6893. 5:20:53most recent lines of output for example
  6894. 5:20:56to display the last 15 lines of some
  6895. 5:20:58file. log we can use this command tail
  6896. 5:21:02DN 15 some file that log you can also
  6897. 5:21:05just do this tail -15 some file. log to
  6898. 5:21:10continually monitor new output in a
  6899. 5:21:12growing log file we can do tail-f su
  6900. 5:21:15file. log this command will continuously
  6901. 5:21:18display any new lines of output in some
  6902. 5:21:21file. log as soon as they appear thus it
  6903. 5:21:25enables you to monitor any current
  6904. 5:21:27activity that is being reported and
  6905. 5:21:32recorded it's very common to create and
  6906. 5:21:34then repeatedly edit and or extract
  6907. 5:21:37contents from a file let's learn how to
  6908. 5:21:39use S and awk to easily perform such
  6909. 5:21:43operations note that many Linux users
  6910. 5:21:46and administrators will write scripts
  6911. 5:21:48using comprehensive scripting languages
  6912. 5:21:51such as Python and pearl rather than use
  6913. 5:21:54S and awk and some of other utilities
  6914. 5:21:57we'll discuss later using such utilities
  6915. 5:21:59is certainly fine in most circumstances
  6916. 5:22:02once should always feel free to use the
  6917. 5:22:04tools one is experienced with however
  6918. 5:22:06the utilities that are described here
  6919. 5:22:08are much lighter I.E they use fewer
  6920. 5:22:11system resources and execute faster
  6921. 5:22:14there are situations such as during
  6922. 5:22:16booting the system where a lot of time
  6923. 5:22:18would be wasted using the more
  6924. 5:22:20complicated tools and the system may not
  6925. 5:22:22even be able to run them so the simpler
  6926. 5:22:25tools will always be
  6927. 5:22:30needed SD is a powerful text processing
  6928. 5:22:33tool and is one of the oldest earliest
  6929. 5:22:35and most powerful Unix utilities it's
  6930. 5:22:38used to modify the contents of a file or
  6931. 5:22:40input stream usually placing the
  6932. 5:22:42contents into a new file or output
  6933. 5:22:44stream its name is is an abbreviation
  6934. 5:22:47for stream editor said s can filter text
  6935. 5:22:51as well as perform substitutions in data
  6936. 5:22:54streams data from an input source or
  6937. 5:22:56file is taken and moved to a working
  6938. 5:22:59space the entire list of operations or
  6939. 5:23:02modifications is applied over the data
  6940. 5:23:04in the working space and then final
  6941. 5:23:06contents are moved to the standard
  6942. 5:23:07output space or stream you can invoke
  6943. 5:23:10set or SED using commands like those
  6944. 5:23:13listed in this table the- e option
  6945. 5:23:15allows you to specify multiple editing
  6946. 5:23:18commands simultaneously at the command
  6947. 5:23:20line it's unnecessary if you only have
  6948. 5:23:23one operation invoked now that you know
  6949. 5:23:27that you can perform multiple editing
  6950. 5:23:28and filtering operations with said let's
  6951. 5:23:31explain some of them in more detail the
  6952. 5:23:34table explains some basic operations
  6953. 5:23:36where pattern is the current string and
  6954. 5:23:39replace uncore string is the new
  6955. 5:23:47string let's demonstrate some of the
  6956. 5:23:50most Elementary operations you can
  6957. 5:23:53perform with SCD on a fedora
  6958. 5:23:57system so I have taken the Liberty to
  6959. 5:24:00prepare a simple text file uh before we
  6960. 5:24:04start which looks like this cat INF
  6961. 5:24:06file. text it just says three lines
  6962. 5:24:10indicating their presence suppose I do
  6963. 5:24:14sd- e
  6964. 5:24:17slash and then uh let's say is to
  6965. 5:24:22r on the
  6966. 5:24:24file and the output will go right on
  6967. 5:24:27standard
  6968. 5:24:28out and you see it changed only the
  6969. 5:24:32first instance on every line so I even
  6970. 5:24:35have the instead of this
  6971. 5:24:38um I can make a slight modification to
  6972. 5:24:41the command if I put a g at the end of
  6973. 5:24:45it and you see this time it caught every
  6974. 5:24:49instance I could also
  6975. 5:24:52do something like this uh 1 comma
  6976. 5:24:572s and it only did it on the first and
  6977. 5:25:00the second line but it left the third
  6978. 5:25:02line alone you notice that I don't have
  6979. 5:25:06to use a forward slash I can use many
  6980. 5:25:09other characters so here I'll use a
  6981. 5:25:14colon and it makes no difference what I
  6982. 5:25:17use now there is an option for S to
  6983. 5:25:21change character streams in place on the
  6984. 5:25:24original file but it's a pretty
  6985. 5:25:26dangerous operation to do since you
  6986. 5:25:29destroy the original file so generally
  6987. 5:25:31it's better to send the output into
  6988. 5:25:34another file so I'll do I'll call that
  6989. 5:25:36one out file. text
  6990. 5:25:42oh I forgot to say INF file. text for
  6991. 5:25:46input so it hung so now I can look at
  6992. 5:25:50out file.
  6993. 5:25:54text you see and that's the output and
  6994. 5:25:56if I want to use the diff command to see
  6995. 5:26:00the difference I can do something like
  6996. 5:26:01this diff INF file. text L file. text
  6997. 5:26:09and it shows me the two lines that have
  6998. 5:26:11changed now you can do some pretty
  6999. 5:26:14complicated things with SD when you're
  7000. 5:26:17trying to deal with special characters
  7001. 5:26:19including spaces and question marks and
  7002. 5:26:22stars life being get pretty complicated
  7003. 5:26:26it it is it respects everything in the
  7004. 5:26:29world about what are called regular
  7005. 5:26:32Expressions uh which can look rather
  7006. 5:26:35strange but it's a daily tool that
  7007. 5:26:37system min administrators do to make
  7008. 5:26:39Elementary substitutions and files so
  7009. 5:26:42that's a little bit about
  7010. 5:26:48s awk a is used to extract and then
  7011. 5:26:52print specific contents of a file is
  7012. 5:26:54often used to construct reports it was
  7013. 5:26:56created at Babs in the 1970s and derived
  7014. 5:26:58its name from the last names of its
  7015. 5:27:00authors o has the following features
  7016. 5:27:03it's a powerful utility and interpreted
  7017. 5:27:05programming language it's used to
  7018. 5:27:07manipulate data fil
  7019. 5:27:08and for retrieving and processing text
  7020. 5:27:11it works well with Fields containing a
  7021. 5:27:13single piece of data essentially a
  7022. 5:27:14column and Records a collection of
  7023. 5:27:17fields essentially a line in a file a is
  7024. 5:27:21invoked as shown in this
  7025. 5:27:25example as was said short o commands can
  7026. 5:27:28be specified directly at the command
  7027. 5:27:30line but a more complex script can be
  7028. 5:27:33saved in a file that you can specify
  7029. 5:27:35using the- F
  7030. 5:27:36option the this table explains the basic
  7031. 5:27:39tasks that can be performed using a the
  7032. 5:27:42input file is read one line at a time
  7033. 5:27:43and for each line o matches the given
  7034. 5:27:45pattern in the given order and performs
  7035. 5:27:48the requested action the- F option
  7036. 5:27:50allows you to specify a particular field
  7037. 5:27:53separator character for example the /c/
  7038. 5:27:57password file uses a colon to separate
  7039. 5:27:59the fields so the- F colon option is
  7040. 5:28:02used with the SLC password file the
  7041. 5:28:05command or action in a needs to be
  7042. 5:28:08surrounded with apostrophes or single
  7043. 5:28:10quotes o can be used like the following
  7044. 5:28:13like in this
  7045. 5:28:17example in managing your files you may
  7046. 5:28:20need to perform tasks such as sorting
  7047. 5:28:22data and copying data from one location
  7048. 5:28:25to another Linux provides numerous file
  7049. 5:28:27manipulation utilities that you can use
  7050. 5:28:30while working with text files in this
  7051. 5:28:32section you will learn about the
  7052. 5:28:34following file manipulation programs
  7053. 5:28:37sort unique paste join and split you
  7054. 5:28:42also learn about regular expressions and
  7055. 5:28:45search
  7056. 5:28:48patterns sort is used to rearrange the
  7057. 5:28:52lines of a text file in either ascending
  7058. 5:28:54or descending order according to a sort
  7059. 5:28:57key you can also sort with respect to
  7060. 5:29:00particular fields or columns in a file
  7061. 5:29:02the default sort key is the order of the
  7062. 5:29:04asky characters I.E essentially
  7063. 5:29:07alphabetically sort can be used like
  7064. 5:29:11this when used with the dasu option sort
  7065. 5:29:14checks for Unique values after sorting
  7066. 5:29:16the records or lines it's basically
  7067. 5:29:18equivalent to running unique on the
  7068. 5:29:20output of
  7069. 5:29:24sort unique removes duplicate
  7070. 5:29:26consecutive lines in a text file and
  7071. 5:29:28it's useful for simplifying the text
  7072. 5:29:31display because unique requires that the
  7073. 5:29:34duplicate entries must be consecutive
  7074. 5:29:36one often runs sort for first and then
  7075. 5:29:39pipes output into unique if sort is used
  7076. 5:29:42with the dasu option it can do all this
  7077. 5:29:44in one step to remove duplicate entries
  7078. 5:29:48from multiple files at once use this
  7079. 5:29:51command or you can use do this
  7080. 5:29:54one to count the number of duplicate
  7081. 5:29:56entries use this
  7082. 5:30:02command suppose you have a file that
  7083. 5:30:04contains the full name of all employees
  7084. 5:30:07and another file that list their phone
  7085. 5:30:08numbers and employee IDs you want to
  7086. 5:30:11create a new file that contains all the
  7087. 5:30:12data listed in three columns name
  7088. 5:30:14employee ID and phone number how can you
  7089. 5:30:16do this effectively without investing
  7090. 5:30:18too much time Paste can be used to
  7091. 5:30:20create a single file containing all
  7092. 5:30:23three columns the different columns are
  7093. 5:30:25identified based on delimiters which is
  7094. 5:30:27spacing used to separate two fields for
  7095. 5:30:30example delimiters can be BL a blank
  7096. 5:30:32space a tab or an enter in this image a
  7097. 5:30:35single space is used as a delimiter in
  7098. 5:30:37all files paste accepts the following
  7099. 5:30:41options- D for the delimiters which
  7100. 5:30:44specify a list of delimeters to be used
  7101. 5:30:46instead of tabs for separating
  7102. 5:30:48consecutive values on a single line each
  7103. 5:30:51delimiter is used in turn when the list
  7104. 5:30:53has been exhausted Pace begins again at
  7105. 5:30:56the first delimiter d s which causes
  7106. 5:30:59Pace to appin the data in series rather
  7107. 5:31:02than in parallel that is in a horizontal
  7108. 5:31:04rather than vertical fashion Pace can be
  7109. 5:31:07used to combine Fields such as name or
  7110. 5:31:09phone number from different files as
  7111. 5:31:11well as combin lines from multiple files
  7112. 5:31:14for example line one from file one can
  7113. 5:31:16be combined with line one of file two
  7114. 5:31:19and line two from file one can be
  7115. 5:31:20combined with line two of file two and
  7116. 5:31:23so on to paste contents from two files
  7117. 5:31:26one can do
  7118. 5:31:28this and here's the syntax to use a
  7119. 5:31:31different
  7120. 5:31:31delimiter common delimiters are space
  7121. 5:31:34Tab and comma
  7122. 5:31:38suppose you have two files with with
  7123. 5:31:40similar columns you have saved employees
  7124. 5:31:43phone numbers in two files one with the
  7125. 5:31:45first name and the other with their last
  7126. 5:31:47name you want to combine the files
  7127. 5:31:49without repeating the data of common
  7128. 5:31:52columns how do you achieve this this
  7129. 5:31:54task can be achieved using join which is
  7130. 5:31:57essentially an enhanced version of paste
  7131. 5:32:00it first checks whether the files share
  7132. 5:32:02common fields such as names or phone
  7133. 5:32:04numbers and then joins the lines into
  7134. 5:32:06files based on a common field to combine
  7135. 5:32:09two files on a common field at the
  7136. 5:32:12common prompt type join file one file
  7137. 5:32:14two and press the enter key for example
  7138. 5:32:17the common field I.E it contains the
  7139. 5:32:19same values among the phone book and
  7140. 5:32:22cities files is the phone number and the
  7141. 5:32:25result of joining these two files is
  7142. 5:32:27shown
  7143. 5:32:32here split is used to break up or split
  7144. 5:32:35a file into equal siiz segments for
  7145. 5:32:38easier viewing and manipulation and it's
  7146. 5:32:40generally used only on relatively large
  7147. 5:32:42files by default split breaks up a file
  7148. 5:32:45into 1,000 line segments the original
  7149. 5:32:48file remains unchanged and a set of new
  7150. 5:32:50files with the same name plus added
  7151. 5:32:52prefix is created by default the X
  7152. 5:32:55prefix is added to split a file into
  7153. 5:32:58segments use the command split in file
  7154. 5:33:01to split a file into segments using a
  7155. 5:33:03different prefix use the command split
  7156. 5:33:06in file and then the prefix we will
  7157. 5:33:08apply split to an American English
  7158. 5:33:10dictionary file of over 999,000 lines
  7159. 5:33:13and in this example we've used WC which
  7160. 5:33:16stands for word count that we'll discuss
  7161. 5:33:18shortly to report on the number of lines
  7162. 5:33:20in the file and then you just type this
  7163. 5:33:23this will split the American English
  7164. 5:33:25file into 100 equal siiz segments named
  7165. 5:33:28dictionary XX the last one will of
  7166. 5:33:31course be somewhat
  7167. 5:33:36smaller regular expressions are text
  7168. 5:33:38strings used for matching a specific
  7169. 5:33:41pattern or to search for a specific
  7170. 5:33:43location such as the start or end of a
  7171. 5:33:45line or a word regular Expressions can
  7172. 5:33:48contain both normal characters or
  7173. 5:33:50so-called medic characters such as an
  7174. 5:33:53aster or and then and a dollar sign many
  7175. 5:33:56text editors and utilities such as VI
  7176. 5:33:59said o find and grep work extensively
  7177. 5:34:02with regular Expressions this table
  7178. 5:34:04lists the search patterns and their
  7179. 5:34:06usage
  7180. 5:34:10for example consider the following
  7181. 5:34:11sentence the quick brown fox jumped over
  7182. 5:34:14the lazy dog some of the patterns that
  7183. 5:34:17can be applied to the sentence are shown
  7184. 5:34:26here GP is extensively used as a primary
  7185. 5:34:31text searching tool it scans files for
  7186. 5:34:34specified patterns and it can be used
  7187. 5:34:36with regular Expressions as as well as
  7188. 5:34:38simple strings as shown in this
  7189. 5:34:46table strings is used to extract all
  7190. 5:34:49printable character strings found in a
  7191. 5:34:51file or files given as arguments it's
  7192. 5:34:54useful in locating human readable
  7193. 5:34:56content embedded in binary files for
  7194. 5:34:59text files one can just use GP for
  7195. 5:35:01example to search for the string mycore
  7196. 5:35:03string in a spreadsheet you can use this
  7197. 5:35:05command
  7198. 5:35:08and this screenshot shows a search of a
  7199. 5:35:10number of programs to see which ones
  7200. 5:35:12have GPL licenses of various
  7201. 5:35:21versions in this section you will learn
  7202. 5:35:23about some additional text utilities
  7203. 5:35:26that you can use for performing various
  7204. 5:35:28actions on your Linux files such as
  7205. 5:35:30changing the case of letters or
  7206. 5:35:32determining the count of words lines and
  7207. 5:35:34characters in a file the TR utility ised
  7208. 5:35:37used to translate specified characters
  7209. 5:35:40into other characters or to delete them
  7210. 5:35:42the general syntax is as follows TR
  7211. 5:35:45options set one and set two the items in
  7212. 5:35:48the square brackets are optional TR
  7213. 5:35:51requires at least one argument and
  7214. 5:35:52accepts a maximum of two the first
  7215. 5:35:55designated set one in this example list
  7216. 5:35:58the characters in the text to be
  7217. 5:36:00replaced or removed the second set two
  7218. 5:36:03list the characters that are to be
  7219. 5:36:04substituted for the characters listed in
  7220. 5:36:06the first argument
  7221. 5:36:08sometimes these sets need to be
  7222. 5:36:09surrounded by apostrophes or single
  7223. 5:36:11quotes in order to have the shell ignore
  7224. 5:36:13that they mean something special to the
  7225. 5:36:15Shell it's usually safe and may be
  7226. 5:36:18required to use the single quotes around
  7227. 5:36:21each of the sets as you'll see in these
  7228. 5:36:23examples uh for example suppose you have
  7229. 5:36:26a file named City containing several
  7230. 5:36:28lines of a text in mixed case to
  7231. 5:36:31translate all lowercase characters to
  7232. 5:36:33uppercase at the command prompt type cat
  7233. 5:36:36City pipe TR A- Z A-Z and press enter
  7234. 5:36:54key T takes the output from any command
  7235. 5:36:58and while sending to the standard output
  7236. 5:36:59it also saves it in a file in other
  7237. 5:37:02words it T's the output stream from the
  7238. 5:37:05command one stream is displayed on the
  7239. 5:37:07standard output and the other is saved
  7240. 5:37:09to a file for example to list the
  7241. 5:37:12contents of a directory on the screen
  7242. 5:37:14and save the output to a file at the
  7243. 5:37:17command prompt type ls- lpip T new file
  7244. 5:37:21and press enter key typing cat new file
  7245. 5:37:24will then display the output of ls--
  7246. 5:37:30L WC or word count counts the number of
  7247. 5:37:33lines words and characters in a file or
  7248. 5:37:35a list of files opt are given in this
  7249. 5:37:39table by default all three of these
  7250. 5:37:41options are
  7251. 5:37:46active cut is used for manipulating
  7252. 5:37:49column based files and is designed to
  7253. 5:37:51extract specific columns the default
  7254. 5:37:53column separator is the tab character
  7255. 5:37:56different Eliminator can be given as a
  7256. 5:37:58command option for example to display
  7257. 5:38:01the third column eliminated by a blank
  7258. 5:38:03space at the command prompt Type ls- S
  7259. 5:38:06pipe cut d d double quot space double
  7260. 5:38:08quote then- F3 and then you press the
  7261. 5:38:11enter
  7262. 5:38:14key you have completed chapter 13 let's
  7263. 5:38:17summarize the key Concepts covered the
  7264. 5:38:21command line often allows the users to
  7265. 5:38:23perform tasks more efficiently than the
  7266. 5:38:26guey cat short for concatenate is used
  7267. 5:38:29to read print and combined files Echo
  7268. 5:38:33displays a line of text either on
  7269. 5:38:35standard output or to place in a file
  7270. 5:38:38said is a popular stream editor often
  7271. 5:38:40used to filter and perform substitutions
  7272. 5:38:43on files and Text data streams o is an
  7273. 5:38:46interpretive programming language
  7274. 5:38:48typically used as a data extraction and
  7275. 5:38:51reporting tool sort is used to sort text
  7276. 5:38:55files and output streams in either
  7277. 5:38:57ascending or descending order unique
  7278. 5:39:01eliminates duplicate entries in a text
  7279. 5:39:03file paste combines fields from
  7280. 5:39:06different files it can also extract and
  7281. 5:39:08combine line from multiple sources join
  7282. 5:39:12combines lines from two files based on a
  7283. 5:39:14common field it works only if files
  7284. 5:39:17share a common field split breaks up a
  7285. 5:39:20large file into equal siiz segments
  7286. 5:39:23regular expressions are text strings
  7287. 5:39:24used for pattern matching the pattern
  7288. 5:39:27can be used to search for a specific
  7289. 5:39:28location such as the start or end of a
  7290. 5:39:31line or a word grep searches the text
  7291. 5:39:34files and data streams for patterns and
  7292. 5:39:36can be used with regular Expressions TR
  7293. 5:39:39translates characters copy standard
  7294. 5:39:41input to standard output and handles
  7295. 5:39:43special characters T saves a copy of
  7296. 5:39:47standard output to a file while still
  7297. 5:39:49displaying at the terminal WC for word
  7298. 5:39:52count displays the number of lines words
  7299. 5:39:55and characters in a file or group of
  7300. 5:39:57files cut extracts columns from a file
  7301. 5:40:01less views files a page at a time and
  7302. 5:40:03allows scrolling in both directions head
  7303. 5:40:06displays the first few few lines of a
  7304. 5:40:07file or data stream or standard standard
  7305. 5:40:10output by default it displays 10 lines
  7306. 5:40:13pil displays the last few lines of a
  7307. 5:40:15file or data stream on standard output
  7308. 5:40:18by default it displays 10 lines strings
  7309. 5:40:21extracts printable character strings
  7310. 5:40:23from binary
  7311. 5:40:27files by the end of this chapter you
  7312. 5:40:29should be able to explain basic
  7313. 5:40:31networking Concepts including types of
  7314. 5:40:33networks and addressing issues configure
  7315. 5:40:36Network interace faes and us and use
  7316. 5:40:38basic networking utilities such as if
  7317. 5:40:41config IP ping route and trace route use
  7318. 5:40:45graphical and non-graphical browsers
  7319. 5:40:47such as links w3m Firefox Chrome and
  7320. 5:40:50Epiphany transfer files to and from
  7321. 5:40:52clients and servers using both graphical
  7322. 5:40:54and text mode applications such as
  7323. 5:40:57filezilla FTP SFTP curl and
  7324. 5:41:03wget a network is a group of computers
  7325. 5:41:06and Computing devices connected together
  7326. 5:41:08through communication channels such as
  7327. 5:41:10cables or wireless media the computers
  7328. 5:41:14connected over a network may be located
  7329. 5:41:16in the same geographical area or spread
  7330. 5:41:19across the world a network is used to
  7331. 5:41:23allow the connected devices to
  7332. 5:41:24communicate with each other enable
  7333. 5:41:27multiple users to share devices over the
  7334. 5:41:29network such as music and video servers
  7335. 5:41:32printers and scanners share and manage
  7336. 5:41:36information AC cross computers easily
  7337. 5:41:39most organizations have both an internal
  7338. 5:41:41Network and an internet connection for
  7339. 5:41:43users to communicate with machines and
  7340. 5:41:46people outside the
  7341. 5:41:48organization the internet is the largest
  7342. 5:41:51Network in the world and can be called
  7343. 5:41:53the network of
  7344. 5:41:58networks devices attached to a network
  7345. 5:42:00must have at least one unique Network
  7346. 5:42:03address identifier known as the IP or
  7347. 5:42:06Internet Protocol address the address is
  7348. 5:42:08essential for routing packets of
  7349. 5:42:10information through the network
  7350. 5:42:12exchanging information across the
  7351. 5:42:14network requires using streams of small
  7352. 5:42:17packets Each of which contains a piece
  7353. 5:42:19of the information going from one
  7354. 5:42:21machine to another these packets contain
  7355. 5:42:24data buffers together with headers which
  7356. 5:42:27contain information about where the
  7357. 5:42:29packet is going to and coming from and
  7358. 5:42:32where it fits in the sequence of packets
  7359. 5:42:34that constitute the Stream Network
  7360. 5:42:37Protocols are and software are rather
  7361. 5:42:40complicated due to the diversity of
  7362. 5:42:42machines and operating systems they must
  7363. 5:42:44deal with as well as the fact that even
  7364. 5:42:47very old standards must be
  7365. 5:42:52supported there are two different types
  7366. 5:42:55of IP addresses available IP V4 version
  7367. 5:42:584 and IPv6 version 6 ipv4 is older and
  7368. 5:43:03by far the most widely used while IPv6
  7369. 5:43:05is newer and is designed to get past
  7370. 5:43:07limitations inherent in the older
  7371. 5:43:09standard and furnish many more possible
  7372. 5:43:11addresses ip4 uses 32 bits for addresses
  7373. 5:43:15there are only 4.3 billion unique
  7374. 5:43:18addresses available furthermore many
  7375. 5:43:20addresses are allotted in resered but
  7376. 5:43:22not actually used ipv4 is considered
  7377. 5:43:25inadequate for meeting future needs
  7378. 5:43:27because the number of devices available
  7379. 5:43:28on the global network has increased
  7380. 5:43:30enormously in recent
  7381. 5:43:32years IPv6 uses 128 bits for addresses
  7382. 5:43:37this allows for 3.4 time 10 to the power
  7383. 5:43:40of 38 unique addresses if you have a
  7384. 5:43:43larger network of computers and want to
  7385. 5:43:44add more you may want to move to IPv6
  7386. 5:43:47because it provides more unique
  7387. 5:43:49addresses however it can be complex to
  7388. 5:43:51migrate to IPv6 the two protocols do not
  7389. 5:43:54always interoperate well thus moving
  7390. 5:43:56equipment and addresses to IPv6 require
  7391. 5:44:00significant effort and has not been
  7392. 5:44:02quite as fast as was originally intended
  7393. 5:44:05we'll discuss ipv V4 more than IPv6 as
  7394. 5:44:09you're more likely to deal with it one
  7395. 5:44:11reason ipv4 has not disappeared is there
  7396. 5:44:14are ways to effectively make many more
  7397. 5:44:17addresses available by methods such as
  7398. 5:44:19natat the network address translation
  7399. 5:44:22natat enables sharing one IP address
  7400. 5:44:24among many locally connected computers
  7401. 5:44:26Each of which has a unique address only
  7402. 5:44:28seen on the local network while this is
  7403. 5:44:31used in organizational settings it's
  7404. 5:44:33also used in simple home networks for
  7405. 5:44:36example if you have a router hooked up
  7406. 5:44:38to your internet provider such as a
  7407. 5:44:40cable system it gives you one externally
  7408. 5:44:43visible address but issues each device
  7409. 5:44:46in your home an individual local
  7410. 5:44:52address a 32-bit ipv4 address is divided
  7411. 5:44:56into four 8bit sections called octets so
  7412. 5:45:00here's an example note that octet is
  7413. 5:45:02just another word for bite Network
  7414. 5:45:05addresses are divided into five classes
  7415. 5:45:07a b c d and e classes a B and C are
  7416. 5:45:10classified into two parts Network
  7417. 5:45:12addresses net ID and host address host
  7418. 5:45:15ID the net ID is used to identify the
  7419. 5:45:17network while the host ID is used to
  7420. 5:45:19identify a host in the network class D
  7421. 5:45:22is used for special multicast
  7422. 5:45:24applications information is broadcast to
  7423. 5:45:26multiple computers simultaneously and
  7424. 5:45:29Class E is reserved for future use in
  7425. 5:45:32this section you will learn about
  7426. 5:45:33classes a b and c
  7427. 5:45:38Class A addresses use the first octet of
  7428. 5:45:41an IP address as their net ID and use
  7429. 5:45:44the other three octets as their host ID
  7430. 5:45:47the first bit of the first octet is
  7431. 5:45:49always set to zero so you can only use
  7432. 5:45:51seven bits for Unique Network numbers as
  7433. 5:45:53a result there are a maximum of 126
  7434. 5:45:56Class A networks available not
  7435. 5:45:58surprisingly this was only feasible when
  7436. 5:46:01there were very few unique networks with
  7437. 5:46:03large numbers of hosts as the use of the
  7438. 5:46:06internet expanded classes B and C were
  7439. 5:46:09added in order to accommodate the
  7440. 5:46:11growing the growing demand for
  7441. 5:46:13independent
  7442. 5:46:14networks each class a network can have
  7443. 5:46:17up to 16.7 million unique hosts on its
  7444. 5:46:20Network the range of host addresses is
  7445. 5:46:23from 1.0.0 point0 to 12725 5.
  7446. 5:46:32255.255 class B addresses use the first
  7447. 5:46:35two octets of their IP address as their
  7448. 5:46:38net ID and the last two octets as their
  7449. 5:46:40host ID the first two bits of the first
  7450. 5:46:43octet are always set to Binary 10 so
  7451. 5:46:46there are a maximum of
  7452. 5:46:4816,384 Class B networks the first octet
  7453. 5:46:52of a Class B address has values from 128
  7454. 5:46:55to 191 the introduction of Class B
  7455. 5:46:58networks expanded the number of networks
  7456. 5:47:01but but it soon became clear that a
  7457. 5:47:03further level would be needed each class
  7458. 5:47:05B Network can support a maximum of
  7459. 5:47:1065,536 unique hosts on its Network the
  7460. 5:47:13range of host addresses is from 128.0
  7461. 5:47:16z.0 to
  7462. 5:47:1819125
  7463. 5:47:23255.255 Class C addresses use the first
  7464. 5:47:26three octets of the IP address as their
  7465. 5:47:29net ID in the last OCTA as their host ID
  7466. 5:47:32the first three bits of the first OCTA
  7467. 5:47:34are set to Binary 110 so so almost 2.1
  7468. 5:47:37million Class C networks are available
  7469. 5:47:39the first OCTA of a Class C address has
  7470. 5:47:41values from 19 192 to 223 these are most
  7471. 5:47:46common for smaller networks which don't
  7472. 5:47:48have many unique hosts each class seed
  7473. 5:47:51Network can support up to 256 unique
  7474. 5:47:54hosts the range of host addresses is
  7475. 5:47:57from n2.0 z.0 to 223
  7476. 5:48:08typically a range of IP addresses are
  7477. 5:48:10requested from your internet service
  7478. 5:48:12provider your ISP by your organization's
  7479. 5:48:15network administrator often your choice
  7480. 5:48:18of which class of IP address you are
  7481. 5:48:20given depends on the size of your
  7482. 5:48:21network and expected growth needs if
  7483. 5:48:24natat is an operation such as in a home
  7484. 5:48:27network you only get one externally
  7485. 5:48:29visible address you can assign IP
  7486. 5:48:31addresses to computers over a network
  7487. 5:48:34either manually or dynamically manual
  7488. 5:48:37assignment adds static or never-changing
  7489. 5:48:39addresses to the network dynamically
  7490. 5:48:42assigned addresses can change every time
  7491. 5:48:45you reboot or even more often the
  7492. 5:48:47dynamic host C configuration protocol
  7493. 5:48:50DHCP is used to assign IP
  7494. 5:48:56addresses name resolution is used to
  7495. 5:48:59convert numerical IP address values into
  7496. 5:49:01a human readable format known as the
  7497. 5:49:04host name for example 104.9
  7498. 5:49:0858515 is the numerical IP address that
  7499. 5:49:11refers to the host name white house.gov
  7500. 5:49:14host names are much easier to remember
  7501. 5:49:17given an IP address you can obtain its
  7502. 5:49:19corresponding host name accessing the
  7503. 5:49:21machine over the network becomes easier
  7504. 5:49:24when you can type the host name instead
  7505. 5:49:26of the IP address you can view your
  7506. 5:49:28system's host name simply by typing host
  7507. 5:49:32name with no argument the special host
  7508. 5:49:34name Local Host is associated with the
  7509. 5:49:36address 127.0.0.1 and describes the
  7510. 5:49:40machine you are currently on which
  7511. 5:49:42normally has additional Network related
  7512. 5:49:44IP
  7513. 5:49:48addresses let's get a feel for how the
  7514. 5:49:51domain name server works on a recent
  7515. 5:49:54Ubuntu system so first we need to log
  7516. 5:49:57in and when you log in we'll open up a
  7517. 5:50:00command line terminal because uh we're
  7518. 5:50:02going to do all our operations from the
  7519. 5:50:04command line so I have done that by
  7520. 5:50:07right clicking on the desktop and then
  7521. 5:50:09let me make a bigger
  7522. 5:50:11font I might as well go full screen
  7523. 5:50:14while I'm at it so there are a couple of
  7524. 5:50:17important files on your system one is
  7525. 5:50:20called Etc
  7526. 5:50:25resolve. now on older Linux systems you
  7527. 5:50:29didn't have all this information at the
  7528. 5:50:31top you just had an important thing here
  7529. 5:50:34name server 127 0.053 you more likely to
  7530. 5:50:39find your name server is not a 1271
  7531. 5:50:43which all 127 addresses are on the
  7532. 5:50:45actual machine but 1 192168 that1 that1
  7533. 5:50:50for instance would be a common thing um
  7534. 5:50:54might point to your your wireless modem
  7535. 5:50:57which is attached to your internet
  7536. 5:50:59service provider for instance uh recent
  7537. 5:51:03systems use a system D service called
  7538. 5:51:05system D resolve d which works in a more
  7539. 5:51:08complicated way it makes a DNS server on
  7540. 5:51:13the local machine uh which caches the
  7541. 5:51:15results of previous searches uh so we're
  7542. 5:51:18not going to get into the details of
  7543. 5:51:20that but uh that's a recent development
  7544. 5:51:23that you'll find on newer machines
  7545. 5:51:25another important file is ETC
  7546. 5:51:29hosts this file is consulted before the
  7547. 5:51:32domain name server is consulted so
  7548. 5:51:36you'll see for instance here at the
  7549. 5:51:37bottom we've got two machines on the
  7550. 5:51:39local network we give their IP addresses
  7551. 5:51:42and a name that we can use to get it
  7552. 5:51:44them and you'll notice you can have more
  7553. 5:51:46than one name tied to an IP address so
  7554. 5:51:48for instance I could do ping
  7555. 5:51:52Theodore and that's going to take me to
  7556. 5:51:54200 or I could do ping uh
  7557. 5:51:58Beaver takes me to the same
  7558. 5:52:02machine now if I want to look at
  7559. 5:52:04something which isn't specified in in
  7560. 5:52:06that file or in fact I can do that host
  7561. 5:52:09uh
  7562. 5:52:10Theodore and I will go look at the file
  7563. 5:52:14but if I want to get something out on
  7564. 5:52:15the internet I could do L Linux
  7565. 5:52:18foundation.org
  7566. 5:52:20and I'll get the both the ip4 and the
  7567. 5:52:23ip6 addresses here of the Linux
  7568. 5:52:26foundation and also information about
  7569. 5:52:29the mail services provided by the Linux
  7570. 5:52:32Foundation I can do uh another utility
  7571. 5:52:36for similar information is nslookup so
  7572. 5:52:39I'll do that nslookup foundation.org
  7573. 5:52:42links foundation.org and you see I got
  7574. 5:52:45the same basic information a little more
  7575. 5:52:47compactly I got here's the ip4 address
  7576. 5:52:50and then the two ip6
  7577. 5:52:53addresses another utility I can use is
  7578. 5:52:56dig so let's do dig
  7579. 5:52:58Linux foundation.org
  7580. 5:53:03and you'll see I once again got the
  7581. 5:53:06information about the IP address and
  7582. 5:53:08then a lot more information about the
  7583. 5:53:11search to find that server so that's
  7584. 5:53:13just a little bit of what you can do
  7585. 5:53:15with DNS and some of the files that are
  7586. 5:53:17associated with
  7587. 5:53:22it network configuration files are
  7588. 5:53:25essential to ensure that interfaces
  7589. 5:53:26function correctly they're located in
  7590. 5:53:28the /etc directory tree however the
  7591. 5:53:31exact files used have historically been
  7592. 5:53:33dependent on the particular Linux
  7593. 5:53:36distribution ution and version being
  7594. 5:53:38used for dbn family configurations the
  7595. 5:53:42basic network configuration files could
  7596. 5:53:44be found under slcn Network while for
  7597. 5:53:48red hat and Susi family systems one
  7598. 5:53:51needed to inspect /c/ CYS config Network
  7599. 5:53:54modern systems emphasize the use of
  7600. 5:53:57network manager which we briefly discuss
  7601. 5:54:00when we considered graphical system
  7602. 5:54:02administration rather than keep up with
  7603. 5:54:04all the files in/ Etc while the
  7604. 5:54:07graphical versions of network manager do
  7605. 5:54:09look somewhat different in different
  7606. 5:54:10distributions the nmtui utility shown
  7607. 5:54:14here varies almost not at all as does
  7608. 5:54:18even more sparse NM CLI or command line
  7609. 5:54:20interface utility if you are proficient
  7610. 5:54:22in the use of goys by all means use them
  7611. 5:54:25if you're working on a variety of
  7612. 5:54:27systems the lower level utilities may
  7613. 5:54:29make life
  7614. 5:54:33easier network interfaces are a
  7615. 5:54:35connection Channel between a device and
  7616. 5:54:38a network physically network interfaces
  7617. 5:54:41can proceed through a network interface
  7618. 5:54:43card or it can be more abstractly
  7619. 5:54:46implemented as software you can have
  7620. 5:54:49multiple network interfaces operating at
  7621. 5:54:51once specific interfaces can be brought
  7622. 5:54:54up or activated or brought down
  7623. 5:54:56deactivated at any time information
  7624. 5:54:59about a particular network interface or
  7625. 5:55:02all network interfaces can be reported
  7626. 5:55:04by the IP and if config utilities which
  7627. 5:55:08you may have to run as the super user or
  7628. 5:55:10at least give the full path name I.E SLS
  7629. 5:55:13spin if config IP is newer than if
  7630. 5:55:17config and has far more capabilities but
  7631. 5:55:19its output is uglier to the human eye
  7632. 5:55:21some new Linux distributions do not
  7633. 5:55:23install the older net tools package to
  7634. 5:55:26which if config belongs and so you would
  7635. 5:55:28have to install it if you want to use
  7636. 5:55:32it to view the IP address you can do
  7637. 5:55:36this SLS spin I address show to view the
  7638. 5:55:40routing information slin I rout show IP
  7639. 5:55:45is a very powerful program that can do
  7640. 5:55:47many things older and more specific
  7641. 5:55:50utilities such as if config and Route
  7642. 5:55:52are often used to accomplish similar
  7643. 5:55:54tasks a look at the relevant Man pages
  7644. 5:55:57can tell you much more about these
  7645. 5:56:02utilities ping is used to check whether
  7646. 5:56:05or not a machine attached to the network
  7647. 5:56:07can receive and send data I.E it
  7648. 5:56:10confirms that the remote host is online
  7649. 5:56:13and is responding to check the status of
  7650. 5:56:15the remote host at the command prompt
  7651. 5:56:18type ping and then the host name ping is
  7652. 5:56:21frequently used for Network testing and
  7653. 5:56:24management however its usage can
  7654. 5:56:26increase Network load unacceptably hence
  7655. 5:56:29you can abort the execution of ping by
  7656. 5:56:31typing control C or by using the- C
  7657. 5:56:33option which limits the number of
  7658. 5:56:35packets that ping will send before it
  7659. 5:56:37quits when when an execution stops a
  7660. 5:56:40summary is
  7661. 5:56:44displayed a network requires the
  7662. 5:56:46connection of many nodes data moves from
  7663. 5:56:49source to destination by passing through
  7664. 5:56:51a series of routers and potentially
  7665. 5:56:53across multiple networks servers
  7666. 5:56:55maintain routing tables containing the
  7667. 5:56:58addresses of each node in the network
  7668. 5:57:00the IP routing protocols enable routers
  7669. 5:57:02to build up a forwarding table that
  7670. 5:57:04correlates final destinations with the
  7671. 5:57:06next hop addresses one can use the route
  7672. 5:57:09utility or the newer IP route command to
  7673. 5:57:12view or change IP routing table to add
  7674. 5:57:14delete or modify specific static routes
  7675. 5:57:17to specific hosts or networks this table
  7676. 5:57:20explains some commands that can be used
  7677. 5:57:21to manage IP
  7678. 5:57:31routing trace route is used to inspect
  7679. 5:57:34the route which the data package it
  7680. 5:57:36takes to reach the destination host
  7681. 5:57:39which makes it quite useful for
  7682. 5:57:40troubleshooting Network delays and
  7683. 5:57:42errors by using trace route you can
  7684. 5:57:45isolate connectivity issues between hops
  7685. 5:57:48which helps resolve them faster to print
  7686. 5:57:50the route taken by the packet to reach
  7687. 5:57:52the network host at the command prompt
  7688. 5:57:55type trace route and then the
  7689. 5:58:01address now let's learn about some
  7690. 5:58:03additional networking tools networking
  7691. 5:58:05tool tools are very useful for
  7692. 5:58:07monitoring and debugging network
  7693. 5:58:09problems such as network connectivity
  7694. 5:58:12and network
  7695. 5:58:24traffic let's get started on using more
  7696. 5:58:27networking tools to use more networking
  7697. 5:58:30tools open the command prompt to query
  7698. 5:58:32network interface connected to eth2 type
  7699. 5:58:36pseudo eth tool eth0 and press enter to
  7700. 5:58:41display all active connections and
  7701. 5:58:43routing tables type netstat - R and
  7702. 5:58:47press enter all active connections and
  7703. 5:58:49routing tables are displayed to scan
  7704. 5:58:51open ports on a network type pseudo nmap
  7705. 5:58:56DSP
  7706. 5:58:5810.0.2 do15 sl24 and press enter the
  7707. 5:59:03open ports on a network are displayed
  7708. 5:59:09browsers are used to retrieve transmit
  7709. 5:59:12and explore information resources
  7710. 5:59:14usually on the worldwide web Linux users
  7711. 5:59:17commonly use both graphical and
  7712. 5:59:18non-graphical browser applications the
  7713. 5:59:21common graphical browsers used in Linux
  7714. 5:59:23are Firefox Google Chrome chromium coner
  7715. 5:59:29and Opera sometimes you either do not
  7716. 5:59:31have a graphical environment to work in
  7717. 5:59:34or have reason not to use it but still
  7718. 5:59:36need to access web resources in such a
  7719. 5:59:39case you can use non-graphical browsers
  7720. 5:59:42such as
  7721. 5:59:49these sometimes you need to download
  7722. 5:59:51files and information but a browser is
  7723. 5:59:53not the best choice either because you
  7724. 5:59:55want to download multiple files or you
  7725. 5:59:57want to perform the action from a
  7726. 5:59:59command line or a script WG is a command
  7727. 6:00:02line utility that can capably handle the
  7728. 6:00:05following types of downloads large file
  7729. 6:00:07downloads recursive downloads where a
  7730. 6:00:10web page refers to other web pages and
  7731. 6:00:13all are downloaded at once password
  7732. 6:00:15required downloads and multiple file
  7733. 6:00:18downloads to download a web page you
  7734. 6:00:20simply type WG and then the URL and then
  7735. 6:00:23you can read the downloaded page as a
  7736. 6:00:25local file using a graphical or
  7737. 6:00:27non-graphical
  7738. 6:00:31browser besides downloading you may want
  7739. 6:00:33to obtain information about a URL such
  7740. 6:00:36as the source code being used curl can
  7741. 6:00:39be used from the command line or a
  7742. 6:00:40script to read such information curl
  7743. 6:00:43also allows you to save the contents of
  7744. 6:00:45a web page to a file as does wget you
  7745. 6:00:49can read a URL using curl URL for
  7746. 6:00:52example if you want to read
  7747. 6:00:53freecodecamp.org type curl HTP
  7748. 6:00:57freecodecamp.org it to get the contents
  7749. 6:01:00of a web page and store it to a file
  7750. 6:01:03type curl SL o save HTML and then the
  7751. 6:01:07website address the contents of the main
  7752. 6:01:10index file at the website will be saved
  7753. 6:01:11in save.
  7754. 6:01:16HTML secure shell SSH is a cryptographic
  7755. 6:01:20network protocol used for secure data
  7756. 6:01:22communication it's also used for remote
  7757. 6:01:25services and other secure Services
  7758. 6:01:27between two devices on the network and
  7759. 6:01:29is very useful for administering systems
  7760. 6:01:32which are not easily available to
  7761. 6:01:34physically work on but to which you have
  7762. 6:01:36remote access to log in a remote system
  7763. 6:01:39using your same username you can just
  7764. 6:01:41type SSH some system and press enter SSH
  7765. 6:01:45then prompts you for the remote password
  7766. 6:01:48you can also configure SSH to securely
  7767. 6:01:50allow your remote access without typing
  7768. 6:01:52a password each time if you want to run
  7769. 6:01:56as another user you can do either
  7770. 6:01:58s-l someone some system or SSH someone
  7771. 6:02:02at some system to run a command on a
  7772. 6:02:06remote system via SSH at the command
  7773. 6:02:08primed you type SSH some system my
  7774. 6:02:15command we can also move file securely
  7775. 6:02:18using secure copy SCP between two
  7776. 6:02:22networked hosts SCP uses the SSH
  7777. 6:02:25protocol for transferring data to copy a
  7778. 6:02:28local file to a remote system at the
  7779. 6:02:30command prompt type STP then the local
  7780. 6:02:32file and then the user at the remote
  7781. 6:02:34system cl/ hom user and then you press
  7782. 6:02:37enter you will receive a prompt for the
  7783. 6:02:39remote password you can also configure
  7784. 6:02:42SCP so that it does not prompt for a
  7785. 6:02:44password for each
  7786. 6:02:49transfer let's do a simple demonstration
  7787. 6:02:52of using secure shell and secure copy
  7788. 6:02:56between two virtual
  7789. 6:02:58machines uh Ubuntu machine and a cnos
  7790. 6:03:01machine so first from the Ubuntu machine
  7791. 6:03:04let's try to log into the Centos machine
  7792. 6:03:08well first I need to know the IP address
  7793. 6:03:10of both machines so I can do that with
  7794. 6:03:13IP and I'll say brief to get a condensed
  7795. 6:03:16output um addr for address
  7796. 6:03:20show and I can see my address on this
  7797. 6:03:23machine is
  7798. 6:03:2517216 249
  7799. 6:03:27133 I'll do the same command on this
  7800. 6:03:30Centos machine
  7801. 6:03:37and you see the address is the same
  7802. 6:03:39except for the last bite or octed which
  7803. 6:03:41is 129 so first let's log into the C
  7804. 6:03:44West machine from obuntu I do SSH
  7805. 6:03:48student
  7806. 6:03:50at
  7807. 6:03:5217216
  7808. 6:03:5624929 and it's the first time I'm doing
  7809. 6:03:59this so it wants to make sure that I'm
  7810. 6:04:01authentic so I say
  7811. 6:04:03yes and now I have to give the
  7812. 6:04:08password and it's fine I'm on the Centos
  7813. 6:04:10machine as you can see from The Prompt
  7814. 6:04:13now in that command I really didn't have
  7815. 6:04:15to give student that because we're using
  7816. 6:04:19student count on both machines but never
  7817. 6:04:21hurts to do that so let me
  7818. 6:04:25exit now let's do from the SOS machine
  7819. 6:04:29Let's copy over
  7820. 6:04:31directory using SCP over to the iunu
  7821. 6:04:34machine so let me do SCP R for recursive
  7822. 6:04:39to get the whole directory and
  7823. 6:04:40everything underneath it uh and this
  7824. 6:04:43time uh I won't see home student I'll
  7825. 6:04:47copy the home student directory I won't
  7826. 6:04:49bother saying student ad I'll just give
  7827. 6:04:50the address
  7828. 6:04:5317216
  7829. 6:04:5424913 3 and I'll put it in the temp
  7830. 6:04:58directory once again it wants to make
  7831. 6:05:01sure that it's authentic so I'll say
  7832. 6:05:04yes and once again I have to give the
  7833. 6:05:07password and it's copied over and if I
  7834. 6:05:10go over to the Ubuntu
  7835. 6:05:12machine and I look in the temp
  7836. 6:05:18directory oh see the account is now
  7837. 6:05:20there the directory is now there so
  7838. 6:05:23that's all there is to do a pretty
  7839. 6:05:25simple demonstration of using secure
  7840. 6:05:27shell and secure
  7841. 6:05:34copy you have completed chapter 14 let's
  7842. 6:05:37summarize the key Concepts covered the
  7843. 6:05:40IP or Internet Protocol address is a
  7844. 6:05:43unique logical Network address that is
  7845. 6:05:45assigned to a device on a network ipv4
  7846. 6:05:48uses 32 bits for addresses and IPv6 uses
  7847. 6:05:51128 bits for addresses every IP address
  7848. 6:05:54contains both a network and a host
  7849. 6:05:56address field there are five classes of
  7850. 6:05:59network addresses available a b c d and
  7851. 6:06:02e DNS domain name system is used for
  7852. 6:06:05converting Internet domain and host
  7853. 6:06:07names to IP addresses the if config
  7854. 6:06:11program is used to display current
  7855. 6:06:13Active network interfaces the commands
  7856. 6:06:16IP addr show and IP route show can be
  7857. 6:06:19used to view IP addresses and routing
  7858. 6:06:22information you can use ping to check if
  7859. 6:06:24the remote host is alive and responding
  7860. 6:06:27you can use the route utility program to
  7861. 6:06:30manage IP routing you can monitor and
  7862. 6:06:32debug networking problems using
  7863. 6:06:34networking tools
  7864. 6:06:36Firefox Google Chrome chromium and
  7865. 6:06:38Epiphany are the main graphical browsers
  7866. 6:06:40used in Linux non-graphical or text
  7867. 6:06:44browsers used in Linux are links links
  7868. 6:06:47and
  7869. 6:06:48w3m you can use WG to download web pages
  7870. 6:06:51you can use Curl to obtain information
  7871. 6:06:53about URLs you can use SSH to run
  7872. 6:06:56commands on remote systems we've reached
  7873. 6:06:59the end of the course you should now
  7874. 6:07:01have a good working knowledge of Linux
  7875. 6:07:04from both a graphical and command line
  7876. 6:07:07perspective I mentioned at the beginning
  7877. 6:07:09of the course that there is a text based
  7878. 6:07:11version of this course Linked In the
  7879. 6:07:13video's description that version also
  7880. 6:07:16has sections about the bass shell and
  7881. 6:07:18scripting Printing and local security
  7882. 6:07:21principles those won't be relevant to
  7883. 6:07:23everybody but feel free to check that
  7884. 6:07:25out if you want to learn about those
  7885. 6:07:26topics so good luck as you use and
  7886. 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.