Shell Learning 1

Source: Internet
Author: User
Tags clear screen

1.history Save History Command 1000, history-c empty;

2.! String calls the most recently used command,! Vim's most recently used vim,! N calls the last Ming ' l,!242 that begins with N to invoke the No. 242 command in history.

3.alias Rename, alias h5= ' Head-5 ', unalias h5 cancel renaming.

4.| pipe break, connect multiple commands, redirect output from one command to another PS aux|grep MySQL, or ifconfig eth0|grep ' inet addr ' filter packets containing IP addresses, echo "Pass" | passwd--stdin Tom sets the user's Tom password to pass

5.> and >> output redirection,> overwrite,>> append. ls > list.txt Save the LS output to List.txt,hostname >> list.txt append host name to List.txt, ll ABC Install.log 2> Error.txt only redirect error output to Error.txt, ll ABC install.log>>all.txt 2>&1 append standard output 1 and Error output 2 to All.txt

6.shortcut key Ctrl + A moves the cursor to the beginning of the line,ctrl+e move to Behavior,Ctrl +F Move one right,Ctrl +b Move one left, Ctrl +l Clear Screen, Ctrl +u delete the cursor to the beginning of the character,Ctrl +K Delete the cursor to the end of the line character, Ctrl +c terminates the process,Ctrl +Z hangs the process, tops can view,Ctrl +W Delete the previous word (separated by a space) of the cursor,Ctrl +D Delete one word after the other

7. Command sequence using:& to open the child shell, so that running in the background, Firefox & will open the front of the program background execution, tops view, FG 1 back to the foreground execution;

& Make foreground program, suspend to backstage, CTRL + Z make program pause and suspend to backstage. FG 1 is recalled to reception.

&& multiple command combinations executed, but must be executed successfully before the next command, make && make Install,ls test.txt && cat test.txt;

|| Multiple command combinations, but the previous command must not execute successfully before the next, id Tom &>/dev/null &&echo "Hi, Tom" | | echo "No such user", mask the ID output via &> redirect, then && and | | Judge the display language. --20150615


Shell Learning 1

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.