Introduction to command history and shortcut keys

Source: Internet
Author: User

Command History Introduction

historyView historical tools;historyThe command displays more than the user's home directory.bash_historyThere is a command in this file to note that the newly built user will not have to log out to have this file, the file is stored in the command is the previous user logged on the command, and the user logged on after the system automatically loaded the command in this file into memory,historyIt also shows that the command that the user logged in will be cached in memory, and when the user exits normally, the command will be loaded into.bash_history650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/91129b63-20cc-4585-b330-d87814d34190 "alt=" description of the picture "Style=" border:0px;vertical-align:middle; "/>

The user executed the command to hold the file 650) this.width=650; "Src=" http://7xread.com1.z0.glb.clouddn.com/ D98b3835-09b0-4daf-bba7-8933509cd6ef "alt=" Picture description "style=" border:0px;vertical-align:middle; "/>

Repeat the last command

650) this.width=650; "src=" HTTP://7XREAD.COM1.Z0.GLB.CLOUDDN.COM/D3CEC369-78DC-4FEA-A842-2DE6BE8858BC "alt=" Picture description " Style= "border:0px;vertical-align:middle;"/> or 650) this.width=650; "Src=" http://7xread.com1.z0.glb.clouddn.com/ ecc5aec9-236f-4ecc-a8c0-d914390bb57a "alt=" Picture description "style=" border:0px;vertical-align:middle; "/>

! : 1 invokes the two segment of the last command and executes

650) this.width=650; "src=" Http://7xread.com1.z0.glb.clouddn.com/61437d19-b3f8-41c2-b527-636d7383d6c8 "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

CTRL + N Displays the next command of the current command Ctrl+j executes the current command! n Execute the history n command! -N means to perform the reciprocal n 650) this.width=650; "Src=" http://7xread.com1.z0.glb.clouddn.com/58262bf3-f944-450b-bf60-3655eccf8591 "alt=" Picture description "style=" border:0px;vertical-align:middle; "/>

Command line history 650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/c81befd2-c3e8-4175-9dc8-0f6f953a695b "alt=" Picture description "style=" border:0px;vertical-align:middle; "/>

! IC call the last command to start with an IC

650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/02e25012-edad-4aa1-84b0-0585b2f54466 "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

!? The previous command in the SYS call that contains a string;

650) this.width=650; "src=" Http://7xread.com1.z0.glb.clouddn.com/d4048876-48ec-4cee-b6bc-f3347de71c90 "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

Only print with! Xx:p followed by a string beginning with a previous command, not executing 650) this.width=650; "Src=" http://7xread.com1.z0.glb.clouddn.com/ 8fee7ddd-f0b1-4d37-bfa1-2dd98294b24c "alt=" Picture description "style=" border:0px;vertical-align:middle; "/>

Print only the last parameter of the previous command! Se:p 650) this.width=650; "src=" Http://7xread.com1.z0.glb.clouddn.com/1cfd01d7-5cd6-4d29-a904-79056a9c11af "alt=" Picture description "style=" border:0px;vertical-align:middle; "/>

! * Call the previous command all parameters 650) this.width=650; "Src=" http://7xread.com1.z0.glb.clouddn.com/ ca49163e-07b4-46b5-818c-c7d19b822d58 "alt=" Picture description "style=" border:0px;vertical-align:middle; "/>

^xx means delete the first parameter xx character at the beginning of the previous command

650) this.width=650; "src=" Http://7xread.com1.z0.glb.clouddn.com/a74c4f72-45f3-4e9e-a042-8f2e246618d6 "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

FFGG means replacing the first FF in the previous command with GG

650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/82e730e4-3be6-4e54-90ab-1b34cc9cc791 "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

Search all the FF characters in the previous command and replace the HH characters! : GS/FF/HH 650) this.width=650; "Src=" http://7xread.com1.z0.glb.clouddn.com/d9d435cc-967b-4928-8707-3b28c157e027 " alt= "Picture description" style= "border:0px;vertical-align:middle;"/>

Description of shortcut keys

650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/03b132d8-1527-4b83-b859-ae1126c7c60d "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

Call a parameter of the last command to do this command parameter 650) this.width=650; "Src=" http://7xread.com1.z0.glb.clouddn.com/ 61a4fce4-580d-450e-8430-42ae98f47d34 "alt=" Picture description "style=" border:0px;vertical-align:middle; "/>

History Introduction

650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/c75a523f-f9c2-43f9-b385-3b7a64638b64 "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

In/etc/profile define the History command bar number 650) this.width=650; "Src=" http://7xread.com1.z0.glb.clouddn.com/ 77d5f591-da03-412b-bb8c-f488f8fe6b6a "alt=" Picture description "style=" border:0px;vertical-align:middle; "/>

history -cClear History

history -d XDelete the x command specified in history

history -rRead all in-memory history command line append to file

history  -nThe history command line in the read memory is appended to the file, but the duplicate rows are ignored

history  -wSpecify a directory to save

650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/12b79e85-3417-43e4-8319-320e3fa002ff "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

history -pPrint parameters do not remember history 650) this.width=650; "Src=" Http://7xread.com1.z0.glb.clouddn.com/2fc9e13f-6fc7-43fe-8ddb-19aeba15eee1 " alt= "Picture description" style= "border:0px;vertical-align:middle;"/>

-S fake history history -s ‘rf -rf /*‘ list shows RM-RF/*

Set temporary add time 650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/a776f753-0508-43b3-ac63-018195007f01 "alt = "Picture description" style= "border:0px;vertical-align:middle;"/> Variable

650) this.width=650; "src=" Http://7xread.com1.z0.glb.clouddn.com/a289c553-f4eb-4e93-a42c-2860aa3eb4a3 "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

Histignore variable setting ignores a field

650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/15d6de96-8b9d-44bf-a558-3257cf3f19f3 "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

Set the variable file in the user home directory. Bash_profile 650) this.width=650; "Src=" http://7xread.com1.z0.glb.clouddn.com/ 3e1c0170-bbaf-4589-ad74-96269c5b541f "alt=" image description "style=" border:0px;vertical-align:middle; "/> Command history-related variables 650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/bfd9cd29-aa7c-4d3c-92ce-3a512203fd6d "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Introduction to shortcut keys

CTRL + L equivalent to clear screen, clear

o executes the current command and displays the current command

s block screen output and lock

Q Allow screen output

C forcibly terminate the command

Z Suspend command

650) this.width=650; "src=" http://7xread.com1.z0.glb.clouddn.com/4d1ff8ef-10c2-4c40-8973-a5c38ad3335d "alt=" Picture description " Style= "Border:0px;vertical-align:middle;"/>

Picture description

CTRL + A cursor moves to the beginning of the line

e cursor moves to end of line

f the cursor moves one character to the right

b Move one character to the left

XX move toggle at the beginning of the cursor and at the cursor

U delete from cursor at beginning of line

K Remove from cursor to end of line ALT + F cursor moves right one word ending

b The cursor moves to the left one word word head

R Delete entire line 650) this.width=650; "src=" Http://7xread.com1.z0.glb.clouddn.com/6a0776ca-4977-45a4-8354-6198347efa44 "alt=" Picture description "style=" Border:0px;vertical-align:middle; "/>de 650) this.width=650;" src= "http:// 7XREAD.COM1.Z0.GLB.CLOUDDN.COM/2C6C028B-343B-43E2-8E6C-6C46D8C1CD1A "alt=" image description "style=" Border:0px;vertical-align : Middle; "/>


This article is from the "11974994" blog, please be sure to keep this source http://11984994.blog.51cto.com/11974994/1928493

Introduction to command history and shortcut keys

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.