Six Practical Linux command finishing

Source: Internet
Author: User
Tags file system reset

1, cut back to the previous directory

The code is as follows:

CD-

The horizontal bar represents the path to the previous directory

-is actually a built-in variable $owd

  2. Replace a phrase from the previous command

The code is as follows:

^foo^bar^

The original style of this command should be

The code is as follows:

!!:gs/foo/bar/

!! Indicates that the previous command is repeated, with the following: Gs/foo/bar for the replacement operation.

 3. Quickly backup a file

The code is as follows:

CP Filename{,.bak}

Curly braces are an arrangement of meaning, you can try the following example

The code is as follows:

echo {A,b,c}{a,b,c}{a,b,c}

Will output the full array of three sets

The code is as follows:

AAA AAB AAC ABA ABB ABC ACA ACB ACC

Baa Bab Bac bba bbb BBC bca BCB bcc

CAA cab CAC CBA CBB CBC CCA CCB CCC

 4. Empty or create a file

The code is as follows:

: >file.txt

: is the shell default NULL function

 5, reset

The code is as follows:

Rest

If you have tried accidentally cat a binary file, it is likely that the entire terminal silly off, may not change lines, can not be back to show, large pile of garbled and so on, you may type reset command, no matter whether the command has shown, it will be able to return to normal

6, more friendly display of the currently mounted file system

The code is as follows:

Mount |column-t

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.