Christopher Negus - Linux Bible

Здесь есть возможность читать онлайн «Christopher Negus - Linux Bible» — ознакомительный отрывок электронной книги совершенно бесплатно, а после прочтения отрывка купить полную версию. В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Жанр: unrecognised, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Linux Bible: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Linux Bible»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

The industry favorite Linux guide
Linux Bible, 10th Edition This useful guide assumes a base of little or no Linux knowledge, and takes you step by step through what you need to know to get the job done.
Get Linux up and running quickly Master basic operations and tackle more advanced tasks Get up to date on the recent changes to Linux server system management Bring Linux to the cloud using Openstack and Cloudforms Simplified Linux administration through the Cockpit Web Interface Automated Linux Deployment with Ansible Learn to navigate Linux with Amazon (AWS), Google (GCE), and Microsofr Azure Cloud services 
 is the one resource you need, and provides the hands-on training that gets you on track in a flash.

Linux Bible — читать онлайн ознакомительный отрывок

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Linux Bible», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

NOTE

If man -kdisplays no output, it may be that the man page database has not been initialized. Type mandbas root to initialize the man page database.

Let's say that the two man pages in which I am interested are the passwdcommand (in section 1 of the man pages) and the passwdfile (in section 5) man pages. Because just typing man passwddisplays the section 1 page, I need to request explicitly the section 5 man page if I want to see that instead ( man 5 passwd).

While you are displaying a man page, you can view different parts of the file using Page Down and Page Up keys (to move a page at a time). Use the Enter key or up and down arrows to move a line at a time. Press a forward slash ( /) and type a term to search the document for that term. Press nto repeat the search forward or Nto repeat the search backward. To quit the man page, type q.

Summary

To become an expert Linux user, you must be able to use the shell to type commands. This chapter focuses on the bash shell, which is the one that is most commonly used with Linux systems. You learned how commands are structured and how many special features, such as variables, command completion, and aliases, are used.

The next chapter describes how to move around the Linux filesystem from the shell command line.

Exercises

Use these exercises to test your knowledge of using the shell. These tasks assume that you are running a Fedora or Red Hat Enterprise Linux system (although some tasks work on other Linux systems as well). If you are stuck, solutions to the tasks are shown in Appendix B(although in Linux, there are often multiple ways to complete a task).

1 From your desktop, switch to the third virtual console and log in to your user account. Run a few commands. Then exit the shell and return to the desktop.

2 Open a Terminal window and change the font color to red and the background to yellow.

3 Find the location of the mount command and the tracepath man page.

4 Type the following three commands, and then recall and change those commands as described: $ cat /etc/passwd $ ls $HOME $ dateUse the command-line recall feature to recall the cat command and change /etc/passwd to /etc/group.Recall the ls command, determine how to list files by time (using the man page), and add that option to the ls $HOME command line.Add format indicators to the date command to display the date output as month/day/year.

5 Run the following command, typing as few characters as possible (using tab completion): basename /usr/share/doc/

6 Use the cat command to list the contents of the /etc/services file and pipe those contents to the less command so that you can page through it (press q to quit when you are finished).

7 Run the date command in such a way that the output from that command produces the current day, month, date, and year. Have that read into another command line, resulting in text that appears like the following (your date, of course, will be different): Today is Thursday, December 19, 2019.

8 Using variables, find out what your hostname, username, shell, and home directories are currently set to.

9 Create an alias called mypass that displays the contents of the /etc/passwd file on your screen in such a way that it is available every time you log in or open a new shell from your user account.

10 Display the man page for the mount system call.

CHAPTER 4 Moving Around the Filesystem

IN THIS CHAPTER

Learning about the Linux filesystem

Listing file and directory attributes

Making files and directories

Listing and changing permission and ownership

Making copies and moving files

The Linux filesystem is the structure in which all of the information on your computer is stored. In fact, one of the defining properties of the UNIX systems on which Linux is based is that nearly everything you need to identify on your system (data, commands, symbolic links, devices, and directories) is represented by items in the filesystems. Knowing where things are and understanding how to get around the filesystem from the shell are critical skills in Linux.

In Linux, files are organized within a hierarchy of directories. Each directory can contain files as well as other directories. You can refer to any file or directory using either a full path (for example, /home/joe/myfile.txt) or a relative path (for example, if /home/joewere your current directory, you could simply refer to the file as myfile.txt).

If you were to map out the files and directories in Linux, it would look like an upside-down tree. At the top is the root directory (not to be confused with the root user), which is represented by a single slash ( /). Below that is a set of common directories in the Linux system, such as bin, dev, home, lib, and tmp, to name a few. Each of those directories, as well as directories added to the root directory, can contain subdirectories.

Figure 4.1illustrates how the Linux filesystem is organized as a hierarchy. To demonstrate how directories are connected, the figure shows a /homedirectory that contains a subdirectory for the user joe. Within the joedirectory are Desktop, Documents, and other subdirectories. To refer to a file called memo1.docin the memosdirectory, you can type the full path of /home/joe/Documents/memos/memo1.doc. If your current directory is /home/joe/, refer to the file as Documents/memos/memo1.doc.

FIGURE 41 The Linux filesystem is organized as a hierarchy of directories - фото 15

FIGURE 4.1 The Linux filesystem is organized as a hierarchy of directories.

Some of these Linux directories may interest you:

/bin Contains common Linux user commands, such as ls, sort, date, and chmod.
/boot Has the bootable Linux kernel, initial RAM disk, and boot loader configuration files (GRUB).
/dev Contains files representing access points to devices on your systems. These include terminal devices ( tty*), hard disks ( hd*or sd*), RAM ( ram*), and CD-ROM ( cd*). Users can access these devices directly through these device files; however, applications often hide the actual device names to end users.
/etc Contains administrative configuration files. Most of these files are plain-text files that, given the user has proper permission, can be edited with any text editor.
/home Contains directories assigned to each regular user with a login account. (The root user is an exception, using /rootas his or her home directory.)
/media Provides a standard location for automounting devices (removable media in particular). If the medium has a volume name, that name is typically used as the mount point. For example, a USB drive with a volume name of myusbwould be mounted on /media/myusb.
/lib Contains shared libraries needed by applications in /binand /sbinto boot the system.
/mnt A common mount point for many devices before it was supplanted by the standard /mediadirectory. Some bootable Linux systems still use this directory to mount hard disk partitions and remote filesystems. Many people still use this directory to temporarily mount local or remote filesystems, which are not mounted permanently.
/misc A directory sometimes used to automount filesystems upon request.
/opt Directory structure available to store add-on application software.
/proc Contains information about system resources.
/root Represents the root user's home directory. The home directory for root does not reside beneath /homefor security reasons.
/sbin Contains administrative commands and daemon processes.
/sys Contains parameters for such things as tuning block storage and managing cgroups.
/tmp Contains temporary files used by applications.
/usr Contains user documentation, games, graphical files ( X11), libraries ( lib), and a variety of other commands and files that are not needed during the boot process. The /usrdirectory is meant for files that don't change after installation (in theory, /usrcould be mounted read-only).
/var Contains directories of data used by various applications. In particular, this is where you would place files that you share as an FTP server ( /var/ftp) or a web server ( /var/www). It also contains all system log files ( /var/log) and spool files in /var/spool(such as mail, cups, and news). The /vardirectory contains directories and files that are meant to change often. On server computers, it is common to create the /vardirectory as a separate filesystem, using a filesystem type that can be easily expanded.

The filesystems in the DOS or Microsoft Windows operating systems differ from Linux's file structure, as the sidebar “Linux Filesystems versus Windows-Based Filesystems” explains.

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Linux Bible»

Представляем Вашему вниманию похожие книги на «Linux Bible» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Linux Bible»

Обсуждение, отзывы о книге «Linux Bible» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x