Collect notes about Linux Shell

Source: Internet
Author: User
1 history

The history command lists used commands. the user's history command is stored in the. bash_history file in the user's home directory.

491 sync 492 logout 493 go-m3 494 logout 495 go-m3 496 go_m3 497 ll 498 ll bin/499 go-m3

Run the 495 command again:>! 495

Obtain the relevant parameters in the previous command: Command "! : N "indicates obtaining the nth parameter in the previous command, where! Prompt shell to obtain a parameter in the previous command. $ indicates the last parameter.

"^" Indicates replacement, for example,> ^ CD ^ CP indicates replacing the CD in the previous command with CP

Repeat the last command> !!

2. quickly return to the directory before CD

The variable oldpwd saves the directory path before the last command to use CD, so you can use the CD $ oldpwd command to quickly return to the directory before CD.

Related Article

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.