Linux operating system and common commands

Source: Internet
Author: User
Tags clear screen parent directory

First, the operating system


Shell


Gui:graphic User Interface GUI

Windows

X-window:

Gnome

Kde

Xfce


Cli:command Line Interface

Sh

Bash

Csh

Ksh

Zsh

Tcsh


Two major Lei Feng Laboratories:

Bell Labs

Xerox's Parc Lab: Ethernet, mouse, graphical user interface


Library files:


    1. . dll:dynamic link library, dynamic link libraries under Windows.

    2. . so:shared object, Shared Object, DSO, library under Linux


Second, Linux


Login interface


A created file does not want to be accessed by B and requires additional permissions on the file.

Permissions: Setting the ability to access resources


The fastest resource that a computer can handle is not a character, but a number.


Login

User name: User ID, user name is public, user name cannot be used as a qualified user can access the resource's authentication identity


Authentication mechanism: Authentication Identify the user is the mechanism of the person he claims, the password


Authorization: Authorization


Audit: Audition through the log to complete


Prompt: Command prompt

Command:

Binary program

Script file

Magic number: The Magic of the program

Shebang


#!/bin/bash


# Command Options ... arguments ...


Options: Modifying the execution characteristics of a command

Short options

Long options


Parameters: Specifying the Action object of the command



Folder:

Directory: path mapping, also file


Path: The location from the specified starting point to the destination,


File system: A mechanism for hierarchical file management in the filesystem.


Lists all directories or files under the specified path


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8C/49/wKioL1hpTfSilsAXAABQW1PQxVM047.png "title=" QQ picture 20170102024332.png "Width=" "height=" 296 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:400PX;HEIGHT:296PX; " alt= "Wkiol1hptfsilsaxaabqw1pqxvm047.png"/>


A node that can be forked is called a table of contents

A node that cannot be forked is called a file


Absolute path: A mechanism for finding from the root

Relative path: Looking at the current location

At any time after you log in to the system, at some point, you must be in a directory, which is called the current directory, or the working directory working directory,


Certain sub-directories on Linux: FHS file system hierarchy Standard


Third, the Linux command


1. ls

LIST:LS lists, lists

Is_

Lists the files under the specified path, and the directories are also files.

Direct enter, not with any parameters, nor any options, default, defaults, show current directory


Pwd:printing Working Directory


Top-level paths with/, delimiters between each path are also used/, Windows uses backslashes \


Ls/root


Blue: Directory

Green: Have Execute permission


Ls

-l:long long format

10 Bits: Leftmost:

File type: the

-: Normal file (f)

D: Catalog file

B: Block device files (blocks)

C: Character device file (character)

L: Symbolic Connection files (symbolic link file) Soft link file

P: Named pipe file (pipe)

S: Socket file (socket)

File permissions: Post nine-bit: file permissions mod, per three-bit group, each set R read, W write, X executed,

If there is no corresponding permission, use-Indicates

Number of hard links to file:

Owner of the document: Owner owners

Genus of files: group

File size: Default unit byte

Timestamp: The last time the modification was taken.

Each file has three timestamps, timestamp,

Last visited time, access

Last modified time, modify file contents

The time of the last change. Change file's attribute data, also called metadata metadata

Filename


-H: Unit conversion EG:LS-LH

Human readable

-a:all hidden files with. opening

. Current directory

.. Parent directory, top level directory of current directory

-A: Hidden files, not included. And..

-D: Displays the directory itself property Eg:ls-ld/root

-I: Displays the index node number for the Inode file.

-R: Reverse Display

-R: Recursive (Recursive) display


2. CD


Cd:change Directory Switch Directories

Home directory: No parameters: Back to the user's home directory, home directory

Under Bash, each user's home directory uses ~ to represent, CD ~

CD ~ USERNAME: Administrator CD + ~ + user name, go to the designated user's home directory

CD-: Switch back and forth between the previous directory and the current directory


3.type


Linux Command Type

Built-in command: Shell built-in

External command: There is an executable file corresponding to the command name in a path on the file system


Environment variables: Used to define the work environment of the current user, specifying the properties of the work environment


Variable: is a named memory space

Variable assignment: Put the data in the memory space of the name


Heap: Heap

Where other applications save data, not variables, but need to save the data

For example, open a file, this file to open, you need to apply for a memory space.

This file is to be opened by the program and must be applied for memory


Stack: Stack

Locally declared variables and static variables



Type: Used to show which type the specified command belongs to


4. Clear Clear Screen


5. PRINTENV Display Environment variables


HOSTNAME: Host Name

Term: terminal type

Shell: the shell program used

PATH:

Path=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

Use: Split a bunch of paths,

When the command is executed, the command is searched in sequence from the path specified in path and is found

The first time it is found, then it is cached in memory.


If a command is to be executed without a path, it must be a command under path, if not, to execute.


6.hash


Cached commands (number of hits, command path)

Hitscommand

1/usr/bin/printenv

/bin/ls

4/usr/bin/clear


Cache for King Cache is king


Hash hash, key value pair, key value database

The speed of finding data in the key-value library is O (1)


Big O: Large o logo,

A standard for measuring the speed of a program's execution

A function scale, or trend, that changes the speed of a data from one list to the length of a list.


O (1): No matter how long the queue is, the time it takes to find a data from it,

Find from one and 10,000, same time

A hash is a single comparison and is indexed, much faster than it is found in the file system.


7. Date


-Show system time of the current period

-Modification Time


The time implementation mechanism of Linux


The computer shuts down, the next turn on, the time display is still correct

There's a button battery on the motherboard.

Rtc:real Time Clock

Ntp:network Time Protocol Network Timing Protocol


Linux will read the time through the RTC when it is powered on, and once the read is successful, it will no longer be used. The operating system itself, in the form of software, simulates the oscillator and maintains a time within the system.


-Hardware Clock

-System Clock


The date command sees the system time, wants to see the hardware time, uses the clock or the Hwclock command, hardware clock


HWCLOCK-W: Modify the hardware time, synchronize the system time to the hardware time to

Hwclock-s: Modify the system time to synchronize the hardware time to the system time



8. Man


Get help with the use of commands:


-Internal Command

Help COMMAND

Command-h


-External command

COMMAND--help



Command manual: Manual internal Command, External command universal, press Q to exit

Mans COMMAND


Whatis Comman: Displays summary information for the command, and in which section it appears


Man has chapters, usually 8 chapters


1: User commands (/bin,/usr/bin,/usr/local/bin)--users, administrators can use

2: System call

Mans Read

Man 2 read: Show the contents of the 2nd Chapter

Export lang=en

Man mount: If you do not specify a chapter, the first time the command appears in the section, it displays a few

Not all commands are in the first chapter.

3: library Call

4: Special files: (device files) is a relatively unique file, in the data area on the disk there is no content, just as the access to the device exists, not a real file

5: File Format (configuration file syntax)

6: Game

7: Miscellaneous Miscellaneous

8: admin Command: (/sbin,/usr/sbin,/usr/local/sbin)--Only administrators can use

You can modify hardware parameters, modify hardware performance, and other system-level configurations



[]: Indicates can be omitted

| : Two select one, or more than one, cannot be used at the same time

<>: What must be given

...: can occur multiple times

{}: Grouping, no special meaning


Mans

Name: command names, and instructions for brief use of commands

Synopsis: Usage notes, including available options

DESCRIPTION: A detailed description of the command function, including the meaning of each option

Options: Explaining the meaning of each option

Files: The configuration file associated with this command

BUGS:

EXAMPLES: Using the example

See ALSO: Another reference


Flip Screen:

Turn back one screen: space spaces

Turn One screen forward: b

Turn back one line: Enter enter

Turn One line forward: K


Find:

/keyword: Backwards

N: Next

N: Previous

? KEYWORD: Forward


Exit:

Q



9. Hwclock


HWCLOCK-W: Modify the hardware time, synchronize the system time to the hardware time to

Hwclock-s: Modify the system time to synchronize the hardware time to the system time



Ten. Info


Online documentation


Info COMMAND: Introduction to Development history, Man's supplement


Cd/usr/share/doc: Most (not all) commands have a document that uses and helps explain


One . Cal


Cal:calendar












Linux operating system and common 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.