Linux Command Line concise tutorial

Source: Internet
Author: User
  1. Any system is divided into the core layer and the application layer. The core layer operates hardware devices directly, manages the execution of various software, and manages users of various computers. The Application Layer generally uses interfaces provided by the core layer to work.
  2. A feature of Linux: multiple users. In this system, there can be multiple users who may have their own directories and can use or even control different parts of the system.
  3. Root is an account set up in Linux for system maintenance.
  4. Linux is a preemptible multi-task system. Each process has a priority.
  5. Every Program executed by a computer is called a process.
  6. The directory system in Linux is a reason for the mounting system to combine the directory systems under each partition into a tree-like whole.
  7. Two types of link: Symbolic Link and hard link. A symbolic link is a file that contains the relative path of the target file. When you access this file, the corresponding file is automatically accessed through the relative path. If the relative path is invalid, the symbolic link is invalid.
  8. System files, such as/bin and/usr/bin, all directories and file owners are root. The owner of directories and files created by individuals is the creator himself. Directories and files also have the concept of "all groups", that is, the group where the owner is located.
  9. The Linux kernel uses the ANSI internal code.
  10. Ls --- list files and list directories and files, just like the Windows dir command. Usage: ls [parameter] [file name]
  11. Parameter:-a lists hidden files, that is. -d. When searching for a file with wildcards, it may find the corresponding directory, and ls will display the content in the directory; -h can make the method of displaying the file size more user-friendly;-l lists the permissions, sizes, and other details of the file;-L in the case of a link, displays the location of the actual file.-r sorts the files in inverted mode.-R recursively lists all the files in subdirectories in a directory.-S sorts the files by file size; -t is sorted by the last modification time of the file.-X is arranged by the file extension to facilitate the identification of files of the same class.
  12. Cd --- change the current directory. Usage: cd [Directory]. Represents the current directory, and... represents the previous directory. Return to the home directory without adding parameters.
  13. Pwd --- display the current directory
  14. File --- identify a file. Usage: file [parameter] [file name]… Parameter:-z if the file is compressed, an attempt is made to obtain the original file type;
  15. Cat --- displays all the content of the file. Usage: cat [parameter] [file name]… Parameter:-B only displays the row number for non-empty rows;-E shows the "$" character at the end of each row;-n shows the row number for all rows.
  16. Multiple File names can be entered in sequence and separated by spaces. In this way, these files are output in sequence. To read the output on screen, you can use the more command.
  17. Head/tail --- displays the content of the front and back parts of the file. By default, the head displays the first 10 lines of the file in sequence, and the second il displays the last 10 lines of the file in sequence. Usage: head/tail [parameter] [file name]… Parameter:-c N indicates the content of the first (last) N Bytes, and-n indicates the content of the first (last) N rows.
  18. Od --- special file display tool. Usage: od [parameter] [file name]. Parameter:-a radix indicates the output mode of the output data at the position of the file;-j BYTES skips the beginning of the file BYTES and then outputs; -n bytes only read the BYTES of the file.-t TYPE: select the output style.-w BYTES: specify the number of words output per row. The options of RADIX include: d decimal output, o octal output, x hexadecimal output, and n. TYPE options: a is output according to characters, including the names of output controllers that cannot be output (ASCII code less than 32) and c ASCII characters, then, the symbols in the \ format of C are output. The d SIZE is in the unit of SIZE, and the data in each unit is converted into a signed integer.
  19. Mkdir --- create a directory. Usage: mkdir [parameter] Directory Name. Parameter:-p can use this command to create a very deep sub-directory. It will automatically create the corresponding parent directory structure without reporting an error.
  20. Rmdir --- Delete the directory. The parameter is the same as mkdir. Only empty directories can be deleted.
  21. Rm --- delete a file or directory. Usage: rm [parameter] File Name/directory name. Parameter:-I is prompted every time a directory is deleted.-r is used to delete the entire directory and connect to the same heap subdirectory;
  22. Mv --- not only used to move files. Usage: mv [parameter] source file destination location [+ file name]. Parameter:-B if the target file exists (that is, there is a duplicate name), a backup is created. This backup is added with the source file name ~ Symbol;-f is forcibly moved. It is the default option to overwrite the target file when it exists.-I and-f are the opposite. If you want to overwrite the object, first ask if you agree; -u update and move: the source file is moved only when it is later than the last modification date of the target file or the target file does not exist.-v shows the moving process.
  23. Cp-copy a file. Usage: cp [parameter] source file. Parameter:-H: When copying a file, if a link is reached, it will be copied together with the original file to which the link points;-l does not copy the file, but just creates a corresponding hard link; -L copy with the symbolic link;-p copies with all attributes, including the last modification time;-P and-L are opposite. If the symbolic link is disconnected, the copy is forced; -r-R copies the entire directory tree;-s only creates a symbolic link.
  24. Ln-create link
  25. Find-search for files in the file system
  26. The difference between locate and find is that the find command accesses the file system to search for files, while the locate command accesses the database to search files.
  27. Grep-search for a specified string in a file
  28. Diff-compare files by line: Compare the size of two text files. Usage: diff [parameter] File 1 file 2. Parameter:-I ignores the case sensitivity,-E ignores Tab tabs,-B ignores consecutive spaces, and-B ignores empty rows; -w comparison, do not use all spaces;-d try to find the same place, that is, try to find the intersection of the two files;-r compare the two directories, in addition, the files in the subdirectories are compared;-y is divided into two columns for comparison. Compare the original files displayed in the two columns on the screen respectively. Where is the difference produced by-p? C function?
  29. Cmp-compare files by byte. Usage: cmp [parameter] File 1 file 2 [-I [skip 1] [skip 2]. Parameter:-B Outputs different places and outputs them in character form.-I skips several bytes starting with two files, which is determined by [skip 1. If [skip 2] exists, [skip 1] bytes for the first object and [skip 2] bytes for the second object; -l outputs all the differences. By default, the comparison is stopped as long as there are differences.-n bytes only compare the content of the previous bytes, and bytes is calculated in bytes.
  30. Comm.-Sort objects in a better order: compare the two objects in a descending order by row. Usage: comm [parameter] File 1 file 2. Parameter:-1 does not output the texts specific to [file 1];-2 does not output the texts specific to [file 2];-3 does not output the texts common to both files.
  31. Whereis-find the command directory: whereis only searches for system commands. Usage: whereis [parameter] command. Parameter:-B only searches for executable files;-m only searches for man documents of commands;-s only searches for source code of commands.
  32. Which --- a lightweight whereis
  33. Gzexe/bzexe --- Executable File compression. Usage: gzexe/bzexe [parameter] [file name]. Parameter:-f decompress the file. If no parameter is added, the file is compressed. The name of the compressed file is the same as that of the original file ~ To show differences
  34. Gzip/gunzip --- LZW compression. Usage: gzip [parameter] [file name] gunzip [file name]. Gzip parameters:-l shows the content of the compressed file, that is, extract the file to the screen;-r compression contains the content in the subdirectory; -v indicates the name and compression ratio of the file being compressed.-t indicates the integrity of the compressed file.-l indicates the fastest compression, and the compression ratio is very low.-g indicates the best compression and the compression ratio is very high, but the speed is slow.
  35. Tar --- file package. Usage: tar [parameter] [file name]. Parameters: The following are the main parameters. Each tar command must be followed by one:-A to add the file to the tar package;-c to create A tar package; -d: Compare the files in the tar package with those in the file system;-delete: delete the content in the tar package;-t list the content in the tar package;-r: add files at the end of the tar package; -u compares the tar package with the corresponding files in the file system, replaces the old files in the tar package with the files with the new modification date, and-x extracts the files from the tar package. The following is an auxiliary parameter:-f specifies the name of the tar file for the operation. If this parameter is not specified, it is automatically output to the screen.-h does not include the linked files, but adds the real files to which they are directed; -j: Use bzip2 to compress the file and then add the tar package.-k does not change the existing file.-v displays the name of the file being processed; -z: Use gzip/gunzip to process tar files
  36. Zip/unzip --- ZIP compression. Usage: zip [parameter] [ZIP file name] [original file] and unzip [parameter] [ZIP file name] [name of the file to be decompressed]. Parameter: zip parameter:-u Update file;-d delete file in zip package;-r include file in subdirectory;-m move file to package. Unlike gzip, Zip will delete the original file after compression;-1 quick compression;-9 slow compression;-v will show the details of the compression process;-T toilet compressed package. Unzip parameters:-l does not understand the pressure file, only the file list is displayed;-t test the compressed package;-d directory decompress to the directory;-x file decompress files other than files;
  37. Df-tools that focus on the space of the porcelain disk. Usage: df [parameter]. Parameters:-h is easy to read with G, M, K, and other marks;-T displays the format of the file system.
  38. Date-time date
  39. Who-show active users
  40. Whoami --- display current user
  41. Ps --- display process list
  42. Nice-set the process running priority
  43. Pidof --- display the process serial number
  44. Fg/bg --- frontend background Switch
  45. Whatis --- display simple command annotations
  46. Man-display command User Manual
  47. Info --- full command Manual

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.