Getting Started with Linux Basics (ii)

Source: Internet
Author: User
Tags builtin

the philosophical thinking of Linux :

1. All documents: Abstract almost all resources into the form of documents, including hardware devices, and even communication interfaces;

Open (), read (), write (), close (), delete (), create ()

2. Consists of a number of functions of a single program; A program that only does one thing and does it well; combine small programs to accomplish complex tasks;

3. Try to avoid interacting with users;

Goal: Easy to implement automation tasks in a programmatic way;

4. Use a text file to save configuration information;


One of the philosophical ideas of Linux: All documents

One of the performance: hardware devices are also represented by files

Physical Terminal:/dev/console

Virtual Terminal:/dev/tty# [1,6]

Serial Terminal:/dev/ttys#

Pseudo Terminal:/dev/pts/#


Physical terminal, console: Console

Virtual Terminals: 6, TTY

CTRL+ALT+F[1-6]

Graphics Terminal:

CentOS 6:

Ctrl+alt+f7

CentOS 7:

Which virtual terminal is on, which virtual terminal

Serial Terminal: TTYs

Pseudo Terminal: Pty


View End Devices :

[[email protected] ~]# TTY

/dev/pts/0

To start the GUI:

Run a command on a virtual Terminal interface: StartX &


CLI Interface: command-line interface

[[email protected] ~]# COMMAND

Description

Root: When the logged on user

CENTOS7: Host name of the current host, non-full format, if you want to see the full format: hostname to get

~: The directory in which the user is currently located (current directory), also known as the Working directory (working directory), relative path;

#: Command prompt;

#: Administrator account, for root; Has the highest authority, can perform all operations;

$: Ordinary users, non-root users, do not have administrative rights, can not perform system management class operations;


Note: It is recommended to log in with a non-administrator account, and perform administrative actions to temporarily switch to the administrator and return the operation.


Syntax general format for commands:

# COMMAND [OPTIONS] [ARGUMENTS]

Command: Initiates an order that requests the kernel to run a binary program as a process;

Programs--Process

Static--Dynamic (with life cycle: open to end)


The command itself is an executable program file: A binary-formatted file that may call a shared library file

Most system program files are stored in:

/bin,/sbin,/usr/bin,/usr/sbin,/usr/local/bin,/usr/local/sbin

Normal command:/bin,/usr/bin,/usr/local/bin

Management command:/sbin,/usr/sbin,/usr/local/sbin

Shared libraries:/lib,/lib64,/usr/lib,/usr/lib64,/usr/local/lib,/usr/local/lib64

Library of 32bits:/lib,/usr/lib,/usr/local/lib

Library of 64bits:/lib64,/usr/lib64,/usr/local/lib64


Note: Not all commands have a executable program file that corresponds to a directory


Commands must follow specific format specifications: exe, MSI, ELF (Linux)


The commands are divided into two categories:

Commands that are brought in by the shell program: Built-in commands (BUILTIN)

Standalone executable program file, file name is command name: external command


Shell program is a unique program, responsible for parsing the user-supplied commands;

Environment variables:

Path: The path from which to find the command file for the command string that the user typed; the lookup order: from left to right.

[Email protected] ~]# echo $PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin


To view the command type:

[[Email protected] ~]# Type CD (command)

CD is a shell builtin


OPTIONS:

There are two forms of the options:

Short options:-C, for example-L,-D

Note: Some of the command options are not-;

If the same command uses multiple short options at the same time, most can be combined:-l-d =-ld

Long options:--word, e.g.--help,--human-readable

Note: The long option cannot be merged ;


Note: Some options can take parameters, which are called option parameters; (command space)


ARGUMENTS:

The action object of the command;

Note: parameters of different commands, some commands can take multiple parameters at the same time, and multiple are separated by whitespace characters;

Example: ls-ld/var/etc

/var and/etc are the objects of action



Get help with using the command:

Internal command:

[[email protected] ~]# help COMMAND

External command:

(1) command to use Help with a brief format

[[email protected] ~]# COMMAND--help

(2) User's Manual: manual

Location:/usr/share/man

[[email protected] ~]# man COMMAND

Section Description:

NAME: Description of functionality

Synopsis: Syntax format

DESCRIPTION: Description

Options: Option

EXAMPLES: Using the example

AUTHOR: Author

BUGS: How to Report program bugs

See ALSO: Reference

Synopsis:

[]: Optional content;

<>: Content that must be provided;

A|b|c: choose one more;

... : Similar content can appear more than one;


User manual: Compressed format of the file, the section of the chapter;/usr/share/man1, Man2, ...

1: User command;

2: System call;

3:C library call;

4: Equipment files and special documents;

5: file format; (configuration file format)

6: Game use help;

7: Miscellaneous;

8: Management tools and guardian;


~]# man CHAPTER (chapter) COMMAND

Example:

[[email protected] ~]# man 1 ls

Note: Not every command has a manual under all chapters


How to view commands in the first few chapters are:

[Email protected] ~]# Whatis ifconfig

Ifconfig (8)-Configure a network interface


Note: Its execution process is the query database;


To manually update the database:

[Email protected] ~]# Makewhatis


The man command to open the manual after the operation method:

Turn screen operation:

SPACEBAR: Turn a screen at the end of the file;

B: Turn the file to the first screen;

Ctrl+d: Half-screen to the tail of the file;

Ctrl+u: Turn half screen to file header;

Enter: Flip a line to the end of the file;

K: Flip a line to the file header;

G: Jump to the last line;

#G: Jumps to the specified line;

1 g: Jump to File header, (G can also jump to the capital)


Text Search:

/keyword: From the file header to the end of the file to find, not distinguish between character case;

Keyword: from the tail of the file to the file header in turn;

N: The same direction as the search command;

N: Opposite to the search command direction;


Exit:

Q:quit


Options:

-m/path/to/somedir: Find the command manual in the specified directory and open it;


(3) Info COMMAND

Get the online documentation for the command;


(4) Many applications will bring their own Help documentation:/usr/share/doc/app-version

README: The relevant information of the program;

Install: Installation help;

Changes: Changes in version iterations;


(5) Official documents for mainstream distribution

Http://www.redhat.com/doc


(6) Official documentation of the program:

"Document" on the official site


(7) Search engine

Google

How to use the Lasso function:

Keyword filetype:pdf (file type search)

Keyword site:domain.tld (domain search)





This article is from the "Disguised Geek" blog, please be sure to keep this source http://waldenkk.blog.51cto.com/2410270/1902370

Getting Started with Linux Basics (ii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.