The method of obtaining command in Linux and its philosophical thought

Source: Internet
Author: User
Tags parent directory

There are several ways to get help with the use of commands:
1.man: Help manual for external commands;
Man Nine chapters:
1. User commands (commands that all users can execute)
2. System calls
3.C Library Call
4. Equipment and special documents
5. Configuration file format
6. Game-related Help information
7. Miscellaneous
8. System Management Class commands
9. Kernel-related Help information

Some of the fields that are commonly seen in each man Handbook are: Name: A simple description of the program names and related functions; Synopsis: The syntax format used by the command; DESCRIPTION: detailed description of the program; options: A detailed description of the use of the option and the meaning of the option ; AUTHOR: Information EXAMPLES of program authors: examples of use of command programs; REPORTING BUGS: The way in which bugs are included in the reporting program, usually e-mail; see ALSO: Additional reference content FILE: The program that is associated with the His documents, such as configuration files, readme documents, etc., may appear in the Help information of some special symbols meaning: []: Can omit not to write, you can choose to use as necessary; {}: A vertical line "|" is usually included in curly braces, which means that all items must be selected and only one use is selected; "|" <&gt: Something that must be written; : There can be more content; The method of distinguishing internal and external commands: # Type command finds the word "inline" or "buildin" in the result, and the rest of the results are external commands; Help for internal commands does not use MA n Manual, while using the Help command; Buildin_command2. Use the Whereis command to get assistance, you can view the program's binaries, source code files, and the location of the Help manual; the 3.whatis command can get the hand of the command being matched to The description of the album; the 4.which command can display the way the alias of the command is defined and the path of the command's binary file; the 5.info command Info command gets the online Help document for the command; 6. There are many programs that have their own help documentation;/usr/share /doc/app_name-version/readme: Information about the program; Install: Installation information of the program; changes: Information about the course of the program's version change; LICENSE: The program follows The GPL LGPL BSD Apache MIT7. Search engine Google MySQL Filetype:pdf MySQL site:51cto.com8. Document information in the relevant site site Wiki FAQ9. Official documentation provided by the publisher of the program on the official site 10. Reference books: O ' Reiley Wrox Electronic industry publishing house simple System Management Class command: Logoff: Exit login exit Logout ctrll+d reboot: Shut down all processes running in memory, shut down the system core, power cycle all computer parts, load Kernel, launch application, print login prompt, reboot shutdown-r {#|now|time} (recommended) #: number, indicating relative time, i.e. reboot after # minutes; now:        In, immediately reboot, equivalent to-t 0; time:12:00 Init 6 shuts down the system: shuts down all processes running in memory, shuts down the system core, and loses power to all computer components. Halt Poweroff Init 0 shutdown-h {#|now|time} (recommended)

The philosophical thinking of Linux:
1. All Documents
Linux abstracts almost all of the data and resources in the form of files, even hardware, sockets used by network communications devices, and pipelines;

    文件:一组有边界的位于存储设备中的流式数据;2.由众多的功能单一的小程序组成,却可以实现复杂任务;    功能单一:每个小程序只做一件事,只实现一个功能;并且要做到最好;    复杂任务:可以根据业务逻辑或业务类型,尽可能完美的组合多个小程序,使多个小程序相辅相成,将功能发挥至极致;3.尽量避免与用户直接交互;    在程序化,系统化,平台化,自动化的运维空间中,人是极其易出错的一个环节;尽量避免与用户直接交互可以尽可能的保证结果的准确性和过程的高效性;易于以编程的方式实现自动化任务的实施;4.使用纯文本文件保存程序的配置信息;    在程序出现错误或者执行不畅的时候,可以使用文本编辑工具分析程序的错误原因,而不必依赖于二进制文件。

File system:
The file is divided into two parts:
Metadata: Describing the properties of a file
Data: The contents of a file

  Hierarchical Address method: In the file system, file access is based on file name reference files, by name.        In the file system, there are a series of rules for file names: 1. The file name cannot contain the "/" character; "/": Represents the root filesystem; the so-called root file system, which is the original starting point for the Linux file; "/": Represents the delimiter of the path; 2. The file name cannot be longer than 255 characters; 3. The file name cannot be reused in the same location; 4. Filenames are strictly case-sensitive; The file system uses the concept of a path to identify the location of the file; the so-called path is the set of hierarchy of directories that must pass when locating a file location. Description of path in file system: Absolute path: The path where everything starts with "/"; relative path everything begins with the current working directory; "." : Represents the current working directory; : Represents the parent directory of the current working directory (top level directory); So it can be said that everything is "." or ".." The path to start looking for is called the relative path, and when you use "." You can omit the current working directory, and how do I choose a path?        Select an absolute path or select a relative path?        If the target file and the current directory are not on the way to find the file, the absolute path is used, if the opposite path is used; The current working directory is included in the absolute path; home directory: The default current working directory for each user who logs on to the system, and the starting directory for each user; Also known as "Home directory" Any path is actually two parts: the base name of the file: directory name of the basename file: DirName  /pre>

FHS: File system Level standards
Bin:binary, common operation commands that can be performed by all users (including ordinary users);
Boot: Boot operating system to boot the static files, including: Boot program, Linux kernel, INITRAMFS, etc.;
Dev:device, Equipment
Blocks devices: Block device, random access, refers to the ability to implement data storage devices;
Character devices: Character device, sequential access (linear access), refers to the ability to achieve data transmission and data processing functions of equipment;
Etc:external Text Configure, storing the configuration files of each application in the host;
Home: The root of the default home directory for ordinary users;
LIB, lib64:library, the directory that holds the application shared library, the kernel module;
Media: mount point for removable devices;
MNT: Mount point of the temporary file system;
Opt:optional, optional, previously this directory is a very popular third-party application installation directory;
Root:root user's home directory;
Run: Save some process of PID file;
Sbin:super binary, which holds commands for the System management classes that the Superuser root can perform;
SRV: Data that stores services provided by the system;
Tmp:temporary, temporary file directory, the system will automatically clean up every 30 days in the directory for more than 30 days have not been accessed files;
The second root of the usr:usually system Root,linux systems is now primarily used to install third-party applications;
/usr/local: Third, mainly used to compile the source code for the installation of third-party applications;
/USR/SRC: The source code of the third party application;
Var:variable, variables, changeable data, database class files;

伪文件系统:其中存放的是内存中的数据通过操作系统映射的文件;    proc:process,进程,    sys:system

File type: the
Differentiate file types by color:
Black or White: plain text files, regular file;
Green: Executable file, command;
XXX: Device files, including block devices and character devices;
Red: Package files, including: packages, compressed packages, archive packages, etc.;
Dark blue: catalog file;
Cyan Blue (Turquoise): Symbolic link file, equivalent to a shortcut in Windows system;
Purple (Pink): Socket file;
Brown: Pipe file;

根据文件类型的标记区分文件类型:    -:普通文件;    b:块设备文件;    c:字符设备文件;    d:目录文件;    l:符号链接文件;    p:管道文件;    s:套接字文件;准确的区分文件类型:    file命令    # file /PATH/TO/SOMEFILE

The method of obtaining command in Linux and its philosophical thought

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.