Basic Linux Knowledge

Source: Internet
Author: User
Tags fully qualified domain name

Basic Linux Knowledge

1. Interface

1) GUI: Graphical interface Interface gnome is a visual interface, a beginner is best to start with this interface, written in C language;

2) CLI: Command line interface, when a Linux minimum installation is only this command line interface (there are different software to choose from such as: Bash,zsh,sh,csh,ksh,tcsh ... In this interface, the operating system needs to enter different commands with different functions, like DOS under Windows.

2. File types

Can be divided into four types of files, namely, binary files, header files (or library files), Help files, configuration files

Binaries are also called executables, which can be executed directly in the system with the extension EXE (full name execute) or MSI of such files in Windows, and in Linux with the extension elf.

Header File/library file

Under Windows called dynamic-link libraries (linked library)

Linux:so (Shared object) for program use

Ko (kernel object) for kernel use

Help File: User manual

Configuration file: Save variables during program run

3. Command prompt

Those characters that start in terminal mode in Linux such as: [[email protected] ~] #叫做命令提示符. Where Root represents the name of the user account that is currently logged on, and localhost is a non-full-format computer name (the full name is localhost.localdomain called the fully qualified domain name (FQDN)); ~ is the current directory at the time the command is executed (currunt directory), also known as the Working directory (working directory), when the working directory changes, the corresponding character of this position will be changed to the current directory (~ symbol represents the user's home directory) (PWD command displays the current working directory) (CD command changes the working directory, a "." Represents the current directory, two "." Represents the parent directory of the current directory when you enter "CD.." Go to the parent directory of the current catalog); The following # number represents the permissions of the currently logged-on user, where there are two types of permissions, #代表超级用户root, and $ represents the average user.

4. Format of the command

commandoptions arguments "Parameters"

Command Options Object

Command: The action body that you want to perform is essentially a process in which commands can be divided into internal commands (commands built into the shell, Shell's instincts) and external commands (commands that are obtained by installing the application). In the execution of the command will be in the path of the search (no command in path must carry the path, in the path of the direct execution can be), the first execution through the path in the paths variable to find, and later as long as the hash cache is still in the cache record, You will no longer find the path variable and look directly at the cache. You can use the type command to see whether a command is internal or external.

Options: The features used in the execution of this command are divided into the following two types

Short options:

-char

Can write more than once,-a-l-d==>-ald

Long option (cannot merge writing):

--word:--help--list--human-readable

It's important to note here that

1. Some options require additional parameters

2. Some options can not be used-boot, some of the command options must not be added-

3. The long options for some commands use one-

Arguments[parameters] Represents the action object that this command executes, some commands can have multiple parameters at the same time, but the parameters must be separated by that blank word. In writing commands, options, arguments "parameters" must be separated by white space characters, some commands in writing, options, arguments "parameters" position can be swapped, All components of the command are strictly case-sensitive (strict file system requirements).

5. There are two ways to use help, one is internal, and the other is an external command (use the type command to view the type of command) when the command is an internal command, you can use the "Help command" command for commands to view the aid. There are several ways to view Help when the command is an external command:

1. Use the---help option (in the Format: command--help)

2.man (manual) looks at the entire shell for help (in the format: Man command)

Man Total Nine Chapters

1. User commands (common commands that all users can perform)

2. System calls

3.C Library functions

4. Equipment and special documents

5. Configuration file format

6. Game-related Help information

7. Miscellaneous

8. Management class commands (only commands that can be executed by root)

9. Kernel-related

There are many fields in each man Handbook:

Name: Description of the program and related features

Synopsis: Syntax format used by commands

DESCRIPTION: Detailed description information of the program

Options: The use of the option and a detailed description of the meaning

AUTHOR: Author information for the program

Reportingbugs: How to report bugs contained in a program

EXAMPLES: Example of command usage

Seealso: Additional reference content

Files: Other files related to the program, such as configuration files, etc.

3.infocommand: Get an online help document for the command

4. There are many programs that come with your own Help documentation:

/user/share/doc/app_name-verision/

README: Information about the program

Install: Installation information for the program

Changes: Information about the process of program iteration Update

5. Document information in the relevant site site

Wiki

FAQ

6. Official site of the issuer of the program

7. Search Engine

8. Reference books:

6. In the description of the help, there are several explanatory symbols

1.[] brackets represent a possible omission.

2. Representative can more

3.<> angle brackets represent the must-write

4.a|b|c to choose one more

7. Several common commands

Hostname: Display host name

su– A user name: change user

Echo$shell: Displays the current interface type

Cat/etc/shells: Shows the supported Shell types

Change Shell to enter shell name directly

Type a command: shows what kind of command (inside/outside)

Man one command: Show Help for commands

Shutdown: Shutdown or restart

Useradd: Add an Account

TOUCH/ABC creating ABC in the root directory

Touch ABC creates ABC in the current directory

PWD Prints the current working directory

A command can have several different features that can be used to help you view specific features

8.linux Philosophical thinking:

1. All Documents

Linux abstracts almost all of the resources into the form of files, even the hardware, the sockets used for network communication, and the pipelines.

File: A set of streaming data (Windows, Linux) in a storage device with boundaries

2. Composed of a large number of single small programs, but can be anthology of complex tasks

Single function: Every small program only do one thing, and to do a good job

Complex tasks: Organize as many small programs as possible to maximize their functionality

3. Try to avoid direct interaction with users, easy to implement automated tasks in a programmatic way

4. Save the program's configuration information using a plain text file

9. Document Decency

/: Original starting point, in Linux/That is the beginning of the file

Metadata description file Properties

Data: The contents of a file

In the file system, the file is referenced based on the filename, and is accessed by name. In the file system, there are a number of rules for filenames

1. File name cannot contain "/" characters

"/" indicates the root file system

"/" indicates the path delimiter

2. The file name cannot be longer than 256 characters

3. In the same location, the file name cannot be duplicated

4. File name requirements are strictly case sensitive

Use the concept of a path to represent the exact location of a file, and the path is the hierarchy of directories that must pass when locating the location of a file

Paths are described in two ways:

Absolute path: The path to find everything starting with "/"

Relative path: The path to find starting from the working directory (current directory)

Note: When writing a directory, if you are using a relative path, if you do not stop by the absolute path (in the absolute path of the target file contains the current directory is called by the way). Any path can be divided into two parts (directory name/base name)

1. Base name of the file (original name of the file): base

2. File directory name (file in what directory): dirname

Home directory: The current directory for each user when logging into the system, and also the starting directory for each user (such as the root directory or other name directory under Home)

Features of some basic folders in 10.linux

/: Root directory

Bin: normal operation commands that ordinary users can perform

Boot: Boot | Boot the operating system static files, including: Boot program, kernel, INITRAMFS, etc.

Dev:device Equipment

Block devices: Devices that enable data storage

Character devices: devices capable of data transfer and data processing, sequential access

ETC: Storage of the host-specific system configuration file

Home: The root of an ordinary user's home directory

LIB, lib64: directory where shared library files are stored, modules of the kernel

Media: mount point for removable devices

MNT: Temporary file system mount point

OPT: Third-party application installation directory

Root: Home directory for Superuser Root

Sbin: Storage of management commands that only Superuser root can run

SRV: Storage of various service data provided by the system

Tmp:templerate, temp file directory, automatically clears data that is not accessed within 30th of the directory every 30 days

The second root of the usr:linux system, almost all third-party applications are installed in this directory

Usr/local is a third-tier root that is used primarily for compiling and installing third-party applications

USR/SRC Storing application source code

VAR: variable data, similar to a database

Pseudo file system (manage data in memory):

Proc (process): Processes

Syssystem: System

Types of files in 11.linux

Classify by Color:

Black or White: plain text file

Green: Executable file

Yellow: Device File

Red: Package file (Zip, archive, package)

Dark blue: Catalog file

Azure: Symbolic connection file, equivalent to Windows shortcut

Purple or pink: Socket file for network transmission

Brown: Pipe file (process communication used)

Classify according to tags (the first letter under the Ls-l command):

-: Text File

B: Block device files

C: Character device file

D: Catalog file

L: Link File

P: Pipeline File

S: Socket file

Use the file command to view the types of files

Basic Linux Knowledge

Related Article

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.