Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
CompTIA Linux+ Certification Guide
CompTIA Linux+ Certification Guide

CompTIA Linux+ Certification Guide: A comprehensive guide to achieving LX0-103 and LX0-104 certifications with mock exams

eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

CompTIA Linux+ Certification Guide

Configuring the Hardware Settings

This chapter covers viewing interrupts. It focuses on /proc/interrupts, CPU info viewing (/proc/cpuinfo), and viewing the physical memory installed. It also looks at /proc/meminfo, the free command, viewing swap memory, and adding and removing additional swap memory using the dd, mkswap, swapon, and swapoff commands. The raid status (viewing/proc/mdstat) is outlined, as is the /dev devices directory, the /proc virtual directory, the lsmod command and its usage, the modprobe command and its usage, and the lspci command and its usage. The /proc directory is a virtual filesystem that is created upon boot up, which stores various items of hardware information about a system.

Navigating through the various directories and using these commands is very informative, and allows you to retrieve hardware information in a Linux environment.

We will cover the following topics in this chapter:

  • Viewing CPU, RAM, and swap info
  • Interrupts and devices
  • Modules

Viewing CPU, RAM, and swap info

Let's take a look at how we can view CPU, RAM, and swap info on a Linux system.

First, we will focus our attention on gaining information on a CPU, so we will look at the /proc/cpuinfo file. We can garner detailed information about the CPU, ranging from the vendor ID, the CPU family, the model name, the CPU rate in MHZ, its cache size, and the number of cores, to name a few. Here is an excerpt from running the cat command alongside /proc/cpuinfo:

Some more information is given here about the CPU:

From the preceding output, we can see detailed information pertaining to the CPU that we ran the cat /proc/cpuinfo command against.

Next, let's take a look at how we can gather information on the amount of physical memory, the Random Access Memory (RAM), installed in a system. We will focus on two commands: the cat /proc/meminfo and the free commands.

Using the Linux system for demonstration once again, we will look at the output of the cat /proc/meminfo command:

Some more memory usage information is shown in the following screenshot:

From the preceding output, we can see some important fields, namely the first three fields (MemTotal, MemFree, and MemAvailable), which reflect the current status of our physical memory (RAM).

Now let's look at another command, the free command. This command will give us the memory information in a more human-readable format. Using our test Linux system, we will run the free command:

Running the free command on its own yields the preceding results in kilobytes. We can tag some options onto the free command to be even more explicit. Here is a list of options that we can use with the free command, using an Ubuntu distro:

These are some more options that we can pass with the free command on an Ubuntu distro:

Similarly, if we take a look at the main page of the free command on a CentOS 7 distribution, we can see similar options:

Some more options that we can pass with the free command on a CentOS 7 distro are shown in the following screenshot:

Let's try a few of the options with the free command:

The preceding output is by far one of the most commonly used options (-h) with the free command. We can even take it a step further by tagging on the (-g) option to display the total amount of physical memory in gigabytes:

We can even see the low and high memory statistics by using yet another fantastic option, the (-l) option:

In the preceding screenshot, we are not just shown the RAM information, but also our swap memory. This is displayed in the last row. We can use another command if we prefer to see only the swap memory. Here, we can use the swapon command:

Here are some options that can be used with the swapon command from the main page of swapon on an Ubuntu distro:

Some more options that can be passed with the swapon command on an Ubuntu distro are shown in the following screenshot:

Here are some options that can be used with the swapon command from the main page of swapon on a CentOS 7 distro:

Some more options that can be passed with the swapon command on a CentOS 7 distro are shown in the following screenshot:

We can also see swap information from within the /proc directory, specifically in /proc/swaps:

From the preceding output, we can see that the swap space is using the /dev/sda4 partition. Now, if for some reason we run out of physical memory and we have maxed out our swap space, then we can either add more physical memory or add more swap space. So, let's focus on the steps to add more swap space.

We will need to create a blank file using the dd command. Note that you need root access to run this command at the shell:

trainer@trainer-virtual-machine:~$ dd if=/dev/zero of=/root/myswapfile bs=1M count=1024
dd: failed to open '/root/myswapfile': Permission denied
trainer@trainer-virtual-machine:~$

From the preceding output, we can see that we got a Permission denied message, so let's switch to the root and try to rerun that command:

root@trainer-virtual-machine:/home/trainer# dd if=/dev/zero of=/root/myswapfile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 17.0137 s, 63.1 MB/s
root@trainer-virtual-machine:/home/trainer#

There we go; we've just created a swap file using the name myswapfile. Now we need to run the mkswap command and call the swap file that we just created at the shell:

root@trainer-virtual-machine:~# mkswap myswapfile
Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)
no label, UUID=e3b8cc8f-ad94-4df9-8608-c9679e6946bb
root@trainer-virtual-machine:~#

Now, the last step is to turn on the swap file so that the system uses it as needed:

root@trainer-virtual-machine:~# swapon myswapfile
swapon: /root/myswapfile: insecure permissions 0644, 0600 suggested.
root@trainer-virtual-machine:~#

We've got that warning message telling us about insecure permissions. We will discuss permissions in a later chapter. For now, we will continue to use the existing permissions. The last step is to verify that the swap file is indeed available to our system:

root@trainer-virtual-machine:~# swapon
NAME TYPE SIZE USED PRIO
/dev/sda4 partition 5.9G 960K -1
/root/myswapfile file 1024M 0B -2
root@trainer-virtual-machine:~#

And, voila, we now have the newly created swap file at our system's disposal. We can also run the free command, and we will now find that the swap memory has increased by one gigabyte:

root@trainer-virtual-machine:~# free -h
total used free shared buff/cache available
Mem: 1.9G 848M 72M 13M 1.0G 924M
Swap: 6.8G 960K 6.8G
root@trainer-virtual-machine:~#
In order for the changes to be safe upon reboot, you will need to add an entry in /etc/fstab.

Should we no longer want to use a swap file, we can use the swapoff command to remove myswapfile from the swap memory. Here is how we would accomplish this at the shell:

root@trainer-virtual-machine:~# swapoff myswapfile
root@trainer-virtual-machine:~#

Now let's rerun the swapon command followed by the free command to verify that myswapfile is indeed removed from swap usage:

root@trainer-virtual-machine:~# swapon
NAME TYPE SIZE USED PRIO
/dev/sda4 partition 5.9G 1.6M -1
root@trainer-virtual-machine:~# free -h
total used free shared buff/cache available
Mem: 1.9G 931M 133M 17M 917M 845M
Swap: 5.8G 1.6M 5.8G
root@trainer-virtual-machine:~#

As we can see, myswapfile is no longer available for use as swap memory. Here are the options we can use with the swapoff command on an Ubuntu distro:

Some more options that can be passed with the swapoff command are shown in the following screenshot:

Here are the options we can use with the swapoff command on a CentOS 7 distro:

Some more options that can be passed with the swapoff command are shown in the following screenshot:

Left arrow icon Right arrow icon

Key benefits

  • Get a clear understanding of how to achieve Linux+ certification
  • Explore system architecture, Shell scripts, data management, and Linux security
  • Work through practice and mock tests to pass both LX0-103 and LX0-104 exams

Description

The Linux+ certification provides a broad awareness of Linux operating systems, while giving professionals an upper hand in the IT industry. With this certification, you’ll be equipped with the all-important knowledge of installation, operation, administration, and troubleshooting services. This CompTIA Linux+ Certification Guide will give you an overview of the system architecture. You’ll understand how to install and uninstall Linux distributions, followed by working with various package managers. You’ll then move on to manipulating files and processes at the command-line interface (CLI) and creating, monitoring, killing, restarting, and modifying processes. As you progress, you’ll be equipped to work with display managers and learn how you can create, modify, and remove user accounts and groups, as well as understand how to automate tasks. The last set of chapters will help you configure dates and set up local and remote system logging. In addition to this, you’ll explore different internet protocols, and delve into network configuration, security administration, Shell scripting, and SQL management. By the end of this book, you’ll not only have got to grips with all the modules you need to study for the LX0-103 and LX0-104 certification exams, but you’ll also be able to test your understanding with practice questions and mock exams.

Who is this book for?

This book is for you if you want to gain the CompTIA Linux+ certification. You’ll also find this guide useful if you’re a system administrator or rookie Linux professional interested in enhancing your Linux and Shell scripting skills. No prior knowledge of Linux is needed, although some understanding of Shell scripting would be helpful.

What you will learn

  • Understand the Linux system architecture
  • Install, upgrade, and manage Linux system packages
  • Configure devices and maintain the Linux filesystem
  • Learn to write Shell scripts and manage data
  • Set user interfaces and desktops in the Linux operating system
  • Automate system admin tasks and manage essential system services
  • Manage SQL server on Linux and log locally and remotely with rsyslogd
  • Administer network and local security

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 26, 2018
Length: 590 pages
Edition : 1st
Language : English
ISBN-13 : 9781789344493
Vendor :
CompTIA
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 26, 2018
Length: 590 pages
Edition : 1st
Language : English
ISBN-13 : 9781789344493
Vendor :
CompTIA
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 87.97
CompTIA Project+ Certification Guide
€29.99
CompTIA Security+ Certification Guide
€24.99
CompTIA Linux+ Certification Guide
€32.99
Total 87.97 Stars icon
Banner background image

Table of Contents

22 Chapters
Configuring the Hardware Settings Chevron down icon Chevron up icon
Booting the System Chevron down icon Chevron up icon
Changing Runlevels and Boot Targets Chevron down icon Chevron up icon
Designing a Hard Disk Layout Chevron down icon Chevron up icon
Installing a Linux Distribution Chevron down icon Chevron up icon
Using Debian Package Management Chevron down icon Chevron up icon
Using YUM Package Management Chevron down icon Chevron up icon
Performing File Management Chevron down icon Chevron up icon
Creating, Monitoring, Killing, and Restarting Processes Chevron down icon Chevron up icon
Modifying Process Execution Chevron down icon Chevron up icon
Display Managers Chevron down icon Chevron up icon
Managing User and Group Accounts Chevron down icon Chevron up icon
Automating Tasks Chevron down icon Chevron up icon
Maintaining System Time and Logging Chevron down icon Chevron up icon
Fundamentals of Internet Protocol Chevron down icon Chevron up icon
Network Configuration and Troubleshooting Chevron down icon Chevron up icon
Performing Administrative Security Tasks Chevron down icon Chevron up icon
Shell Scripting and SQL Data Management Chevron down icon Chevron up icon
Mock Exam - 1 Chevron down icon Chevron up icon
Mock Exam - 2 Chevron down icon Chevron up icon
Assessment Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.7
(10 Ratings)
5 star 40%
4 star 0%
3 star 0%
2 star 10%
1 star 50%
Filter icon Filter
Top Reviews

Filter reviews by




TCAW Jun 15, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Yo uso este libro como referencia y me sirve de mucho para ese fin. Probablemente bastaría para aprender Linux si se lee y pone en práctica de principio a fin, pero creo que hay maneras más rápidas de aprender a usar ese sistema operativo. De todas formas, es muy completo y se puede seguir bien.
Amazon Verified review Amazon
Adrian Grant Dec 11, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
After going through this book, I've gained more appreciation for Linux.Particularly in dealing with multiboot environments, working with the various boot loaders.Once I started going through the chapters, I found them to cover the current Linux+ exams (LX0-103 & LX0104).This in turn increased my confidence with the various Linux distributions which is ideal for me in my exam preparations. I would highly recommend this book for system admins and network admins looking to get up to speed in Linux and for those newbies like myself preparing for the CompTIA Linux+ certification.
Amazon Verified review Amazon
Jose L. Jan 16, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The author did good, brief, and view of examples for all the processes. This the best I have ever seen for studying for an exam.
Amazon Verified review Amazon
Reeaz Shaw Dec 12, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very useful. I recommend it to anyone who plans to sit the LX0-103 and LX0-104 exams
Amazon Verified review Amazon
DavidSTippit001 Mar 09, 2019
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Book is more of just a list of commands not set up as a teaching course with objectives
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.