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

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

Интервал:

Закладка:

Сделать

You might choose to use different shells for the following reasons:

You are used to using UNIX System V systems (often ksh by default) or Sun Microsystems and other Berkeley UNIX-based distributions (frequently csh by default), and you are more comfortable using default shells from those environments.

You want to run shell scripts that were created for a particular shell environment, and you need to run the shell for which they were made so that you can test or use those scripts from your current shell.

You simply prefer features in one shell over those in another. For example, a member of my Linux Users Group prefers ksh over bash because he doesn't like the way aliases are used with bash.

Although most Linux users have a preference for one shell or another, when you know how to use one shell, you can quickly learn any of the others by occasionally referring to the shell's man page (for example, type man bash). The man pages (described later in the section “Getting Information about Commands”) provide documentation for commands, file formats, and other components in Linux. Most people use bash just because they don't have a particular reason for using a different shell. The rest of this chapter describes the bash shell.

Bash includes features originally developed for shand kshshells in early UNIX systems, as well as some cshfeatures. Expect bash to be the default login shell in most Linux systems that you are using, with the exception of some specialized Linux systems (such as some that run on embedded devices) that may require a smaller shell that needs less memory and requires fewer features. Most of the examples in this chapter are based on the bash shell.

TIP

The bash shell is worth knowing not only because it is the default in most installations, but because it is the one you will use with most Linux certification exams.

Running Commands

The simplest way to run a command is just to type the name of the command from a shell. From your desktop, open a Terminal window. Then enter the following command:

$ date Thu Jun 29 08:14:53 EDT 2019

Entering the datecommand, with no options or arguments, causes the current day, month, date, time, time zone, and year to be displayed as just shown.

Here are a few other commands you can try:

$ pwd /home/chris $ hostname mydesktop $ ls Desktop Downloads Pictures Templates Documents Music Public Videos

The pwdcommand shows your current working directory. Entering hostnameshows your computer's hostname. The lscommand lists the files and directories in your current directory. Although many commands can be run by just entering command names, it's more common to type other characters after the command to modify its behavior. The characters and words that you can type after a command are called options and arguments .

Understanding command syntax

Most commands have one or more options that you can add to change the command's behavior. Options typically consist of a single letter preceded by a hyphen. However, you can group single-letter options together or precede each with a hyphen to use more than one option at a time. For example, the following two uses of options for the lscommand are the same:

$ ls -l -a -t $ ls -lat

In both cases, the lscommand is run with the -l(long listing), -a(show hidden dot files), and -toptions (list by time).

Some commands include options that are represented by a whole word. To tell a command to use a whole word as an option, you typically precede it with a double hyphen ( --). For example, to use the help option on many commands, you enter --helpon the command line. Without the double hyphen, the letters h, e, l, and pwould be interpreted as separate options. There are some commands that don't follow the double hyphen convention, using a single hyphen before a word, but most commands use double hyphens for word options.

NOTE

You can use the --helpoption with most commands to see the options and arguments that they support. For example, try typing hostname --help.

Many commands also accept arguments after certain options are entered or at the end of the entire command line. An argument is an extra piece of information, such as a filename, directory, username, device, or other item, that tells the command what to act on. For example, cat /etc/passwddisplays the contents of the /etc/passwdfile on your screen. In this case, /etc/passwdis the argument. Usually, you can have as many arguments as you want on the command line, limited only by the total number of characters allowed on a command line. Sometimes, an argument is associated with an option. In that case, the argument must immediately follow the option. With single-letter options, the argument typically follows after a space. For full-word options, the argument often follows an equal sign ( =). Here are some examples:

$ ls --hide=Desktop Documents Music Public Videos Downloads Pictures Templates

In the previous example, the --hideoption tells the lscommand not to display the file or directory named Desktopwhen listing the contents of the directory. Notice that the equal sign immediately follows the option (no space) and then the argument (again, no space).

Here's an example of a single-letter option that is followed by an argument:

$ tar -cvf backup.tar /home/chris

In the tarexample just shown, the options say to create ( c) a file ( f) named backup.tarthat includes all of the contents of the /home/chrisdirectory and its subdirectories and show verbose ( v) messages as the backup is created. Because backup.taris an argument to the foption, backup.tarmust immediately follow the option.

Here are a few commands that you can try out. See how they behave differently with different options:

$ ls Desktop Documents Downloads Music Pictures Public Templates Videos $ ls -a . Desktop .gnome2_private .lesshst Public .. Documents .gnote .local Templates .bash_history Downloads .gnupg .mozilla Videos .bash_logout .emacs .gstreamer-0.10 Music .xsession-errors .bash_profile .esd_auth .gtk-bookmarks Pictures .zshrc .bashrc .fsync.log .gvfs Pictures $ uname Linux $ uname -a Linux mydesktop 5.3.7-301.fc31.x86_64 #1 SMP Mon Oct 21 19:18:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ date Wed 04 Mar 2020 09:06:25 PM EST $ date +'%d/%m/%y' 04/03/20 $ date +'%A, %B %d, %Y' Wednesday, March 04, 2020

The lscommand, by itself, shows all regular files and directories in the current directory. By adding the -a, you can also see the hidden files in the directory (those beginning with a dot). The unamecommand shows the type of system you are running (Linux). When you add -a, you also can see the hostname, kernel release, and kernel version.

The datecommand has some special types of options. By itself, datesimply prints the current day, date, and time as shown above. But the datecommand supports a special +format option, which lets you display the date in different formats. Enter date --helpto see different format indicators you can use.

Try the idand whocommands to get a feel for your current Linux environment, as described in the following paragraphs.

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

Интервал:

Закладка:

Сделать

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

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


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

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

x