Linux system commands and usage details

Source: Internet
Author: User
Linux system commands and usage details name: cp permission: all users usage: cp [options] sourcedestcp [options] source... directory Description: copy one file to another, or copy several files to another...
Linux system commands and usage details name: cp permission: all users usage: cp [options] source dest cp [options] source... directory Description: copy one file to another, or copy several files to another directory. -A tries its best to copy the file status, permissions, and other information as they are. -R if the source contains the directory name, the files under the Directory are also copied to the destination in sequence. -F if the destination already has an archive with the same file name, delete it before copying. Example: copy the file aaa (already exists) and name it bbb: cp aaa bbb www.2cto.com. copy all C language programs to the Finished subdirectory cp *. cFinished name: cut use permission: all user usage: cut-cnum1-num2 filename description: displays the text from the beginning of each line num1 to num2. Example: shell> cat example test2 this istest1 shell> cut-c0-6 example # print starts with the first 6 characters test2 this I usage: find instructions for use: list the files that match the expression in the file system. You can specify a combination of different information such as the file name, category, time, size, and permissions. only information that exactly matches the information will be listed. Find judges the path and expression according to the following rules, and first-() in the command column -(),! The previous part is path, followed by expression. If path is a null string, use the current path. if expression is a null string, use-print as the default expression? There are more than 20 or 30 options available in expression. here, we will only introduce the most commonly used options. -Mount,-xdev: only check the files in the same file system as the specified directory to avoid listing the files in other file systems-amin n: www.2cto.com-anewerfile has been read in the past n minutes: the file that has been read later than the file-atime n: the file that has been read in the past n days-cmin n: -cnewer file modified in the past n minutes: file updated in comparison to file-ctime n: file modified in the past n days-empty: empty file-gid n or-group name: gid is n or the group name is name-ipath p,-path p: file whose path name complies with p, ipath ignores the case-name,-iname name: name-compliant files. Iname ignores case-size n: the file size is n units, B indicates the block of the 512-bit tuples, c indicates the number of characters, k indicates kilo bytes, and w indicates the two-bit tuples. -Type c: The Archive type is c. D: Directory c: font device file B: block device file p: name storage column f: General File l: Symbol Link s: socket-pidn: if the process id is n, you can use () to separate the operators and use the following operations. Exp1-andexp2! Expr-not expr exp1-orexp2 exp1, exp2 example: list all files with c extension files under the current directory and its subdirectories. # Find. -name "*. c "list all general files in the subdirectories of the current directory # find. -ftype f www.2cto.com: list all files updated in the last 20 minutes in the current directory and its subdirectories # find. -ctime-20 name: less permission: Usage of all users: less [Option] filename description: the role of less is very similar to that of more. it can be used to browse text files, the difference is that less allows users to scroll back to browse the parts that have already been viewed. at the same time, because less does not read the entire file at the beginning, when a large file is opened, it is faster than the general document editor (such as vi. Author: zljpp
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.