zoukankan      html  css  js  c++  java
  • 操作文件和目录【TLCL】

    • cp – Copy files and directories

    • mv – Move/rename files and directories

    • mkdir – Create directories

    • rm – Remove files and directories

    • ln – Create hard and symbolic links

    通配符

    WildcardMeaning
    * Matches any characters
    ? Matches any single character
    [characters] Matches any character that is a member of the set characters
    [!characters] Matches any character that is not a member of the set characters
    [[:class:]] Matches any character that is a member of the specified class

    字符类

    Character ClassMeaning
    [:alnum:] Matches any alphanumeric character
    [:alpha:] Matches any alphabetic character
    [:digit:] Matches any numeral
    [:lower:] Matches any lowercase letter
    [:upper:] Matches any uppercase letter
    • mkdir directory...

    • cp item1 item2

    • cp item... directory

    OptionMeaning
    -a, --archive Copy the files and directories and all of their attributes, including ownerships and permissions. Normally, copies take on the default attributes of the user performing the copy
    -i, --interactive Before overwriting an existing file, prompt the user for confirmation. If this option is not specified, cp will silently overwrite files.
    -r, --recursive Recursively copy directories and their contents. This option (or the -a option) is required when copying directories.
    -u, --update When copying files from one directory to another, only copy files that either don't exist, or are newer than the existing corresponding files, in the destination directory.
    -v, --verbose Display informative messages as the copy is performed.
    • mv item1 item2
    • mv item... directory
    • rm item...

      先用 ls 命令来测试通配符

    • ln file link      硬链接
    • ln -s item link    符号链接

    硬链接不能关联文件系统之外的文件,不能关联目录

  • 相关阅读:
    Spring+SpringMVC+MyBatis+easyUI整合
    @RequestMapping 用法详解之地址映射(转)
    Servlet的5种方式实现表单提交
    activiti 快速入门--组任务(candidate users)分配(6)
    activiti数据库表结构剖析
    Java程序如何生成Jar、exe及安装文件
    StringEscapeUtils对字符串进行各种转义与反转义
    30分钟学会如何使用Shiro
    Java基础恶补——内存泄露、内存溢出
    ashx文件结合ajax使用(返回json数据)
  • 原文地址:https://www.cnblogs.com/songdechiu/p/9943910.html
Copyright © 2011-2022 走看看