Linux file directory

Source: Internet
Author: User

  1. LS Primary knowledge
    1. LS lists the files and directories in the current directory
    2. Ls-f distinguishing between files and directories and executable files
    3. Ls-a to show hidden files together
    4. LS-R displays the files contained in the directory
    5. Ls-l abbreviated ll displays files and directories for more information about file types, directory D, file-, character file C, block file B, file permissions, total number of hard links to files, user name of the owner of the file, group name of the file, file size (bytes), File last modified time, filename or directory name.
    6. Ls-i display index values for each file
    7. Ls-l for linked files, displaying the original file information
    8. LS ABC only show ABC this file, ls ABC? Display ABC starts with one more character after the file LS abc* ABC starts with 0 or more file characters
  2. Touch File1 Create a file
  3. Touch-t timestamp (201711110013) file2 file at a specific time
  4. CP test1 test2 Copy file cp-p test1 test3 destination file Keep the original file access time and modified time
  5. Cp-r dir1 dir2 Copy Entire Directory
  6. Cp-f Dir1 dir2-f is forced to overwrite files that are already pure in
  7. Link
    1. Symbolic links, i.e. soft connections
      1. Cp-s test1 test5 ln-s test1 test5
    2. Hard links,
      1. Creates a separate file that contains the information and location of the original file. Referencing a hard-link file is equivalent to referencing the original file: cp-l test1 test4 ln test1 test4 test1 and TEST4 index nodes are the same
  8. Move Rename file mv
  9. Delete file rm test-f is forced to delete
  10. mkdir Dir1 Creating a directory
  11. RmDir Dir1 Delete directory can only delete empty directory
  12. RM-RF Dir1 Delete a non-empty directory
  13. Stat can view all status information for a file
  14. File view files type, including text file, executable file, data file
  15. CAT displays the data in the text file Cat-n displays line numbers (including blank lines), Cat-b displays only the line numbers of the text, cat-s compresses multiple blank rows to a single blank line-T does not display tabs, and ^i instead of tabs
  16. More display a page of data will stop
  17. Less is the more upgraded version
  18. Tail display the contents of the File Mo part, the default is the last 10 lines, tail-c bytes display the last bytes bytes of the file character-n lines the last lines line-F has been kept active--pid=pid with-F, until the process ID because of the PID Process End-S SEC and-F are used together, between each loop output sleep sec seconds-V displays the header with the file name-Q-The header with the file name
  19. Head displays the contents of the lines at the beginning

Linux file directory

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.