Basic Linux Knowledge

Source: Internet
Author: User
Tags aliases clear screen echo command echo display set background

I. Linux Philosophical thinking

1. All Documents

2. A small program consisting of a single purpose, combined with a small program to complete complex tasks

3. Avoid interaction with the user (avoid graphical interface, the GUI is more prone to bug, poor stability)

4. The configuration data is saved in a text file (the configuration file can still be opened and repaired when the system is not started)


Two. Common release versions

Slackware:suse Linux Enterprise Server (SLES)

openSUSE Desktop
Debian:ubuntu,mint
Redhat:rhel:redhat Enterprise Linux
Release a new version every 18 months
CentOS: Rhel-compatible format
Kirin: Winning software
Fedora: Release of a new version every 6 months (Rhel test Platform)
ArchLinux: Light weight and simplicity
Gentoo: Extreme Performance with no traditional installation program
Lfs:linux from Scratch:diy Linux
Android:linux Kernel+busybox+java Virtual Machine


Three. Linux Section basic commands

    • Command prompt: Prompt
      [Email protected] ~]#

      Where: Administrator login prompt: #

      Normal User: $

    • Command basic format: command "Options" "Parameters"

      Short options:-A, Eg:-a-b-C

      Long option:--word, eg:--all

Parameters: The object of the command, such as file name, user name, etc.

Common tip:

1, multi-options, and multi-parameter and command separated by using white space characters

2. Cancel and End command execution: CTRL + C, ctrl+d

3. Multiple commands can be used; separate symbols

4, a command can be divided into multiple lines

(Note: The Long tab is not supported in CentOS 6, 7 can)

    • Disable command: Enable-n + command

    • Command aliases alias (priority: aliases > Internal > Cache external > External)

Format alias New_command = 'commmand[options]'

No aliases: which + command

\ Command

' command '


    • Whereis querying files and location information for help documents

    • Hwclock, clock display hardware time

Date Display system time

Hwclock-s the system time, whichever is the hardware time

-W with system time, correct hardware time

    • Calendar cal

Format: Cal Monthe year (months-years)

    • The remote interface is implemented under the screen CLI

Note: The remote host needs to SSH to the host that opened the screen session and log on with the same user

Screen-s name New Session

Screen-ls shows which sessions can be joined

Screen-x name Join session

Screen-r Name Recovery Dialog

Exit to quit the current session

Peel the current screen:

Ctrl+a,d

    • Echo

"" Double quotes, weak references, equivalent to not using quotation marks

' Single quote: internal As String

"(As with parentheses): The execution result of the command within the reference symbol

echo Command options:

-N does not wrap characters at the end of the line

-E If the following character appears in the string, it is handled in particular, not as a general text output:

\a issued a warning sound;

\b Backspace key

\c finally not add the line break symbol;

\ n Wraps and the cursor moves to the beginning of the line;

\ r The cursor moves to the beginning of the line, but does not wrap, and the contents after the \ r will overwrite the previous content

(EG:ECHO-E ' hello\rxxx ' output result: XXXLO)

\ \ insert \ character;

\0NNN insert ASCII character represented by NNN (octal)

Echo-e "\033[43;31mred color\033[0m"

\XHH Insert the ASCII character represented by the HH (hexadecimal)

Eg:echo ' \a ' will issue a warning note: There are single quotes

       

echo display with color, need to use parameter-E

The format is as follows:

Echo-e "\033[word background color; text color m string \033[0m"

For example:

Echo-e "\033[41;37m Tonyzhang \033[0m"

Where 41 of the position represents the background, 37 of the position is the color of the word

Note:

1, the word background color and the text color is the English "" "

2. There is a m behind the text color

3, before and after the string can have no space, if any, the output is also a space

Eg:echo-e "\033[30m Black character \033[0m"

Echo-e "\033[31m Red word \033[0m"

Echo-e "\033[32m Green word \033[0m"

Control Option Description:

\33[0m Close all properties

\33[1m Setting High brightness

\33[4m Underline

\33[5m Flashing

\33[7M Reverse Display

\33[8m blanking

\33[30m--\33[37m setting foreground color

\33[40m--\33[47m Set background color

\33[na the cursor to move n rows

\33[NB cursor down n rows

\33[NC cursor right shifts n rows

\33[nd cursor left n rows

\33[Y;XH Setting the cursor position

\33[2J Clear Screen

\33[k clears the contents from the cursor to the end of the line

\33[s Save Cursor position

\33[u Restore cursor Position

\33[?25l Hide Cursor

\33[?25h Display cursor

    • Reset Use this command to restore when an unexpected system error occurs

    • Help:

Whatis (View the function description of the command)

Command--help

Mans

Local Help documentation:/usr/share/doc/

    • Create a database: When the system is ready and requires a database, and you have not built a local database, you can use

Make+command (no spaces)

MANDB (for Centos7)


Basic Linux Knowledge

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.