Several shell commands)

Source: Internet
Author: User

1,! $Is a special environment variable, which represents the last string of the previous command. For example, you may:

You can change it:

$ Mkdir mydir

$ MV! $ Yourdir#$ MV mydir yourdir

$ CD! $ 

2,^ Old ^ new

Replace some strings in the previous command.

Scenario:Echo "wandreful"In fact, it is intended to outputEcho "wonderful". Only^ A ^ oThat's all. It can be of great help for spelling long commands. (Chen Hao Note: it can also be used!! : GS/old/new)

3List the largest objects in the current directory

Du-S * | sort-N | tail-N 3

4,Date-d @ 1234567890

Time cut-off time

5,Man ASCII

DisplayASCIICode table.

6, Listening port

Netstat-anOP | grep SSH

Netstat-Tlnp //Listening port

7,SSH user @ server bash </path/to/local/script. Sh

Run a script on a remote machine. The biggest advantage of this command is that you do not need to copy the script to a remote machine.

SSH user @ host CAT/path/to/remotefile diff/path/to/localfile-

Compare a remote file with a local file

8,Vim SCP: // username @ host // path/to/somefile

VimA Remote File

Original article:

Http://news.cnblogs.com/n/164643/

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.