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    符号链接

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

  • 相关阅读:
    使用vue自定义组件以及动态时间
    vue案列
    解决adb devices无法连接夜神模拟器
    手动解除浏览器跨域限制
    HBuilder实现WiFi调试Android
    Spring mvc文件下载
    3大框架Struts、Hibernate、Spring简单了解
    简单了解ajax
    使用本地计划任务定时关闭azure虚拟机
    调整虚拟机的尺寸
  • 原文地址:https://www.cnblogs.com/songdechiu/p/9943910.html
Copyright © 2011-2022 走看看