) Some easy-to-Forget Linux knowledge points

Source: Internet
Author: User

Some easy-to-Forget Linux knowledge points Favorites

 

0. Review the Linux knowledge you have learned and sort out some easily forgotten ones.

1. You can enter multiple commands at a time in the command line, separated by semicolons (;).

2. If the command is too long, you can use '/' (backslash) to disconnect and write data to multiple physical lines.

3. The write sequence of I/O redirection is important. The system scans the command line from left to right.

4. pipelines are a special type of I/O redirection.

5. Tee filename

6. No spaces are required for the examples in [...], which are case sensitive.

7. The LS command can be followed by multiple files to be viewed.

8. The quotation marks after the ECHO will be ignored unless otherwise escaped.

9. Double quotation marks cannot be escaped! $ '/{}, Which can be single quotes

10. The command history is saved in the $ home/. bash_history file.

11. The FC-s command is equivalent !! It is equivalent !! -1

12, history-C Clear history command

13. There cannot be spaces around the equal sign in the alias command to cancel the alias. The unalias command can be used.

14. Jobs fg bg kill & command for multi-task scheduling

15. The system source code is stored in/usr/src.

16. Linux does not impose any conventions on file names and does not explain the extensions.

17. The OD command is used to interpret binary files. It is displayed in octal format by default.

18. Hard connection requires two linked files to be in the same file system, while symbolic links do not.

19. Three file creation methods: Touch,> file, echo> File

20, LS-K is used to specify the size in KB, and-R is used to specify recursive display

21, CTRL + V can be used to represent a control character such as MV fi ^ vabc ^ vdkf... Of course, you can also use single quotes

22. The cat command can also be used to merge the file eg: CAT chap1 chap2 chap3> usrfile

23, more and less command keys: ispace, ienter, ID (upper half), IU (lower half), if, IB (more only) H (HELP)

24. The default value of head tail is 10 rows. You can explicitly specify the number of rows. Head | tail-| + 12 file tail-F file is dynamically displayed.

25, CP, MV, RM:-I prompt-F force-R (RM not) recursive file, folder applies

26. ln is used to establish the soft link (symbolic link) of The Link-s command)

27. Find and grep are followed by the regular expression "find". The start directory file-exec command {}/+ |;{} indicates the search result.

28, grep-inv Patten file I: ignorecase N: Display row number V: reverse, not included

29. Regular Expression:. Single Character + at least one character/escape ^ $ empty line

30, sort-NKr N in reverse order of the key column (-K5) of the number K (-K5) R (large-> small)

31. Shift + ZZ in VI is equivalent to ESC +: + WQ! + Enter fedora: alias Vi = Vim

The following shell programming aspects

32. Every time the system opens a process, it will execute ~ /. Bashrc file, which can be used for initialization of some functions

33, $? Last Exit status; $ # Number of location parameters (excluding $0); braces after 9: $ {10}; $ process number; $ _ last parameter of the previously executed command

34 ,#! As the shell flag code, it is usually written at the beginning of the program. There is no space on both sides of the = sign, and the environment variables are separated by colons.

35, random, cdpath, oldpath, PWD, PATH variable

36. indirect reference: res =$ {! VaR} Or Eva res =/$ {var}

37, $ {var}, $ {var: + |-| = value}, $ {var ###|? | ?? Pattern}, unset command

38. Exec Internal commands: I/O redirection (do not end the current process), execute commands that do not create a process (end the current process)
39. The READ command gives all the extra data to the last parameter,-S,-P (prompt), and-N options.
40, set -- if no options are provided later, all location variables are cleared. unset is used to clear Defined variables.
41. There are no quotation marks in the let statement, and there cannot be spaces between expressions. () can have spaces or no quotation marks, and the return value is the variable in it.
42, base # number indicates the base number. Base is taken from 2 ~ 64
43. Command replacement: $ (command) or 'command'. In Echo, use the command to replace it with double quotation marks. Otherwise, the line feed after the output data is discarded.
44. Process replacement: <(command),> (command) eg: Diff <(LS-l doc1) <(LS-l doc2)
45. Test statement: [], [[] at least one space is left on both sides. Escape is required in [], and [[] is not required.
46. File property test expression:-A,-rwx,-fdcbpl (uppercase),-NT (newer than)-Ot (older )! Non-logical
47. String test expression:-z (zero )"! -Z "(preferably with quotation marks),-N (strings must be enclosed in quotation marks) = <>! = (No space)
48, integer test expression:-eq-ne-GT-lt-ge-Le eg: [["123"-EQ "123"] returns 0 (true)
49. logical operators: (exp ),! Exp,-A (&),-O (|) string comparison space-time value with quotation marks, otherwise it is ignored
50 ,~ + Equivalent to $ PWD ~~ Equivalent to $ oldpwd eg: Echo ~ +
51. The last statement in the case Branch statement can be left blank;, ending with the esac mark
52, for, select statement if there is no in statement, the command line location parameter is used as the parameter table.
53, break [N], and continue [N] syntax functions are similar to C/C ++ jumping out of the external layer N. Break is equivalent to break 1
54. In the shell script, ^ [indicates ESC; here documentation can be used to annotate

55. There must be no space between the left and right parentheses in the shell function. If the left and right curly braces are in the same line, there must be two spaces before and after each statement. Besides a semicolon, there must be at least one space.

 


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.