Learn Linux Quickly
上QQ阅读APP看书,第一时间看更新

Preface

Linux is in huge demand in the IT industry as it powers over 90% of the world's supercomputers and servers. Linux is also by far the most popular operating system in the public cloud. Linux is the backbone infrastructure of the world's top companies, like Amazon, Google, IBM, and Paypal. You need to start learning Linux right now! Learn Linux Quickly, First Edition was written over the course of two years, from May 2018 to May 2020. This book implements a modern approach to learning Linux, and you will most definitely get to appreciate its uniqueness and friendly tone.

Who this book is for

If you have always wanted to learn Linux but are still afraid to do so, this book is for you! A lot of people think of Linux as a sophisticated operating system that only hackers and geeks know how to use, and thus they abort their dream of learning Linux. Well, let me surprise you! Linux is simple and easy to learn, and this book is the ultimate proof! You may have stumbled across a variety of sources that all explain Linux in a complicated and dry manner. This book does exactly the opposite; it teaches you Linux in a delightful and friendly way so that you will never get bored, and you will always feel motivated to learn more. Learn Linux Quickly doesn't assume any prior Linux knowledge, which makes it a perfect fit for beginners. Nevertheless, intermediate and advanced Linux users will still find this book very useful as it goes through a wide range of topics.

What this book covers

Chapter 1, Your First Keystrokes. In this introductory chapter, you will learn about the history of Linux and the impact of Linux in today's world and how it may shape the future. You will also learn how to install a Linux virtual machine and run few simple commands.

Chapter 2, Climbing the Tree. In this chapter, you will learn how the Linux filesystem hierarchy is organized and explore various Linux commands that will help you in navigating the Linux directory tree.

Chapter 3, Meet the Editors. Most of what you do on Linux revolves around files! In this chapter, you will learn how to use popular text editors like nano and vi to view and edit Linux files. You will also learn some handy commands that will let you view files from the comfort of your own Terminal!

Chapter 4, Copying, Moving, and Deleting Files. In this chapter, you will learn how to perform various operations on files. You will learn how to copy, move, and delete files. You will also learn how to rename and hide files!

Chapter 5, Read Your Manuals! Let's be honest! You can't memorize all the Linux commands that exist; no one can! That's why in this chapter, you will learn how to utilize and make use of the various Linux help and documentation tools.

Chapter 6, Hard versus Soft Links. In this chapter, you will first understand the concept of a file inode. You will also learn how to create hard and soft links and how they are different from one another.

Chapter 7, Who Is Root? It's time to finally meet the root user! In this chapter, you will understand the limits of regular users, and will also realize how powerful the root user is; you will also learn how to switch between different users on the system.

Chapter 8, Controlling the Population. You can think of Linux as a big powerful country! In this chapter, you will learn how to populate Linux with various users and groups. You will learn how to modify user and group attributes. You will also learn how to change file permissions and ownership.

Chapter 9, Piping and I/O Redirection. In this chapter, you will learn how to use Linux pipes to send output from one command to the input of another command and hence achieve more sophisticated tasks. You will also learn how to do input and output redirection.

Chapter 10Analyzing and Manipulating Files. In this chapter, you will explore an array of Linux commands that will help you in analyzing and manipulating files. You will learn how to view the differences between files, display line count, view file sizes, and much more!

Chapter 11, Let's Play Find and Seek. Don't know where a file is? No worries! In this chapter, you will learn how to use the locate and find command to search for files on your Linux system.

Chapter 12You Got a Package. In this chapter, you will learn how to install, remove, search, and update software on your Linux system. You will understand the software terminology used in Linux, including package, repository, and package management system.

Chapter 13Kill the Process. In this chapter, you will learn how to interact with Linux processes. You will realize the differences between child and parent processes. You will also understand how to run processes in the background. Furthermore, you will learn how to kill processes! 

Chapter 14The Power of Sudo. In this chapter, you will learn how to grant sudo access to users and groups so that they can perform administrative tasks. You will learn how to use the visudo command to edit the sudoers file and you will learn the proper syntax for adding sudo rules.

Chapter 15What's Wrong with the Network? Your network is down! In this chapter, you will learn how to troubleshoot your network connectivity. You will learn how to view your IP address, DNS, Gateway, and Host configuration. Furthermore, you will learn how to restart your network interface.

Chapter 16Bash Scripting Is Fun. In this chapter, you will learn how to create bash scripts. You will learn how to use conditional statements to add intelligence to your bash scripts. Furthermore, you will also learn how to loop and create bash functions.

Chapter 17You Need a Cron Job. Don't want to be tied to your computer 24/7? cron jobs have got you covered! In this chapter, you will learn how to schedule tasks with cron jobs. You will also learn how to schedule one-time jobs with the at utility.

Chapter 18Archiving and Compressing Files. In this chapter, you will learn how to group files into an archive. You will also learn how to use various compression tools to compress your archives and save some disk space.

Chapter 19Create Your Own Commands. Do you want to define your own Linux commands? In this chapter, you will learn how to use aliases to create your own Linux commands. You will also learn how to create temporary and permanent aliases.

Chapter 20Everyone Needs Disk Space. In this chapter, you will learn how to partition your hard disk. You will also learn how to create and mount filesystems. In addition, you will learn how to fix a corrupted filesystem. Moreover, you will learn how to use Linux LVM to create logical volumes.

Chapter 21echo “Goodbye my Friend”. What could your next steps be? Let me give you some suggestions on what to do after reading this book.

To get the most out of this book

The only requirement of this book is basically any computer that works!

If you are using the digital version of this book, we advise you to type the commands and scripts yourself. Doing so will help you avoid any potential errors related to the copying and pasting of commands and scripts.

I am a big believer of the “practice makes perfect” principle. The more you practice with Linux, the more you will get comfortable with it. You can install Linux as your main OS on your computer; this way you get to work with Linux on a daily basis. If that's not an option for you, then why not get a cheap Raspberry Pi and start playing around with it?

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781800566002_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The exit and cd commands are two examples of a shell builtin command."

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

[default]
exten => s,1,Dial(Zap/1|30)
exten => s,2,Voicemail(u100)
exten => s,102,Voicemail(b100)
exten => i,1,Voicemail(s0)

Any command-line input or output is written as follows:

$ mkdir css
$ cd css

Bold: Indicates a new term, an important word, or words that you see onscreen. Here is an example: "The File Name is a part of the inode data structure."

Warnings or important notes appear like this.

Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at customercare@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.