Commands for Linux

Source: Internet
Author: User
Tags readable

  • Classification of Linux commands
      • Meaning of options and parameters
        • With "-" to boot the short format option (single character), e.g. "-l"
        • "--" to boot long format options (multiple characters), such as "--color"
        • Multiple short format options can be written together with only one "-" boot, such as "-al"
  • Classification of commands
      • Directory Operations Command
        • PWD,CD, LS, mkdir, du
      • File Operations Command
        • Touch,file,cp,rm,mv,which,find,in
      • File Content Operations Command
        • Cat, More,less
        • Head,tail,wc,grep
      • Archive and Compress commands
        • Gzip,bzip2,tar
  • Basic commands
      1. STARTX Boot Image operating system
      2. Reboot restart your computer now
      3. Shutdown-h immediately shut down the machine
      4. Shutdown-r Restart your computer now
      5. Logout logoff
  • Basic commands
    1. CD go to a directory
    2. LS View current directory dir
    3. Ls-s View details in the current directory
    4. Ls-a Show hidden files
    5. Ls-l Display long list format
    6. Ls-al--full-time Full rendering of File modification times
    7. MV A.text b.text Rename
    8. chmod 751 File Change properties (111 101 001)
    9. PWD Displays the current directory
    10. mkdir FileName Create folder
    11. rmdir filename to delete an empty folder
    12. Touch filename creates an empty file
    13. CP r DIR1 copy R to Dir1
        • CP "Options" ... source file or directory ... Destination file or directory
        • -R: Recursively replicate entire directory tree
        • -P: Keep the properties of the source file unchanged
        • -F: Force overwrite the target file or directory with the same name
        • -I: Reminders are required to overwrite files or directories
    14. MV moving files and changing file names
    15. RM Delete files and directories
    16. Rm-i * Prevent deletion
        • -F force deletion of files or directories without reminders
        • -I alert users to confirm when deleting files or directories
        • -R recursively Delete entire directory tree
    17. RM-RF * Remove all content (including directories and files) recursively
    18. More display of file contents with pagination
    19. Less displays the contents of the file with pagination
    20. Du statistics directory and Space usage of files (estimate file space usage)
        • -A: All files are included in the statistics, not just the statistics directory
        • -H: Display information in more readable byte units (k, m, etc.)
        • -S: Counts the total amount of space occupied by each parameter
    21. File View Files Type
    22. Which: Find the Linux command file and show where it is located--the search scope is specified by the PATH environment variable
    23. Find:find "Look in" "find conditions" such as: Find-size +10000000k
        • -name: Find by file name
        • -user: Search by file Owner
        • FIND/HOME-ADMIN-10 files or directories accessed within 10 minutes
        • Find/home-atime-10 10 hours
        • FIND/HOME-CMIN-10 files or directories that have changed within 10 minutes
        • Find/home-ctime +10 10 hours ago changed files or directories
    24. In: Used to establish a link to a file or directory link
        • Format: in[-s] source file or directory ... Link file or destination directory
          • Soft Links: Creating shortcuts
          • Hard Links: Copying
    25. Cat: Show the full contents of a file
    26. MORE: Full screen display of the contents of the file page
        • Press ENTER to scroll down by line
        • Press the SPACEBAR to turn down a screen, press the B key to turn up a screen
        • Press the Q key to exit
    27. head:head-n file name; Purpose: View part of the beginning of a file (default 10 lines)
    28. Tail:tail-n file name; tail-f file name; View a small portion of the end of the document (default 10 lines)
    29. WC:WC number of words in File name statistics files
        • -L: Count rows
        • -W: Count the number of words
        • -C: Statistics of bytes
    30. grep:grep [Options] ... Find a conditional target file; Use: To find and include a line in a file that contains a specified string
        • -I: Ignore case when finding
        • -V: Reverse lookup, output rows that do not match the lookup criteria
        • Find conditional settings
          • The string to find is enclosed in double quotation marks.
          • "^ ..." means ..... The beginning, "... $" means to ..... End
          • "^$" indicates a blank line
    31. Fdisk-l: Viewing the relationship between partitions and hard disks
    32. Df-h viewing the use of a hard disk
    33. Df-h or Df/home: the use of disks
    34. Mount: Mount a device to a directory such as: mount/dev/sda1/boot/
    35. Umount
    36. ENV environment variable for current Linux (Environment)
    37. Chsh-s/BIN/BSH Change Command
    38. History 5: This description shows the 5 most recently used commands
    39. Setup: Enter some configuration of the setup system, including network
    40. Netstatu-tulnp|egrep (' name1 ' | ') Name2 ') System Network information
    41. Top shows Linux hardware and process conditions
    42. Chown username filename modify files and folders for users and user groups
      Chown-r username1|username2 filename To change all files under the all path of filename to
      UserName1 and UserName2
    43. chmod modify files and folders Read and write perform awakening
      Chmod-r 777/temp/sco To change the properties of all files and folders below/temp/sco to writable and readable executable
      Writable 4 readable 2 executable 1
  • The management of Linux users
      1. Useradd Username Add Users
      2. passwd username----> Enter password
      3. Userdel Username Delete a user
      4. Userdel-r Username Delete user and user home directory
  • Specify the Run level
      • Command: init[0123456] in/etc/inittab id:5: The number of the Initdefault line
      • 0: Turn off the machine
      • 1: Single User
      • 2: Multi-user status No NETWORK service
      • 3: Network Service with multi-user status
      • 4: The system is reserved for use to the user
      • 5: Graphical interface
      • 6: System restart
  • Directory
      • . Represents this Layer directory
      • .. Represents a previous level directory
      • -Represents a previous working directory
      • ~ Represents the home directory where the user is currently located
      • Cd.. /dic a directory that enters a relative path
  • Pipeline Command (| is the pipe command: Give the result of the previous pipe command | subsequent command processing)
  • Alias commands such as: Alias lls= ' ls-l/home '
  • Compression and decompression
      • Zip zipname.zip name1,name2 File compression
      • -R Sub-directories compress together
      • -j ignores the contents of subdirectories, so it only presses the first level directory
      • -N Remove compressed or unnecessary compressed files from the middle of the first file ": Separate
      • -T 102002 means to compress files after October 20, 2002 in the directory



From for notes (Wiz)

Commands for Linux

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.