Docsity

linux command line, Notas de estudo de Engenharia Elétrica

Toggle sidebar
bg1
www.apress.com
Beginning the
Linux Command
Line
Learn how to put the command line to
work to manage fi les, administer users
and groups, install new soft ware, run
network services, and create basic
shell scripts.
—
Second Edition
—
Sander van Vugt
Beginning the Linux Command Line
FOR PROFESSIONALS BY PROFESSIONALS®THE EXPERT’S VOICE® IN LINUX
This is Linux for those of us who don’t mind typing. All Linux users and administrators tend
to like the flexibility and speed of Linux administration from the command line in byte –sized
chunks, instead of fairl y standard graphical user interfaces. B eginning the Linux Command Line
is verified against all of the most important Linux distributions, and follows a task–oriented
approach which is distribution agnostic. This Second Edition of Beginning the Linux Command
Line updates to the very latest versions of the Linux Operat ing System, including the new Btr fs
file system and its management, and systemd-boot pr ocedure and firewall management with
firewalld!
Readers will discover how to:
• Work with files and directories
• Administer users and securit y
• Find help from in–system resources
• Find the right command for the task you have to accomplish
• Work with text editors and intelligent filters
• Use Shell Programming
• Manage partitions and f ile systems
• Confi gure access to hardware devices
9781430 268307
54499
ISBN 978-1-4302-6830-7 US $44.99
Shelve in
Linux/General
User level
Beginning–Intermediate
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Pré-visualização parcial do texto

Baixe linux command line e outras Notas de estudo em PDF para Engenharia Elétrica, somente na Docsity!

Beginning the

Linux Command

Line

Learn how to put the command line to

work to manage files, administer users

and groups, install new software, run

network services, and create basic

shell scripts.

Second Edition

Sander van Vugt

T HE E X PER T ’S VOICE® IN L INU X

Beginning the Linux

Command Line

Second Edition

Sander van Vugt

This book is dedicated to Florence. Your love is making me invincible.

v

Contents at a Glance

About the Author ����������������������������������������������������������������������������������������������������xix

viii

ix

xi

xii

xiv

xv

xvii

■ Contents

■Appendix A: Installing Linux ������������������������������������������������������������������������������ 361

Installation Requirements �������������������������������������������������������������������������������������������� 361

Installing CentOS �������������������������������������������������������������������������������������������������������������������������������� 361 Installing Ubuntu Server ��������������������������������������������������������������������������������������������������������������������� 369

Index ��������������������������������������������������������������������������������������������������������������������� 383

xix

About the Author

Sander van Vugt is a Linux expert working from the Netherlands as an author, technical trainer, and consultant for clients around the world. Sander has published several books about different Linux distributions and is a regular contributor to major international Linux-related web sites. As a consultant, he is specialized in Linux high availability and performance optimization. As a technical trainer, Sander is an authorized trainer for SUSE Linux Enterprise Server and Red Hat Enterprise Linux. More information about the author can be found at his web site at www.sandervanvugt.com.

Chapter 1

Starting Linux Command-Line

Administration

To unleash the full power of Linux, as a Linux administrator you will spend most of your time typing commands on the Linux command line, the so-called shell prompt. For someone who is new to the command line, the things that advanced users do there may look like magic. In this chapter, you’ll learn about the following topics:

  • History of the Linux operating system
  • What is open source?
  • What are distributions?
  • Logging in to Linux
  • Command basics: working with commands, options, and arguments
  • Using piping and redirection
  • Getting help with --help and man
  • Working with the shell

Linux Distributions For someone new to Linux, the operating system may appear a little bit strange. Due to its open source character, there are different versions (the so-called distributions) of Linux. After some Linux history, this chapter teaches you about the differences and similarities between these distributions so that you’ll be able to pick the Linux distribution that fits your needs in the best possible way.

Linux History

Linux started around 1991 all because the Finnish student Linus Torvalds wasn’t too happy with Minix, the educational version of the UNIX operating system that he had to work with at the University of Helsinki. In particular, the ability of the kernel (which is the heart of the operating system) of this Minix distribution didn’t please him much. He decided to create a better kernel and gave it the name Linux. Possibly the smartest thing that Torvalds did when starting his initiative was deciding not to do it alone. To find other people who wanted to work with him, he posted a message on Usenet, a major social media platform in those days that could be used to exchange information with other people and get help from other people.

Chapter 1 ■ Starting Linux Command-Line adminiStration

The initiative by Torvalds didn’t stand on its own. Many other software developers had already started initiatives to create free software for the UNIX operating system. The only thing that really was missing at that moment was a kernel that was stable enough to go into production and offer a complete and free alternative to the expensive UNIX operating system.

Open Source

Right from the start, Torvalds released his software as open source software—that is, software whose source code is freely available to anyone. This brings a major benefit: other programmers have access to the source code and thus it becomes much easier to fix issues in the code, with the result of getting code that is more stable and reliable. This open source initiative fitted well into many other open source programs that were a part of the GNU initiative. The acronym GNU stands for GNU is Not UNIX, which means that this is about software written for the UNIX platform but doesn’t use UNIX licensing. This GNU initiative was a part of the Free Software Foundation (FSF), which wanted to create free software for a better operating system experience. When it came to licensing, Torvalds released his software under the GPL. In those days, GPL stood for GNU Public License, but nowadays it means General Public License. The details of this license are quite complex, but in essence it means that software released under the GPL can be used and modified by anyone, as long as the person modifying this software makes sure that his or her modifications will be released under the GPL as well. In brief: once software has a GPL, it will always stay GPL software. This prevents companies from making small modifications and then taking the software out of GPL and selling it for a lot of money. In current Linux versions GPL still is very important. Most distributions consider it an essential property of the Operating system and will refuse software that doesn’t comply with the conditions in the GPL license. By being so strict about the licensing, Linux distributions ensure that the software that is released as Open Source software will always stay Open Source software. Some distrubutions do also allow non-open source softare to be included, such as binary code for specific firmware. You will notice a different philosophical approach in this between the different distributions.

The First Distributions

Apart from the Linux kernel, lots of other programs were available under the GPL as well. In the early days, people who wanted to start using Linux had to go on the Internet and download these software programs themselves. Often, after downloading them, they even had to compile them for themselves. This compilation process was necessary to convert the program files, which were published as source code files only, to executable programs that users could execute on their computer. Software compilation is not very easy to do, and for that reason, different people started to create collections that consisted of the Linux kernel and some other useful programs. One of the first persons to do so was Patrick Volkerding, who started his Slackware distribution in 1993. In those days, this distribution consisted of different software categories, all put together on no fewer than 43 diskettes. Volkerding was perhaps the first who made a successful Linux distribution that started to get used on servers all around the world, and his Slackware distribution still exists, although new releases are not published very frequently.

Linux Turning Mainstream

The years between 1993 and 1998 marked the rise of the Linux operating system. One of the most important reasons that it took of so rapidly, is that it provided a very affordable alternative for the expensive UNIX operating system that was used on many mission-critical server systems. In the early days of Linux, no support was available, but that didn’t prevent scientists at different institutes around the globe to start working with it. Linux also acquired huge popularity rapidly in educational environments. Due to this popularity, during this period the most important Linux distributions were created.