Linux basic commands and get help summary 1

Source: Internet
Author: User

As we all know, the operating system (OS) is the closest to the hardware of the first layer of system software, it is the hardware to transform the bare metal into a fully functional virtual machine, making the use and management of computer systems more convenient, more efficient use of computing resources, the upper-level applications can be more than the hardware provides more support. Kernal, as the bottom-level structure of the operating system, virtualize the underlying hardware resources into more accessible resources, such as icons on the human-computer interface. The kernal is the library, which provides an interface for users to operate on a computer. The user can call functions in library libraries through the operating system interface, and can call the libraries function directly through kernal, both of which have an operating system interface.

[Email protected] ~]#

After connecting to the Linux system through the user login interface in Xshell, the Shell interface program can be started directly. The above string is the command prompt we used in the Shell interface program. All commands are done behind this prompt.

Root: The name of the user account that is currently logged in.

localhost: The host name of the current host's non-complete format, usually intercepted from the first '. ' Before

The base name of the path to the non-full-format path where the ~:shell program resides is actually a directory name, which we call the shell's working directory, and by default the working directory of the shell is the user's home.

#: Command prompt symbol.

Where the command prompt symbol is # is Superuser root, the $ is a normal user, that is, non-root user, do not have administrative rights, can not perform management class operations;

Programs typically contain four types of files:

Binaries (executable files, application files): Files that can be run directly, windows:exe,msi,linux:elf.

Header file/library file:

Windows:dll (dynamic:linked library dynamic Link);

Linux:so (Share Object) supply library for use, shared library;

Ko (kernal Object) library for use by the kernel;

Help file: It is the instruction manual of the whole program.


Now let's talk about the general format of the Linux command:

COMMAND OPTIONS Arguments[paramenters] (the three must be separated by a space)

Command: The specific action that you want to perform, the process;

Commands are divided into internal commands and external commands. Internal commands are commands built into the shell, and external commands are commands that are obtained by installing the application.

In this way, when using commands, we need to distinguish between commands that are currently in use, and how do we differentiate between internal and external orders?

# type COMMAND;

Use the Type command

The result of this command can be in the following cases:

1. If the command being detected is an external command, the type displays a specific path, which is found by the path stored in the path variable;

2. If the command being instrumented is an internal command, the type command displays the message "command is Shell Buildin"

3. Of course there may be a third case, that is, in order to facilitate user use, it is possible to put a command and its common choice to build an alias command, so if this is the case, the type command will be the alias command and the original command, options and the combination of parameters display.


OPTIONS: The features used during this command execution.

Options can be divided into short option and long option.

Short options:

-char

Can write more than one time,-a-l-D (separate words, the choice between the space),-ald (combined to write must have a space)

Long options:

--word,--help,--list,--human-readable long option cannot and merge writing, can only one one write.

Attention:

1. Some options require additional parameters.

2. Some options can be used without dashes, and some command options must not use dashes.

3. The long option for some commands only uses a dash.

Arguments[paramenters] (parameter): This command wraps the action object Some commands can have multiple parameters at the same time, but the parameters must be separated by a space.

Attention:

1. Command when writing, Command,options,arguments[paramenters] must be separated by a blank character.

2. Some commands can be swapped for the position of the options and parameters at the time of writing.

3. All components of the command are strictly case-sensitive.

Get help with using the command:

The Help for getting commands can be divided into two types, one for internal commands, and two for external commands.

Internal command:

# Help command: Use the Help commands directly.

External command:

1. Using the--HELP option

# COMMAND--help

2. Using the Man Help Manual (manual)

By default, we use the Package management tool to install packages of compiled applications directly into a Linux system.

When installing the application software, the Help files needed for this software will be installed at the same time, the default storage location:/usr/share/man/.

There are nine chapters in the Man Help Handbook, referred to as the man 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 configuration information

7. Miscellaneous

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

9. Kernel-related

There are many fields in each man's manual;

Name: Introduction to Program names and features

Synopsis: Syntax format used by commands

DESCRIPTION: Detailed description information of the program

Options: A detailed description of the use and meaning of the option

Authon: Author information for the program

Reforting BUGS: Bug format included in the report program

EXAMPLES: Example of command usage

See ALSO: Additional reference content

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

The synopsis, which clearly describes the use of the command format and the combination of options, we usually see the following types of special symbols, their meaning is described as follows:

[]: Can be omitted to write, or can be filled out as required

<>: Must be written

... : There are more

A 丨 b 丨 C: multiple Choice One

After reading the help, press Q to exit.


So, in such a Linux environment, what is the philosophical thinking of Linux?

1. All Documents

Linux abstracts almost all of its resources into files, even hardware, sockets and pipelines used for network communication. File: A set of streaming data in a storage device bounded by a boundary.


2. A large number of small programs with a single function, but can achieve complex tasks;

Single function: Each small program to do only one thing, and to do well;

Complex tasks: Compose as many small programs as possible, and make them work to the fullest.

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

4. Use plain text format to save configuration information.

In a Linux system, all files belong to the only original node "/", the files in the system and "/" form an inverted tree file, and the files are searched from the root to the target file. Where the search path begins with the root is called the absolute path, that is, the path from which everything is found, and the path to find the target file layer by level from the beginning of the current file is called the relative path.

Cases

TOUCH/ABC (under Root to create a file, absolute path)

Touch ABC (under current file, with relative path)

Any one path can be divided into two parts:

File base name (i.e. end of path):

Command basename (remove the base name from the path)

File directory name (that is, a combination of the path and the end of the path):

Command DirName (remove the directory name from the path)

Note: If you are using a relative path, use the absolute path if you are not on the way.

Naming format for files:

In the file system, based on the file name reference files, according to the name to access, in the file system, the filename has a series of provisions

1. The file name cannot contain a "/" Slash, "/" can represent the root file system, or "/" can also represent the path delimiter.

2. The file name cannot be longer than 255 characters

3. File names cannot be duplicated in the same location

4. File name requirements are strictly case sensitive


Here is a brief description of some of the basic operations of the Linux command-line operation CLI and how to get help information, and not too much elaboration, and finally listed some of the level of HFS standards to understand the CLI interface "/" Some of the files under the specific implementation of the function

/:

Bin: normal operation commands that ordinary users can perform

Boot: Booting the operating system static files, including boot programs, Linux kernel, INITRAMFS, etc.

Dev:device, equipment (Ls/dev)

Block device: Any device that can achieve data storage is a block device (U disk, etc.)

Character devices: Devices that enable data transfer and data processing, sequential access (mouse keyboard, etc.)

ETC: Storage of the host-specific system configuration file

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

LIB,LIB64, storing the shared library file directory, the kernel module

Media: mount point for removable devices

MNT: Temporary file system mount point

Opt: Previously a very popular installation directory for third-party applications (empty by default)

Root: Home directory for Superuser Root

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

SRV: Store Various service data provided by the system (empty by default)

Tmp:temperate, temp file directory, automatically clears data that is not accessed in this directory every 30 days

USR: Very important for Linux today, which is the second root of Linux, all

Third-party applications are loaded into this directory by default.

/usr/local third, primarily used to compile third-party applications.

/USR/SRC: Store The application's source code

var: data that can be changed



Linux basic commands and get help summary 1

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.