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», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

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

Интервал:

Закладка:

Сделать

Linux Filesystems versus Windows-Based Filesystems

Although similar in many ways, the Linux filesystem has some striking differences when compared to filesystems used in MS-DOS and Windows operating systems. Here are a few of these differences:

In MS-DOS and Windows filesystems, drive letters represent different storage devices. In Linux, all storage devices are connected to the filesystem hierarchy. So, the fact that all of /usr may be on a separate hard disk or that /mnt/remote1 is a filesystem from another computer is invisible to the user.

Slashes, rather than backslashes, are used to separate directory names in Linux. So C:\home\joe in a Microsoft system is /home/joe in a Linux system.

Filenames almost always have suffixes in DOS (such as .txt for text files or .docx for word-processing files). Although at times you can use that convention in Linux, three-character suffixes have no required meaning in Linux. They can be useful for identifying a file type. Many Linux applications and desktop environments use file suffixes to determine the contents of a file. In Linux, however, DOS command extensions such as .com, .exe, and .bat don't necessarily signify an executable. (Permission flags make Linux files executable.)

Every file and directory in a Linux system has permissions and ownership associated with it. Security varies among Microsoft systems. Because DOS and Microsoft Windows began as single-user systems, file ownership was not built into those systems when they were designed. Later releases added features such as file and folder attributes to address this problem.

Using Basic Filesystem Commands

I want to introduce you to a few simple commands for getting around the filesystem to start out. If you want to follow along, log in and open a shell. When you log in to a Linux system and open a shell, you are placed in your home directory. As a Linux user, most of the files you save and work with will probably be in that directory or in subdirectories that you create. Table 4.1shows commands to create and use files and directories.

TABLE 4.1 Commands to Create and Use Files

Command Result
cd Changes to another directory
pwd Prints the name of the current (or present) working directory
mkdir Creates a directory
chmod Changes the permission on a file or directory
ls Lists the contents of a directory

One of the most basic commands that you use from the shell is cd. The cdcommand can be used with no options (to take you to your home directory) or with full or relative paths. Consider the following commands:

$ cd /usr/share/ $ pwd /usr/share $ cd doc $ pwd /usr/share/doc $ cd $ pwd /home/chris

The /usr/shareoption represents the absolute path to a directory on the system. Because it begins with a slash ( /), this path tells the shell to start at the root of the filesystem and take you to the sharedirectory that exists in the usrdirectory. The docoption to the cdcommand looks for a directory called docthat is relative to the current directory. So that command made /usr/share/docyour current directory.

After that, by typing cdalone, you are returned to your home directory. If you ever wonder where you are in the filesystem, the pwdcommand can help you. Here are a few other interesting cdcommand options:

$ cd ~ $ pwd /home/chris $ cd ~/Music $ pwd /home/chris/Music $ cd ../../../usr $ pwd /usr

The tilde ( ~) represents your home directory. So cd ~takes you there. You can use the tilde to refer to directories relative to your home directory as well, such as /home/chris/Musicwith ~/Music. Typing a name as an option takes you to a directory below the current directory, but you can use two dots ( ..) to go to a directory above the current directory. The example shown takes you up three directory levels (to /), and then takes you into the /usrdirectory.

The following steps lead you through the process of creating directories within your home directory and moving among your directories, with a mention of setting appropriate file permissions:

1 Go to your home directory. To do this, simply type cd in a shell and press Enter. (For other ways of referring to your home directory, see the sidebar “Identifying Directories.”)

2 To make sure that you're in your home directory, type pwd. When I do this, I get the following response (yours will reflect your home directory):$ pwd /home/joe

3 Create a new directory called test in your home directory, as follows:$ mkdir test

4 Check the permissions of the directory:$ ls -ld test drwxr-xr-x 2 joe sales 1024 Jan 24 12:17 testThis listing shows that test is a directory (d). The d is followed by the permissions (rwxr-xr-x), which are explained later in the section “Understanding File Permissions and Ownership.” The rest of the information indicates the owner (joe), the group (sales), and the date that the files in the directory were most recently modified (Jan 24 at 12:17 p.m.).NOTEWhen you add a new user in Fedora and Red Hat Enterprise Linux, the user is assigned to a group of the same name by default. For example, in the preceding text, the user joe would be assigned to the group joe. This approach to assigning groups is referred to as the user private group scheme.For now, enter the following: $ chmod 700 testThis step changes the permissions of the directory to give you complete access and everyone else no access at all. (The new permissions should read rwx------.)

5 Make the test directory your current directory as follows:$ cd test $ pwd /home/joe/test

If you followed along, at this point a subdirectory of your home directory called testis your current working directory. You can create files and directories in the testdirectory along with the descriptions in the rest of this chapter.

Using Metacharacters and Operators

Whether you are listing, moving, copying, removing, or otherwise acting on files in your Linux system, certain special characters, referred to as metacharacters and operators, help you to work with files more efficiently. Metacharacters can help you match one or more files without completely typing each filename. Operators enable you to direct information from one command or file to another command or file.

Using file-matching metacharacters

To save you some keystrokes and enable you to refer easily to a group of files, the bash shell lets you use metacharacters. Anytime you need to refer to a file or directory, such as to list, open, or remove it, you can use metacharacters to match the files you want. Here are some useful metacharacters for matching filenames:

* Matches any number of characters.
? Matches any one character.
[…] Matches any one of the characters between the brackets, which can include a hyphen-separated range of letters or numbers.

Try out some of these file-matching metacharacters by first going to an empty directory (such as the testdirectory described in the previous section) and creating some empty files:

$ touch apple banana grape grapefruit watermelon

The touchcommand creates empty files. The commands that follow show you how to use shell metacharacters with the lscommand to match filenames. Try the following commands to see whether you get the same responses:

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

Интервал:

Закладка:

Сделать

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

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


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

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

x