Linux Fundamentals-Basic concepts and simple commands

Source: Internet
Author: User

Linux Fundamentals-Basic concepts and simple commands

Before learning Linux, in order to better understand Linux and master Linux individuals think should have the condition:

1. Computer introduction and hardware related knowledge.

2. Establishment of the Network Foundation.

3. Learn from Linux basics, such as the installation of Linux and the use of commands

Basic skills of the 4.linux operating system.

Here are the sites that give access to Linux resources:

http://mirrors.aliyun.com

Http://mirrors.sohu.com

Http://mirrors.163.com

http://mirror.bit.edu.cn/web/


I. Some basic concepts in Linux: (Big god do not spray)

Free Software:

Free to use, freely learn and modify, freely distribute, freely create derivative versions, etc.

The Philosophy of Linux:

1. All documents: Almost all resources are files, including hardware devices are organized into file formats.

2. Consists of a number of single-purpose small programs; A program only implements one function, and to do well, the combination of small programs to complete complex tasks.

3. Try to avoid interacting with the user: target; implement scripting to automate certain functions

4. Save the configuration file with a plain text file

Terminal: A device in which a user interacts with a host

The terminal has the following types:

1. Physical Terminal: Direct access to the computer's display and keyboard equipment:/dev/console

2. Virtual Terminal: A virtual terminal which is attached to the physical terminal, which is implemented by software, and provides 6 virtual terminals in CentOS6.

With ctrl+alt+f1.f2.f3 ... Open each virtual terminal separately

3. Graphics Terminal: A terminal that is attached to a physical terminal and is implemented in a virtual manner by software. However, additional desktop environments are provided.

Ctrl+alt +f7

Device file path:/dev/tty#

4. Analog Terminal: Open command line interface under graphical interface, based on remote open interface such as SSH protocol or Telnet protocol

Device file:/dev/pts/# #为数字

View current terminal equipment with command: TTY

For example:

[Email protected] ~]# tty/dev/pts/0 [[email protected] ~]# who root tty1 2015-08-14 21:37 root p ts/0 2015-08-15 18:17 (172.16.1.107)

user Interface

          user interface (UI) is the medium for interaction and information exchange between the system and the user, which realizes the conversion between the internal form of information and the acceptable form of human being. Usually refers to the software interface, usually has command interface, program interface, graphics interface three kinds.

          graphical user interface (graphical user Interface, referred to as GUI, also known as graphical user interface ) refers to the graphical display of the computer operation user interface

CLI (command-line interface, command line interface ) refers to the user prompt to type the interface of the executable instruction, it usually does not support the mouse, the user through the keyboard input instructions, the computer receives the instruction, to be executed.


Two. Basic commands:

When the user enters the command in the command line mode, enter, the next job is to remind the Shell program to find the executable program or code corresponding to the type command, and then submit it to the kernel to allocate resources to run it as one or more processes.

The path to the Shell program search executable file is defined in the PATH environment variable: traverse the PATH environment variable contents from left to right

There are two types of commands that can be executed in the shell: built-in commands and external commands

Built-in command: comes from the shell and is provided by a command;

External command: There is a corresponding executable program file under a file system path of the current system

Use the command type to see if the command is an internal command or an external command.

The path has a relative path and an absolute path;

Absolute path: The path starting from the root directory

Relative path: Starting from the current position

Access to Linux command help

1. Internal commands: #help command

2. External command:

(1) #COMMAND--help

(2) Manual with man: #man COMMAND

(3) Information page: #info COMMAND

(4) Help documentation for the program itself:

Readme,install,changelog

(5) Official program document

(6) Official documents of the release version

(7) Google

Internal command help:

#help COMMAND

Hash command:

The path result of the external command that the shell has searched for is cached into the KV (Key-value) Store:

Clear cache: Hash-r

History: Historical Command:

When you log in to the shell, the commands that are recorded in the command history file are read: command history file: ~/.bash_history

Commands executed by the login shell are only recorded in the cache, which "appends" to the command history file when the user exits


History-a: Append the command History list for this session to the history file

history-d #: Delete the command specified in history

History-c: Emptying command history

Quick action:

!#: Call the section # command in history;

!string: Invokes the last command in history that starts with a string;

!: Previous Command

Help for external commands:

(1) Man COMMAND

Manual page:/usr/share/man

Man1.....man8

Man1: User Commands

Man2: System call

MAN3:C Library Call

MAN4: Equipment files and special files

MAN5: Configuration file format

Man6: Game:

MAN7: Miscellaneous

MAN8: Commands for managing classes

Some keys exist in more than one chapter help manuals; To view the manuals in the specified chapters: Man # COMMAND

Configuration file for man command:/etc/man.config

Where the Manpath: option is used to specify where to go to search the man manual page

Manpath/usr/man

Manpath/usr/share/man

Manpath/usr/local/man

Manpath/usr/local/share/man

Manpath/usr/x11r6/man

You can use man-m/path/to/somwhere command: To search the help manual for the specified command in the specified location

How to operate the man command:

Space, ^v, ^f, ^f: Flip the screen to the end of the file;

B, ^b: Flip the screen to the file header;

D, ^d: half-screen to the tail of the file;

U, ^u: Turn half screen to file header;

RETURN, ^n, E, ^e or J or ^j: Flip a line to the end of the file;

Y or ^y or ^p or K or ^k: turns a line into the file header;

Q: Exit;

#: Jump To Line #;

1 g: Back to File header

G: Turn to the tail of the file

Text Search:

/keyword: The string specified by KEYWORD as the keyword, from the current position to the end of the file search is not case-sensitive character case;

N: Next N: Previous

? KEYWORD: The string specified by KEYWORD as the keyword, from the current position to the file header search is not case-sensitive character case;

N: In the same direction as the Search command, the next N: the reverse direction of the search command, the previous

(3) Info:info COMMAND

(4) Help documentation for the program itself:/usr/share/doc/command-version

(5) Official program document

(6) Official documentation for the release: Http://www.redhat.com/docs

(7) Google

(8) slideshare:http://www.slideshare.net/


This article is from a "moment" blog, so be sure to keep this source http://zkchang.blog.51cto.com/10574636/1684923

Basics of Linux-basic concepts and simple commands

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.