Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Simply Linux: Basics
Simply Linux: Basics
Simply Linux: Basics
Ebook357 pages3 hours

Simply Linux: Basics

Rating: 5 out of 5 stars

5/5

()

Read preview

About this ebook

Simply Linux provides a systematic approach to learning Linux through examples and scripts. The author has taught Linux and UNIX for over 25 years, with more than 35 years of hands-on experience. Simply Linux approaches Linux with the idea that there are two major elements, FILES and PROCESSES. And, that if one can remember five essential commands they will be able to navigate with those commands through the more complex features of the system. The basics of how to use the vi editor are provided, as well as how to setup a productive and secure user environment. The powerful features of regular expressions are described and examples provided. Common commands are discussed before we set up ssh and address network, file, and user management. A chapter is included on updating and installing tools. The appendix provides a number of working scripts. There are internal links throughout the book to allow for easy navigation. The material is presented logically but the sections are independent of each other and can be read in any order. For example, the chapter dealing with ssh precedes networking because it's important to have ssh configured before you connect to remote systems. The chapter on the vi editor precedes configuring the .bashrc because the user will need to know the basics of vi first.

LanguageEnglish
Release dateFeb 19, 2017
ISBN9781370361489
Simply Linux: Basics
Author

John E. Meister, Jr

John Meister is a retired technical specialist and instructor, a Jack of all Trades, master of some.Interests include Biblical prophecy, photography, kayaking (flat water), Linux, and road trips, preferably in a Diesel Jeep.Over his career John has taught: electronics theory, design, troubleshooting and repair; microprocessors and assembly language programming; computer programming and science; systems analysis and design; operating systems (UNIX, Linux, Microsoft, etc.); shell scripting and the vi editor ; web design and HTML; technical writing and career planning; automotive maintenance and repair; and an overview of the Bible.John has held positions in a variety of corporations and industries as a System Administrator, systems analyst, circuit designer, equipment engineer, technical instructor, computer lab manager, adjunct faculty, electronics technician, mechanic, salesman, photographer and technical lead. Some of those companies were: Intel, O'Reilly Media, Boeing Electronics, Boeing Computer Services, Boeing Commercial Airplanes, ITT Tech, AT&T, Western Wireless, T-Mobile, Cingular, Merck, Intermec, City University of Seattle, Georgia Military College, Everett Community College, Prosoft, Develop Intelligence, New Horizons and other training companies nationwide. John served in the US Army Signal Corps attaining the rank of E-6, Staff Sergeant, specialized in the repair, installation and service of secure voice and data encrypted communication systems, served 5 years in Germany, an then as a TSEC/KG-13A instructor at the Signal School at Fort Gordon.As an O'Reilly Media author John created the LPIC-2 Certification exam study video series, released July 2016 - http://shop.oreilly.com/product/0636920050209.doEducation includes:- MSTM - Embry Riddle Aeronautical University- BSc, AA - University of Maryland- AA - Central Texas College- US Army Signal School - 32F/32G/31S/31T- Western Seminary (MDiv CEd - no degree)- Cogswell College North (BSEE - no degree)- Cleveland Institute of Electronics (Advanced Electronics & Troubleshooting)Listed in: Who's Who in Science and Engineering; Who's Who in American Education; Who's Who in America; Who's Who of Emerging Leaders in America; Who's Who Among Young American Professionals; and, Who's Who in the West (since 1987).

Read more from John E. Meister, Jr

Related to Simply Linux

Related ebooks

Computers For You

View More

Related articles

Reviews for Simply Linux

Rating: 5 out of 5 stars
5/5

2 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Simply Linux - John E. Meister, Jr

    (click to see larger version of this ONE PAGE LINUX SUMMARY image on line)

    Simply Linux: BASICS

    Simply Linux provides a systematic approach to learning Linux through examples and scripts. The author has taught Linux and UNIX for over 25 years, with more than 32 years of hands-on experience. Simply Linux approaches Linux with the idea that there are two major elements, FILES and PROCESSES. And, that if one can remember five essential commands they will be able to navigate with those commands through the more complex features of the system. The basics of how to use the vi editor are provided, as well as how to setup a productive and secure user environment. The powerful features of regular expressions are described and examples provided. Common commands are discussed before we set up ssh and address network, file, and user management. A chapter is included on updating and installing tools. The appendix provides a number of working scripts. There are internal links throughout the book to allow for easy navigation. The material is presented logically but the sections are independent of each other and can be read in any order. For example, the chapter dealing with ssh precedes networking because it's important to have ssh configured before you connect to remote systems. The chapter on the vi editor precedes configuring the .bashrc because the user will need to know the basics of vi first.

    Linux Summary

    Linux was created by users that loved the power of command line UNIX, but couldn't afford the commercial operating systems or hardware. Linus Torvalds developed the Linux operating system kernel as a young computer science student in 1991, and retains ownership and control of it, preventing Linux from fragmenting as UNIX did. Richard Stallman and the GNU foundation (GNU is a recursive acronym meaning: "GNU is NOT UNIX") developed many of the tools and utilities that UNIX had, and contributed these Open Source tools to be combined with Linux. Richard refers to Linux as GNU/Linux, which he believes truly identifies the core of what Linux is. Both men, and others, contributed to the free product we are using today.

    The "Revolution OS" is an excellent documentary presenting this unique history: http://en.wikipedia.org/wiki/Revolution_OS

    The creators of UNIX assumed that its users would be computer literate. Little effort was placed into making it accessible to novices. "If you can't understand it, then you don't belong here." - Mike Gancarz, The Unix Philosophy.

    Click on the preceding image for additional information on the UNIX/Linux Philosophy.

    However, Linux has created many help features and tools to aid the regular user, the addition of the --help option to Linux commands is one such aid. Friendly distributions like Linux MINT with the MATE desktop are a superb example of an easy and popular distribution to use. Mint has ranked in the top 10 for years now.

    While there are many distributions of Linux, but they all use the same Linux kernel and set of GNU tools. This may be confusing at first, but it is really a good thing. You have choices on how your system is configured and displayed. In the section Linux Overview and Setup links are provided to help you select a version and configuration.

    Ken Thompson developed the UNIX operating system in PDP-7 Assembly language and then developed the B language, a machine-independent language. Dennis Ritchie developed the C language by modifying B, and with Thompson rewrote the UNIX system in C around 1969. The date function in UNIX starts counting in 1970. It adds time from that point. That's why Y2K wasn't a problem for UNIX. However, the year 2038 is... unless a 64 bit system is used...

    Brian Kernighan was a co-developer of the C programming language, Ritchie being the other. Later ANSI C was developed, the original version often referred to as K&R C for Kernighan and Ritchie. Another researcher at Bell Labs, Bjarne Stroustrop, created the OOP (object oriented programming) version called C++, built up C. See pages 9 and following in

    "A Practical Guide to the UNIX System", Mark G. Sobell, isbn 0-8053-7565-1

    Graphical User Interface (GUI) and Command Line Interface (CLI)

    Linux has a windows based Graphical User Interface (GUI) with free applications, and a Command Line Interface (CLI). You only need a few commands to filter large amounts of data to find that one sliver of information, essentially allowing a Linux user to turn a telephone pole into a toothpick at the command line.

    The command line interface is not a captive user interface, meaning it can be run without user interaction. A series of command line instructions can be placed into a file and run; this is called a script and is extremely useful. The Appendix in this book offers many scripts. The author has been teaching UNIX for over 25 years and finds scripts to be an excellent tool for learning commands. Seeing how the commands are used doing something even mildly interesting seems to work. Some of the scripts have been used to solve serious engineering problems that couldn't be solved through other means.

    A GUI application is a captive user interface, which means it may require user input to continue, often with a graphical interface device, like a mouse. If you are want to exit Microsoft Windows and shut the computer off, you use the mouse, or a series of key strokes to get to a graphic menu, and then locate the command in the menu, or in the pull down, then click the left mouse button when hovering over that menu item, and then it'll ask you if you want to restart, hibernate, sleep, shutdown, or something else before it'll allow you to shut the computer off. It may even ask you if you really want to do that. You are captive to the user interface, hence, CAPTIVE USER INTERFACE.

    The command line version is simple, in the terminal window you could simply type:

    shutdown -h or several other commands that are related, there is always more than one way of executing a task at the command line. It requires understanding of how things work. The flexibility of modern Linux distributions allows the use of captive user interfaces with an icon, menu or shortcut, in addition to the command. But the real power is at the command line.

    The following image summarizes the basics of Linux. The book is organized into 12 chapters based on the grouping of commands in this one page summary. This summary was created after teaching Linux courses for many years and using the commands found listed in the LPIC certification details.

    The first part of the summary includes the real world aspect of any Linux user, the distribution, browser, email and office suite, along with some imaging tools. The Linux desktop is a viable reality. What is even more enjoyable is that even a Mac OS X system uses almost every command and function that Linux does. So if you are a Mac User this book works for you.

    I recently released the book, Let's BASH Windows 10, on how to use the BASH tools on Windows 10. Having BASH within Windows 10, while not completely secure or fully implemented, especially in the areas of networking, it is still a fantastic tool and I encourage any Microsoft Windows 10 user to configure and use BASH just for the use of REGULAR EXPRESSIONS! The commands found in this book were tested on the Ubuntu BASH environment on Win10, with only some limitations noted.

    The Linux one page summary breaks topics into two major areas: FILES and PROCESSES. We also need to be aware of special characters and understanding the importance of things like spaces. SPACES should never be put into file or directory names. It you find files or directory names with space, see the script in the appendix to remove them.

    If you're going to work with any UNIX-like system you need to know the powerful tool called the "vi editor" as it is available at the command line and is on ANY UNIX-like system since 1970. There are other editors, they might offer features you'll like, but vi (or vim - vi improved) is always there and extremely powerful.

    This book will only address the vi editor, and that's all I will teach. After more than 30 years of hands-on UNIX systems experience I still have not mastered or learned all there is to know about the vi editor. It is profoundly powerful. Once we've covered an overview of the vi editor we'll setup our shell environment (.bashrc) and work with commands and regular expressions. Then we'll cover a variety of other commands.

    The appendix contains many scripts that I've created over the years to solve various problems or create web pages or time lapse videos or fix errors found in systems. Scripting is a powerful tool that leverages commands and regular expressions. If you do something more than once, it's a candidate for a script. As you learn more about Linux you'll begin to create your own scripts. The configuration of the .bashrc file will help you record your sessions with a unique History file arrangement. In addition we'll discuss the use of script. An example of its use is seen in an exercise in the Appendix.

    While some of the scripts and commands may seem advanced they are offered to show practical examples. Be aware that there may be minor variations in configurations, distributions and versions, so you need to test scripts and examples on files and directories that are not important to you. Before you begin experimenting it is a good idea to copy critical files to another system or thumb drive. Then create a TEST directory, e.g. mkdir TEST; cd TEST That way you're working in an area that has only things you are working with. In addition, do NOT work as root, neither execute commands with sudo unless you know for sure what you are doing is correct.

    the one page Linux summary

    FILES and PROCESSES

    We can summarize Linux as having two components: FILES and PROCESSES.

    The files contain both the commands and the information used to operate the system.

    A FILE contains information or a program. A program starts a PROCESS.

    A PROCESS is an activity on the computer that manipulates information or creates a FILE.

    A PROCESS is started by a FILE.

    A FILE can be created, managed and manipulated by a PROCESS.

    The following diagram provides a high level system view of Linux and separates the constructs of Processes and Files and associated commands and tools.

    Everything in Linux at the CLI (command line interface) involves working with a FILE or a PROCESS. All of the commands and tools exist on the system as a FILE until run, and then it begins a PROCESS. If you can remember those two components it will help you understand Linux. Even a directory on the hard drive is a FILE.

    The commands we cover in this book allow use to extract or create specific filtered information to use in a PROCESS or write to a FILE.

    This book focuses on the basics of the CLI. If you've found this book, you can already function in the GUI. The section following that will introduce you to the FIVE basic commands that will help you navigate through the shell using the CLI.

    To use a Linux system, you must log into the system. If you have the computer in front of you you'll need an account and password. You will often log into a desktop environment. There are several consoles available in Linux. If the graphical component does not work try one of the command line terminals. (or another number) may get you into a command line window on many Linux systems. may get you into the graphical desktop. YMMV. There are dependencies related to hardware and the installation. Keyboard switches may interfere with this functionality, as will any device that requires a special driver.

    In the graphical desktop there will be icons and menus. To reach the powerful part of Linux, you need to find the Terminal. There are varieties of terminals, depending on the desktop and distribution selected. For now any terminal will work. Once you have a terminal open, pick up this book and begin working with the commands.

    The preceding image illustrates "stdin (keyboard) and stdout" (monitor)

    1) "stdin - standard in" is the keyboard, however in the past it was also paper tape, punched cards, or magnetic tape, the default now is the keyboard.

    2) "stdout - standard out" is where the output of a command goes. Before computer monitors, the standard output was punched cards, paper tape or a printer. By default it now goes to the monitor.

    Using tools in Linux we are also able to use the "stdout of another process as the stdin" for the next. This is done through file redirection and InterProcess Communication (IPC) using the pipe symbol ( | ) between commands. Chaining commands together allows you to solve a complex problem simply. This is one of the reasons why Linux (and UNIX) is so extremely powerful, by having the ability to direct the results of one operation to another without interaction by the computer user. A user can add filters to the command to process the data without having to intervene.

    At the command line in Linux you have the freedom to redefine stdin and stdout. You are able to redirect input or output both ways. We will explain the use of special charactersand how they allow us to work with both FILES and PROCESSES.

    When you redirect stdout to other FILES or PROCESSES, you may use several commands, all on one command line. Examples and an exercise are included later in this book.

    Remember, a PROCESS is an activity on the computer. A PROCESS is started by a FILE. A FILE can be managed and manipulated by a PROCESS. Everything we do in Linux at the CLI is working with a FILE or a PROCESS. All of the commands and tools exist on the system as a FILE until run, and then it begins a PROCESS. In Linux there is directory (also a FILE) that lists the current PROCESES on the system, it is /proc. We will examine the basic file systems in section 10.

    Processes and files - the two major concepts of Linux

    Linux manages its processes and files well.

    Linux can run for years without rebooting or crashing.

    Linux does not require a disk cleanup or disk defragmentation.

    Linux does not require anti-virus software, don't waste money on it.

    Linux does not require frequent patching and rebooting.

    Linux generally does not require a reboot for any patches or updates.

    Linux inherent security is maintained by good user passwords, you are the weakest link.

    Linux generally does not enable or activate convenience features, keeping it secure.

    You control what is available and to whom it is available, keeping it secure.

    Jump back to the Table of Contents

    Linux is primarily COMMAND LINE and not necessarily a GUI (Graphical User Interface),

    Enjoying the preview?
    Page 1 of 1