(This page has no text content)
COMPUTER PROGRAMMING for Beginners 4 Books in 1: LINUX Command-Line for Beginners, Python Programming for Beginners Networking for Beginners, Hacking with Kali Linux Cybersecurity, Wireless, LTE, Networks, and Penetration Testing by Dylan Mach
© Copyright 2020 by Dylan Mach - All rights reserved. The content contained within this book may not be reproduced, duplicated or transmitted without direct written permission from the author or the publisher. Under no circumstances will any blame or legal responsibility be held against the publisher, or author, for any damages, reparation, or monetary loss due to the information contained within this book. Either directly or indirectly. Legal Notice: This book is copyright protected. This book is only for personal use. You cannot amend, distribute, sell, use, quote or paraphrase any part, or the content within this book, without the consent of the author or publisher. Disclaimer Notice: Please note the information contained within this document is for educational and entertainment purposes only. All effort has been executed to present accurate, up to date, and reliable, complete information. No warranties of any kind are declared or implied. Readers acknowledge that the author is not engaging in the rendering of legal, financial, medical or professional advice. The content within this book has been derived from various sources. Please consult a licensed professional before attempting any techniques outlined in this book. By reading this document, the reader agrees that under no circumstances is the author responsible for any losses, direct or indirect, which are incurred as a result of the use of the information contained within this document, including, but not limited to, — errors, omissions, or inaccuracies.
LINUX Command-Line for Beginners A Comprehensive Step-by-Step Starting Guide to Learn Linux from Scratch to Bash Scripting and Shell Programming By Dylan Mach
© Copyright 2019 by Dylan Mach - All rights reserved. The content contained within this book may not be reproduced, duplicated or transmitted without direct written permission from the author or the publisher. Under no circumstances will any blame or legal responsibility be held against the publisher, or author, for any damages, reparation, or monetary loss due to the information contained within this book. Either directly or indirectly. Legal Notice: This book is copyright protected. This book is only for personal use. You cannot amend, distribute, sell, use, quote or paraphrase any part, or the content within this book, without the consent of the author or publisher. Disclaimer Notice: Please note the information contained within this document is for educational and entertainment purposes only. All effort has been executed to present accurate, up to date, and reliable, complete information. No warranties of any kind are declared or implied. Readers acknowledge that the author is not engaging in the rendering of legal, financial, medical or professional advice. The content within this book has been derived from various sources. Please consult a licensed professional before attempting any techniques outlined in this book. By reading this document, the reader agrees that under no circumstances is the author responsible for any losses, direct or indirect, which are incurred as a result of the use of the information contained within this document, including, but not limited to, — errors, omissions, or inaccuracies.
Table of Contents Introduction Chapter 1: What is Linux and Why Using It? What is Linux OS? Why Using Linux? A host of different distributions Linux is the same as freedom Linux is excellent in reliability Linux saves you money You can easily try Linux Linux can run on outdated systems More sophisticated than before Chapter 2: Linux Distributions and Types of Installations Linux distribution for multi-purpose Advanced users best Linux distributions Older computers’ best Linux distributions Best distributions of Linux server Beginners’ best Linux distributions Server Roles and Types of Installations Chapter 3: Introduction to Linux Kernel and Operating System The System Preparation Chapter 4: Installing Linux on Virtual Machine VMware Workstation Player Installation The Importance of Virtual Machine Chapter 5: Linux User Management and System Administration How to Manage Users and Groups as a Linux Administrator Linux Group The File System of Linux Chapter 6: Linux Directory Structures Basic functions of the filesystem Directory Structure of Linux Chapter 7: Working with Disk, Media, and Data Files (gzip – tar) Analyze Disk Space and Hard Disk Partition on Linux with These Commands Linux Data Manipulation
Creating from the Command-line a File for Tar GZip Chapter 8: File, Directory Manager, Permissions, Networking, and SSH SSH Command Chapter 9: Linux Terminals, Editors, and Shell Chapter 10: Basic Linux Shell Commands Shell Commands Other languages Chapter 11: Shell Scripting Features of Shell Scripting Chapter 12: Building Script Errors Chapter 13: Basic Bash Shell Commands Chapter 14: Advanced Bash Shell Commands Conclusion
Introduction Congratulations on purchasing your copy of LINUX Command-Line for Beginners: A Comprehensive Step-By-Step Starting Guide to Learn Linux from Scratch to Bash Scripting and Shell Programming and thank you for doing so. Linux is in virtually everything we use today. If you are a beginner or you are just starting to learn everything about Linux operating system, you will soon realize that downloading this eBook is a smart way into having a clear understanding of the world of Linux as well as several of its distributions. Usually, navigating through the Linux command-line can be quite tricky. In this book, you will see multiple approaches that you can model to have a smooth operation with Linux. Also, certain Linux distributions you can use not only as a beginner but also those that can function if you attempt to use it on your old system. Ultimately, this book takes a step further to analyze basic Linux shell commands as well as shell scripting. To this end, some of the chapters in this book will discuss Linux user management and administration, where it examines some of the duties of Linux system administrator, including handling directories, users extensively, and files, basic bash commands, root, or superuser management, and so much more. Also, this book will discuss Linux file functions as well as defining the three types of Linux file ownership, permissions, and SSH commands. You will learn about other SSH commands, Linux terminals, editors, and shell. With a clear perception of directories, file managers, and editors out of the way, this book will discuss how you can create a file for tar gzip from the command-line, how you can mount and unmounts media, and also Linux data manipulation. On the shelves, there are several books on Linux Command-line, and for making this book your choice, we will like to appreciate the gesture. From our end, we are striving to see that this book provides you with all the practical and necessary information you will need to succeed. Once again, thank you!
Chapter 1: What is Linux and Why Using It? Strengthening almost everything from mobile phones, servers, and PCs, Linux is a standard operating system that people commonly use. Indeed, all over the world, several individuals use Linux in all fields and applications you can imagine. Linux has been around since the 90s. From your TV stick to the fridge and everything, Linux runs everything. And much of the internet has support from Linux. Since the computer operating system has powered several innovations, many scientific breakthroughs have Linux to thank. Even though for decades, Linux has been supplying secure, reliable OS duties, the word “Linux” has no familiarity with the general public. But Linux operating system is everywhere, from enterprise servers to home desktops, home appliances, supercomputers, cars, and smartphones. Everywhere, you will find Linux, and it is on your television, Roku devices, refrigerators, and thermostats. For being one of the stress-free, most secure and reliable operating system available, Linux prides itself as a preferred platform running embedded systems, servers, and desktops all over the world. What is Linux OS? In the first place, what do you understand by an OS or operating system? In a physical computer, the management of the hardware is the duty of the computer code known as the operating system. Between the hardware and software, the operating system exists as a layer. Also, in assembler, communicating with a graphics card or addressing a CPU is not what most people want to know. And what acts as a middleman is an operating system like Windows or Linux. Therefore, Linux, like Mac OS, iOs, and Windows, is an operating system. Essentially, Linux operating system powers Android, which is the most popular platform in the world. The software is likely not to function without the operating system since, as an operating system, Linux manages the communication between the hardware and software. There are so many different pieces that Linux operating system comprises and they are:
Applications – not all the complete array of apps that the desktop environments provide. As such, you can quickly find and install several thousands of software that are high-quality through Linux, typical of macOS and Windows. There are simplicity and centralization in the application installation by most modern Linux distributions. For example, typical of GNOME Software, there is Ubuntu Software Center by Ubuntu Linux that, from one centralized platform, speeds up the discovery and installation of apps among thousands of them for users. Desktop environment – users can interact with this piece. You can choose from several desktop environments like Xfce, KDE, Enlightenment, Pantheon, Mate, Cinnamon, GNOME, and so on. There are built-in applications for each desktop environment, including games, web browsers, configuration tools, and file managers. Graphical server – on your monitor, you will get a graphic display with this subsystem. It is known as X or X-server by many people. Daemons – after logging into the desktop or startup during boot, these are background services such as scheduling, sound, printing, and so on. Init system – user space is bootstrapped by this subsystem, and the control of daemons is in its charge. As such, systemd, as the most controversial, is an init system most widely used. When the bootloader, like Unified Bootloader or GRUB, handles the initial booting, the init system manages the boot process. OS Kernel – kernel can be referred to as a complete piece known as Linux for the management of the peripheral devices, memory, CPU, and the core of the system is the kernel. Bootloader – this software manages the process of the computer boot. It is a splash screen that pops up in the operating system
and soon goes away to boot for most users. OS Shell – the shell is what we use to tell our operating system the things we want it to do. As the command line by many, you use text to instruct the OS. However, the code of command-lines is known by quite a few people. As such, this caused people to stay away from using Linux. The modern distribution of Linux changed this since, just like Windows, Linux will use a desktop. Why Using Linux? Most people ask this question almost all the time. When the OS that ships virtually all servers, laptops, and desktops function correctly, why would anyone bother to learn a wholly different computing environment? The answer to that question will pose another question rather than a response; are you okay with the working of your current operating system? Or are you struggling with license fees, costly repairs, crashes, slowdowns, malware, and viruses? For you, Linux may be the perfect platform if you find yourself struggling with the above. On the planet, right now, the most reliable computer ecosystem is Linux. For a desktop platform, you will have a perfect solution when you combine such the entry’s zero cost with reliability. As there isn’t any payment for server licensing or the software, you can have as many computers as you like to install Linux. Also, you won’t have any requirement to make any payment to access Linux. Besides that, what about having as long as you want, a stress-free, stable operating system if you are not bothered about the zero cost implications? There hasn’t been an issue of viruses, malware, or ransomware by so many people using Linux, both on server platform and desktop, for more than two decades. The thing is, such attacks have no power over Linux. If only the kernel is updated, they are necessary for server reboots. And it may not be entirely out of the ordinary for a Linux server to go for years without being rebooted. You will surely enjoy dependability and stability when recommended updates are strictly followed. Also, our computers have most of the desktop operating systems we use, and changing the operating system is something we rarely probe. What’s more? Learning a new operating system is not what most people are inclined to do. However, here are some of the reasons you need to try out Linux:
A host of different distributions There is variance in the Linux different distributions or editions. Some are for server software, while others are designed for desktop use. And while some are designed with beginners in mind, others have their focus on the advanced users. Most Linux editions otherwise referred to as distributions, use USB drive for installation, an optical disk, or can be downloaded for free. The Linux distributions are quite endless. Though some popular choices are openSUSE and Debian, the default preferences for desktop users are mostly Linux Mint, Arch, and Fedora. Courtesy of Ubuntu Unity, Ubuntu becomes one of the most modern Linux distributions. Through the inclusion of openSUSE, you can get a more traditional Linux look with KDE. Also, it is quite a long list if you are looking for the list of server Linux OS. CentOS, SUSE Enterprise, Ubuntu Server, and Red Hat are some of the most well- known distributions. However, you may need to invest in some money with the use of some Linux server distributions as licensing may be required to use Red Hat. But, quite essential for your business is the support, which you get for your license fee in return. Linux is the same as freedom There is a need to have the definition of an open source as equivalent to Linux. There are a set of principles that any software follows, such as: For any of your modified software, copies will have no restrictions The software distribution will have no limit There will be permission to make any changes needed by you, examine it, as well as study and disassemble the software Irrespective of your goals or motive for running it, the full freedom to run the software Primarily, open-source software does not correlate to a community, and you need to understand that. Linux is built by this community, and Linux enjoys robust maintenance from that community. As such, people made Linux as software for the rest of the world, if you are wondering what Linux is and
what has brought about the popularity of Linux. It is all about this philosophy of open source. Linux is excellent in reliability Since it is quite reliable, for system administrators, life is comfortable with the use of Linux. As such, not every day that you will need to monitor your server, and there are no worries with running it. Also, without impacting the whole Linux OS, you can often restart the separate services because of the way they built Linux. You must rely on a tool called an operating system, going by convention. You can have the game-changing effect of reliability that Linux brings with it if the cost isn’t the most significant factor for you. And what is the biggest benefit of the Linux operating system? The biggest reason to adopt Linux is that Linux has overall immunity to random issues of an operating system as well as malicious software and viruses and also its inherent reliability. Linux saves you money For you to try out Linux, you won’t have to pay anything since Linux has a collaborative and open-source nature. Without licensing payment, it doesn’t matter if you have multiple computers; you can go ahead and have the operating system installed freely on them. For many Linux distributions, whether desktop or server editions, this is simply the situation. For example, just for the software installation on one server, concerning the version of 2012, you will have to part with $1,200 to use the Windows Server of Microsoft. You will have additional client access license charges if you are the type that wants several clients to have access to it. And what about the required licenses for you to run web, Windows-based services, etc.? Contrary to that, there is an inclusion of open-source server software in Linux distributions that comes without any cost. Also, without any payment for licensing, you can make use of several web pages. And with just a few clicks, you can have up and running, an entirely efficient Linux web server. You can easily try Linux Linux is quite simple to try when you are prepared to experiment with it. If you are feeling hesitant, there’s no need for you to have your Windows discarded. You may want to give the preferred operating system a whirl with
a live DVD or drive before installing on the hard drive of your PC on a Linux distribution. You will have to install a flash drive or DVD on a Linux distribution, a bootable system. Then, instead of your drive, have your system configured to boot from that. The fuss and muss are quite minimal as you quickly test-drive some operating systems of Linux, and the primary storage drive you have is safe since it doesn’t touch it. Linux can run on outdated systems A while ago, they have Windows XP tossed to the wolves, and the Windows Vista is swiftly on the brink to the end. However, some outdated PCs and many people rely on them. If you select a lightweight distribution designed for aging PCs, it can breathe a new life into your computer as well as splashes updated OS on your system. For old PCs, you can choose Lubuntu or Puppy Linux. You will also notice that there is nothing stressful concerning the transition. Since they designed it for Windows XP refugees, there is abundance when it comes to accessing Linux alternatives. For the mimic of feel and look of the operating system of Microsoft, which is highly revered, these distributions provide dedicated “Windows XP Modes.” More sophisticated than before The desktop’s fundamental values are what most main Linux distributors follow. So, the established interface of the PC gets the spit-polish from distributions such as Linux Mint and Fedora, while with the Windows 8 disaster, Microsoft enraged the world. People can wrap their head around some Linux distributions if Windows 7 and Windows XP is their preference. It is typical for them to switch to Linux because of the learning curve that they will need to use Windows 8 or Windows 10. There is also a similarity with the Start menu of the long-established Windows with the Start menu of Linux Mint. Most fundamentally, using it with PC hardware, there is an eradication of the widespread incompatibility of Linux, particularly audio components and networking. Even though with Intel’s Secure Boot enabled to have additional steps performed for the installation of Linux on your system, there is a wide range of PC hardware and modern PCs that work with most Linux operating systems. Better yet, to know whether it will work or not before you go ahead with any installation, you can have Linux distributions tested on your system to remember your preference.
There are several compelling reasons you might want to consider to try out Linux on your computer, or at least, give it a hassle-free trial run. And if you are set to go ahead with it, let’s discuss the Linux distributions and how you can push forward and make the proper installation of Linux in the next chapter.
Chapter 2: Linux Distributions and Types of Installations You may have no clear answer if you are asking for the best Linux distributions since, in one way or the other, there are several numbers of Linux distributions, and coming up with an exact amount also can be quite tricky. As some of them appear to be unique, others are simply a clone of one another. Well, that is the beauty of Linux, even if it’s a mess. However, you don’t have to worry because, below, you will find the list of the best Linux distributions even when there are thousands of them around. Since there is always something for everyone, we must categorize these distributions. Linux distribution for multi-purpose For both servers and desktops, as an advanced/beginner-friendly OS, you can utilize some Linux distributions. Thus, you will read below about a separate segment of these distributions, and they are: Debian: As an excellent distribution itself, Debian has its base on Ubuntu. Debian tends to be working correctly for not only the desktop but also the servers. Though by scanning through the official documentation, you can quickly get started, it may not be the ideal operating system for beginners. There are some necessary enhancements and several changes introduced by the recent release of Debian 10 Buster. So, test-drive it for you to see! Manjaro: The Arch Linux provides the source for Manjaro. For newbies, Manjaro makes it quite easy to use Arch Linux even though it is tailored for advanced users. So have no worries. This Linux distribution is indeed beginner-friendly and straightforward. There are a bunch of useful built-in GUI applications, as well as a fantastic user interface. While downloading Manjaro, there’s an option of selecting a desktop environment. For Manjaro, most people have a preference for the KDE desktop. Fedora: The two editions that Fedora provides are separate. It offers for servers and also for laptops/desktops. Those are Fedora Server and Fedora Workstation.
Well, Fedora may be your option if you wish to opt for a user-friendly with a possibility of a learning curve for a snappy desktop OS. Anyways, your server can get a fresh breath of a new life when you choose Fedora if you are looking for an operating system for Linux. Advanced users best Linux distributions First, before you begin your exploration into Linux distributions that are designed for advanced users only, you need to get comfortable troubleshooting your way to resolve issues with the different package commands and managers. Indeed, there will be a need for you to collect specific requirements if you are a professional. However, it will worth your while to check out these distributions if, as a standard user, you have been using Linux for some time. Slackware: Though still delighting in the preference of many people, one of the oldest Linux distributions is Slackware. You may want to consider using Slackware for setting up an ideal environment for yourself if you intend to develop or compile software. Slackware tends to be a fantastic choice for advanced users, even with a significant decrease in the number of developers and users utilizing it. Also, it is believed that Slackware will continue to carry its flagship as one of the best Linux distributions out there with the current news of it getting a Patreon page. Gentoo: Gentoo Linux is quite compulsory for anyone who knows how to compile the source code. Though there is a required necessary technical knowledge to make it work, Gentoo is a lightweight distribution. If you need to know some information about it, you can obtain it through the official handbook. However, to make the most of it might take you a lot of time to figure if you are not sure of what you are doing. Arch Linux: This distribution comes with a huge learning curve even though it is a powerful yet simple distribution. Everything you need may not be installed at a time, much unlike others. You will have to add packages required as you configure the system. Also, without GUI, there are a set of commands you will need to follow when you are installing Arch Linux. Also, it may be quite
essential to have a clear understanding of some critical things to do after you install Arch Linux if you wish to go ahead with the installation. It’s indeed useful to say that there is an active community behind Arch Linux in addition to all the simplicity and versatility. As such, you won’t have any need to worry if you run into a problem. Older computers’ best Linux distributions You can make use of some of the best Linux distributions available if you don’t wish to upgrade your system or have an old one lying around. Here are some of the best distributions you can use for your old computers. Sparky Linux: For low-end systems, based on Debian, Sparky Linux tends to be a perfect Linux distribution. Different users can enjoy several special editions or varieties provided by Sparky Linux, as well as a fast streaming experience. For example, it rolls releases specific to a group of users while offering a stable version with varieties. For gamers, one familiar type for them is the Sparky Linux GameOver since a bunch of pre-installed games is included in it. antiX: As a lightweight Linux distribution and partially responsible for MX Linux, both new and old computers can use antiX. Though working quite correctly, the UI of antiX is not that impressive. Without the need to install it, antiX can be utilized as live CD distribution, and it is based on Debian. For you not to lose settings with every reboot, you can save the settings as opposed to some other distributions. Not only that, using its feature of “Live persistence,” your root directory can also have some changes saved by you. As such, antiX can be your choice if you intend to offer a snappy user experience on old hardware with the use of a live-USB distribution. Bodhi: Though it runs well on older configurations, unlike Ubuntu, it is well on top of Ubuntu that they designed and built Bodhi Linux. As a continuation of the Enlightenment 17 desktop, Bodhi Linux’s Moksha Desktop is its main highlight. The fast and intuitive streaming is the typical experience users will get for using it. On your older systems, you can as well give it a try even though people’s opinion of it is not for personal use.
Solus Budgie: It is an impressive lightweight desktop OS with Solus 4 Fortitude as a recent major release. Desktop environments such as MATE or GNOME are natural for this when you want to opt into them. However, while being light on system resources, as a beginners’ full-fledged Linux distribution, Solus Budgie happens to be one of the favorites of so many people. Puppy Linux: One of the smallest distributions you can see out there is Puppy Linux. If you want your outdated system to have a quick system execution, you can give it a try. With the addition of several new useful features, the user experience has improved over the years. As for some of the lightweight Linux distributions, other options you can try out in this category are Peppermint, Lubuntu, and Linux Lite. Best distributions of Linux server Enterprise support, performance, and stability are all that are essential when it comes to a Linux distributions’ choice for servers. However, you need to pay attention to some of these recommendations, whether the purpose is for something crucial or a web server when installing it. CentOS: For RHEL, you will need to subscribe. Nevertheless, since the sources of Red Hat Linux have been derived from it, RHEL’s community edition is quite similar to CentOS. Also, it is a free and open-source as well. For sometimes now, it tends to be an excellent preference. It is considerably less parallel to the number of hosting providers using it. However, people’s opinion of CentOS is that of a reliable Linux distribution since its software packages are the latest. On several cloud platforms, CentOS images can be found. You can as well decide on the CentOS image that is self-hosted, which it offers if you don’t. SUSE Linux enterprise server: There’s a need to separate this distribution from OpenSuSE, and as such, there’s no need to worry. Maintained by the community, OpenSUSE is an open-source distribution even when everything comes under a standard brand “SUSE.” For cloud-based servers, one of the most popular solutions is the SUSE Linux enterprise server. And to manage your open-source solution and
to get priority support, you may need to go for a subscription. Linux Red Hat: For organizations and businesses, the top-notch platform is the Linux Red Hat. For servers, the highly prevalent range may not be Red hat if we go by the numbers. However, Lenovo, for instance, is among those that have their reliance on RHEL as the primary selection of enterprise users. Technically, there is a correlation between Red Hat and Fedora. And for RHEL to have it on it, anything that Red Hats supports gets tested on Fedora. For you to be sure it will suit your needs, the official documentation of the distribution is worth checking. Ubuntu servers: Your server can get unique options depending on where you want it. Ubuntu Cloud may be the perfect ideal for an optimized solution to run Google Cloud Platform, Azure, AWS, and some others. In either case, you can have it installed on your server if you want to opt for Ubuntu Server packages. However, judging by the number, when it comes to deployment on the cloud, the highly popular Linux distribution is Ubuntu. And unless you have particular requirements, the recommendation will be the LTS editions. As options for a few of the distributions mentioned above, Debian and Fedora are some of the distributions to explore. Beginners’ best Linux distributions This segment deals with a list of distributions that are quite easy to use. Without the requirement of knowing any tips or commands, you can begin using it right away, and there’s no need to dig deeper. Pop!_OS: Computer science professionals or developers will experience an excellent pick by Sytem76 from Pop!_OS. If you are beginning to use Linux, it is also quite a great choice as it is not limited to coders. Though the UI feels smooth and a lot more intuitive, it is based on Ubuntu. Also, it enforces full-disk encryption out of the box in addition to the UI. Zorin OS:
Comments 0
Loading comments...
Reply to Comment
Edit Comment