Linux common instruction set

xiaoxiao2021-03-06  40

Installation L INUX Change System Tips Symbol User Information L INUX SHELLSCRIP TS Switch Virtual Main Control Service LS Lists Archive Information L INUX S Hel LL N Making Jewprint Artributes, Directory Represents Color Cat Display Archive Content Archive Properties More Show Profile Content (Pause) Root Catalog MV Change, Mobile Directory, or Archive / Proc Archive PWD Show Current Work Directory Path Terminal Terminal Data Setup Passwd Change Password How to Set Document Other RM Delete Archives or Directory CP Copy Archive Mount Mount File System Mkdir Create a subdirectory Umount Remove the Mounting Archive System CD Transfer Directory MKE2FS Production Archive System RMDir Delete Subdisco AddUser New User GREP Use Keyword Profile CHMOD Change Archive Profile Properties DD Font Code Converter Chown Change Archives or Directory DF Query Du Query SU Super User DU Summary Display Space WHO Display Current Line User Find Profile, Directory W Display Current Line User FSCK Check, Fix L INUX Archive System VALL Transfer Information Write Transfer Message For a user UNAME Query L INUX version MESG Y or MESG N Set Transfer Message Free Query Current Memory The UPTIME Shows the current user and the flat load SYNC writes the information in the memory to the hard disk FTP file transfer Date display date, time telnet connected to other machines Shutdown shutdown Rlogin connected to other machine Reboot Quick Shutdock NetStat Query Network Current Status Top View System Status NSLookup Query IP and Domain Name PS View System In Executing Program Information Finger Lists Someone's Line Information Kill Termination The Executive Ping Query The host does a host on a manager inquiry a command of a command crontab setting period Help Querying an instructions for an internal instruction NOHUP Settings Exit System After Termination WHEREIS Looking for a file location of an instruction location Echo print string LOCATE Finding file Clear Clear screen Whatis Query a certain instruction to make the background to perform AT Set a certain time to execute a certain instruction CAL display how the calendar is on a single network card. Bind multiple IP

Install Linux:

Prepare two magnets:

Bootdisk:

Rawrite Bare.i A rootdisks:

Rawrite Color.gz a FIPS (attached to the installation) or fdisk Hard Discontebit BootDisk back up and turn back the board; Boot: Press

User information: / etc / passwd

Switch virtual main control desk: Alt F1, Alt F2, .........

Linux's shell: (Simmand.com like DOS):

TCSH or BASH (internal to Bash)

Type exit to return to the last layer shell or leave the system

Archive, directory representative color: / etc / dir_colors

Directory (Blue) General Archive (White) Operation (Green) Monarch (Pink) Symbol Connection (Indigo) System Equipment Yellow Compressive Dress (Red)

Archive properties:

Nature Archives Other Group of Users DRWXR-X - X indicate that the files are readable and writable; the group users can read; other users can implement

Use permission for the directory:

r -: You can only read; you can write any files in the directory instead of editing or reading the file - W-: You can only write; but you can't build a directory or copy profile to go in -X: CD in this directory, but Unable to use ls rw-: You can see these files in this directory; but you can't go in this directory, you can't use LS -L, you can't edit your directory, you can't copy the file in this directory, you can go in this directory, you can use LS, but you can't Copy file into -WX: You can go in this directory in CD, you can copy the file in the file; you can't use the LS nature: - General file; D directory; L symbol connection, C-character device B block device (such as hard disk); Socket (such as / dev / printer printing machine); P a PIPE

Directory instructions under the Linux root directory:

Directory Name Description Example BIN system Some important execution files KILL, CP, DFBoot system boot some of the loaded CDROM discs in the form of the CDROM CD Mounting the DOS archive system hung up the DOS archive system to set the file Home ETC system The user's own directory, the FTP Server LIB basic functions library Lost Found system check results MNT can hang other archive system ProC's operating information root system manager's own directory Swings some setup executable, set network TMP Miscellaneous TMP USR Application X-WINDOWVAR records in VMLinuz system core archives / proc in various systems:

More cpuinfo: Show information about CPU more devices: block devices, valers, ... The output / input of each device is the address of the address of the Add: Memory Allocation Status More PCI: Displays the PCI interface message

Terminal data setting file: / etc / termcap

Export Term = VT100 (Setting Terminal is VT100; Bash Shell)

How to set an alias of the instruction: Example: Set the LS -L to DIR

Alias ​​Dir = 'ls -l' (later DIR instructions is equivalent to the lower LS -L instruction)

How to change the system prompt symbol:

PS1 = 'parameter' (prompt symbol of general instruction column)

PS2 = 'parameter' (when the instruction is too long, the second line of prompts are required)

PS1 parameters:

/ h Host Name / W At the time of the directory / s shell name / $ is displayed when the user is ROOT; other users displays $ / t to indicate / d in the date to represent / u Current user code / # 指 能 /! The history serial number // display / symbol string of the instruction: Show this string

LINUX Shell Scripts (similar to DOS)

Example: Make similar DOS DOSKCOPY external instructions

Archive Name: DiskCopy #! / Bin / shecho -n "Insert Source Disk in First Floppy Drive, Then Hit Enter" Read Ans; DD if = / dev / fd0 of = / tmp / dcopy $$ echo -n "Remove Source Disk And Insert Other Disk, Then Hit Enter Read Ans; DD of = / DEV / FD0 IF = / TMP / DCOPY $$ / BIN / RM -F / TMP / DCOPY $$

Remarks: No side file name; change the file properties to be executable; case chmod 755 DiskCopy

Ls: List the file information → Similar DOS DIR

-l: List detailed archives - A: List all files include hidden files -R: handback lists all subdirectories and files under profiles and subdirectories - X: List in multi-column, alphabetical order From left and right -i: listed in i -Node, each file will be listed in the number of the number in the disk: List the file with a comma, partition-N: Put the group and archive owner name Transmends digital code-T: Sort by the modification time of the file (by new and old) -u: Sort by the last access time (need to cooperate with T) -S: file size in block (each Block Block = 512 BYTES - -O: Use color to display various categories of archives -R: display -D: only display the directory message and non-touching file LN production shortcut:

LN - parameter existing files to be connected

LN - Parameter original directory to be connected to the directory

Parameter Description:

Do not: preset value; only links between the same archive system, and cannot connect to the directory S: can be connected between different archive systems, and can connect to the directory f: If you want to connect the archive already existing, cut off this Exemplard file N: If you want to connect, you will stop the connection, you will not cut off the file.

Cat: Display file content (similar to DOS TYPE)

CAT - parameter file name

If you do not add parameters: CAT new file (similar to the new CON new file name of DOS)

Follow CTRL D and store

More: Display the contents of the file, if more than one page is paused (similar to the DOS more)

More - parameter file

Directive | More (Similar DOS instructions | more; like Type Diction Name | More)

Parameter Description:

P: First Clear the screen and list the c: Each page is clearly listed again S: If there are many consecutive blank columns in the file, only one column L: ignore the page symbol in the file

MV: Change, mobile directory or file (similar to DOS REN, MOVE)

MV - parameter source file (or directory) destination file (or directory)

Parameter Description:

B: Make backup before movement V: Show the mobile situation after doing the move, F: Forced movement, will not ask if the user is confirmed

PWD: Show current working directory path

Passwd: change password

RM: Delete Archives or Directory (Similar DOS DEL, DELTREE)

RM - parameter file or directory

R: Delete the file and directory (similar to DOS DELTREE) i: Delete When it is warned F: When deleted does not make a warning D: Delete the directory, even if the directory is not empty

RM -RF ABC // Remove all the files under the ABC folder and folders

CP: Copy Archives (Similar to DOS COPY)

CP - Parameter Source Start (or Directory) Destination (or Content)

A: Copy directory, keep all information, including the file D: Reserved file S: Manufacturing symbol connection F: Copy When the same file name is directly cleared, I: Copy When the same file name The file does not cover the cover and will make a warning L: not copy, but the file P: Retention file modification time and access rights R: copy, including the files and directories

MKDir: Create a subdirectory (similar to the MD)

MKDir - Parameter Directory Name

P: Continuously establish more than two non-existent catalog M: Set this directory Access permission CD subdirectory name → Transfer directory (similar to the DOS CD)

CD ~ → back home directory .. Separating symbols / non-DOS for the previous directory \

RMDir: Delete subdirectory, must be empty catalog (similar to DOS RD)

RMKDIR - Parameter subdirectory name

P: If this directory is deleted, the upper directory turns into a null directory, then delete

GREP: Find files with keywords

GREP - Parameter 'String' To find the source file

Number: Lists the file name of the string and the contents of several lines before and after the string: List the file name of the string and a few lines of the content B number after the strings: List the file name and word of the string The contents of a few rows of strings C: Display the number of findings, does not display the contents of the file H: Will not display the file name, only display content i: ignore the case L: Only display the file name M: only look for String is exactly the same

DD: The word conversion will write the information on the flop to a file or write a file into the disk.

DD if = input file or device name OF = output file or device name

Skip = blocks → Skip the number of blocks reading the buffer

BS = bytes → Set the read / write buffer BYTES

CBS = bytes → One converted bytes

Ibs = bytes → Read into Buffer

Obs = bytes → Write the BYTES of the buffer

Count = Blocks → only write block

CONU =

ASCII → transfer EBCDIC code to ASCII EBCDIC → transfer ASCII code to EBCDic IBM → transfer ASCII code to IBM Block → turn the change bit into a fixed word UBLOCK → turn the fixed bit into a variable vier LCASE → turnover Change lowercase ucase → turn lowercase to change SWAB → Exchange each group of bytes → ignore error NOTRUNC → Do not interrupt Truntate's output SYNC → fill in the block size specified by IBS

DF: Query the amount of hard disk

A: Display all file systems and disks of each division area I: Display i -nodes Using the amount of usage K: Size with K to represent (preset value) T: Display all split area disks of a file system Usage x: Displaying all split area disk usage of a file system T: Display the file system name to each split area

DU: Sub-disc use space for querying files or directories

A: Displaying the disk space of each file in all directories and its subdirectory B: Size with Bytes (the preset value is k bytes) C: Finally, add the total (preset value) L: Calculate all Archive Size S: Only the total sum of each file size x: only calculates the files of the same archive system L: Calculate all file size

Find: Find files, catalogs

Find [Start Directory] -Name 【的 名】 -Print

Looking for files from the starting directory; use the multimetric character * must be added between the files

FSCK: Check, fix Linux file system

FSCK - Parameter Split Area Name

A: Automatic fix R: Execution, please ask V: Each step Time when the display is processed: Specify a file system n: Do not really implement, only do those motion

Mount: Mounting the archive system

Mount - Parameter device name storage directory

MOUNT IP address: / supplied directory stored directory

Equipment Name: Such as / dev / hda2, / dev / fd0 storage directory: must be existing directory unparalleled: display currently listed file system, directory A: Mounting / etc / fstab System T: Specifies the name of the file system (see / proc / filesystems) N: Write the file system information when the archive system is not written to / etc / mtab W: file system settings to read and write : The archive system is set to only example: mount -t iso9660 / dev / hdd / cdrom hangs the disc machine, put the Data of the disc in / cdrom directory

Umount: Remove the filed system

Umount is already hung by a directory or device name

Example: Umount / CDROM → Remove / CDROM Directory

MKE2FS: Making Archives System (Similar DOS Format)

MKE2FS - parameter device name

AddUser: New users

CHMOD: Change the file rights attribute

CHMOD □ □ □ Name → □□□ Representative 雍; group; all users

Example: 111 101 101 → □□□ = 755;

Etienale readable, write, execute, group and all user readable, executive

Chown: Change the owner of a file or directory or has a group

Chown - Parameter owner (or a group) file

R: The files and their subdirectories in the directory and the owner V: Show messages after execution

SU: Enhances a common user as a super user

WHO: Shows current online users

-m: Display itself - Q: Display user account and line number -i: Display user idle time -w: Display line users can use Write transfer messages to him

W: Display the current online user (can display the instructions being executed)

VALL

Write: Transferring a message to a single user

Write user account Terminal Name

MESG Y or MESG N: Set whether to let others send messages to self

Talk user account Terminal Name: Chat with others

SYNC: Write the information in the memory to the hard disk

Date: Date, time

Shutdown: shutdown

Shutdown - Parameter Time Message

K: Not really shutdown, just send a message R: Reputation after shutdown H: Do not reboot f: Quick shutdown N: Quick shutdown Signal interval for stays available for NOW or any number (representative minutes)

Reboot: Quick shutdown (similar to the Alt Ctrl Del "

Top: View the system status; update every second, press Ctrl C to end

PS: View Program Information in the User In the System

-l: Long Format Display -u: Display User Name and Start Time -i: Displays Detailed Implementation of Each Program - S: Display Virtual Memory Usage - M: Display Memory Body allocation case -F: Display execution road group -a: other user execution program one and display -X: Display all programs -R: Show Prospectus - C: Only the name of the execution : Display execution environment variable -f: does not display the title bar-W: If the message cannot be accommodated, the chalp is displayed the kill: the execution of the termination (with PS instruction)

KILL program number (PID) → Execution of the forced termination

Kill -l → list all signals

UNAME: Query Linux version (/ proc / uname)

Free: Query the current memory of memory

Uptime: Shows the current user's peaceful system load

FTP: Archive Transmission

FTP ipaddress

FTP 127.0.0.1 → Connecting from your own computer

!: Temporarily leave FTP back to your own computer, exit returns to ftp bin: with binary mode FTP GET: Download file → get file name [new file name] MGET: Download multiple files → MGET file name → Can you use * or? PUT: Upload file → PUT file name [new file name] MPUT: Upload multiple files PROMPT: Volume mode switch → Preset value is OFF BYE: End FTP

Telnet: connect to home machine

Telnet ipaddress

Telnet 127.0.0.1 → Connect from your own computer

Rlogin: Even to other machines

Rlogin -L check-in account IP

NetStat: Query the current situation of the Internet

-A: All listed - R: Recent a few seconds - I: Interface Status - N: List of network connection sites replace the name of the Name - O: List Time Status - R: Column Outline path table-T: List the connection scenario of TCP protocols - UDP protocols - V: List publication - W: List the information of the RAW program connection - X: List about UNIX Domain Socket

NSLOOKUP: Query the IP address of a machine and its corresponding domain name

Finger: List the online information of someone

Finger - Parameter user name

S: Use a short format to display the user's information L: Use a long format to display the user's information P: Use a long format to display the plan file and some file file

PING: Whether a host on the online line is on

PING - Parameter host address

C Summary: Send a few packets to this host, then wait for the response D: Set the SO_DEBUG Option F: a large number and fast send network package to a host, see it's response I seconds: set a few seconds to send a package Give a host, the preset value of 1 second q: does not display the information of the package, only the last result 1 is the number of last results: in the fastest way, send a package to a host

MAN: Query the auxiliary instructions for an instruction → MAN Directive Name

HELP: Query an instructions for an internal instruction → Help built-in instruction name

Whereis: Find a file location of an instruction → WHEREIS instruction name

LOCATE: Find file → locate related words

WhatS: Query the purpose of an instruction → Whats command name AT: set a certain time to perform a certain instruction

Crontab: Setting instructions per day or monthly per month

NOHUP: After setting the exit system, the program is still not terminated.

Echo: Printing Strings

CLEAR: Clear the screen

Instruction & → ​​Get the program

CAL month: Show the monthly calendar

-J: The day showing the query is the first day of the year - Y: Show the monthly calendar

转载请注明原文地址:https://www.9cbs.com/read-62284.html

New Post(0)