• 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

通配符

Wildcard Meaning
* 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 Class Meaning
[: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

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

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

操作文件和目录【TLCL】的更多相关文章

  1. (三)linux 学习 --操作文件和目录

    The Linux Command Line 读书笔记 - 部分内容来自 http://billie66.github.io/TLCL/book/chap05.html 文章目录 通配符 字符范围 ` ...

  2. 【Python】[IO编程]文件读写,StringIO和BytesIO,操作文件和目录,序列化

    IO在计算机中指Input/Output,也就是输入和输出. 1.文件读写,1,读文件[使用Python内置函数,open,传入文件名标示符] >>> f = open('/User ...

  3. Python操作文件和目录

    Python操作文件和目录 读写文件比较简单,有一点特别注意就好了 windows下Python默认打开的文件以gbk解码,而一般我们的文件是utf-8编码的,所以如果文本含有中文,就会出现异常或者乱 ...

  4. Python之IO编程——文件读写、StringIO/BytesIO、操作文件和目录、序列化

    IO编程 IO在计算机中指Input/Output,也就是输入和输出.由于程序和运行时数据是在内存中驻留,由CPU这个超快的计算核心来执行,涉及到数据交换的地方,通常是磁盘.网络等,就需要IO接口.从 ...

  5. IO编程(2)-操作文件和目录

    操作文件和目录 如果我们要操作文件.目录,可以在命令行下面输入操作系统提供的各种命令来完成.比如dir.cp等命令. 如果要在Python程序中执行这些目录和文件的操作怎么办?其实操作系统提供的命令只 ...

  6. Python学习笔记(二十五)操作文件和目录

    摘抄:https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/0014319253241 ...

  7. os,操作文件和目录

    如果我们要操作文件.目录,可以在命令行下面输入操作系统提供的各种命令来完成.比如dir.cp等命令. 如果要在Python程序中执行这些目录和文件的操作怎么办?其实操作系统提供的命令只是简单地调用了操 ...

  8. python学习笔记 操作文件和目录

    如果我们要操作文件.目录,可以在命令行下面输入操作系统提供的各种命令来完成.比如dir.cp等命令. 如果要在Python程序中执行这些目录和文件的操作怎么办?其实操作系统提供的命令只是简单地调用了操 ...

  9. IO编程、操作文件或目录、序列化、JSON

    IO中指Input/Output,即输入和输出:涉及到数据交换的地方,通常是磁盘.网络等,就需要IO接口 1.由于CPU和内存的速度远远高于外设的速度,所以,在IO编程中,存在速度严重不匹配问题.eg ...

  10. 使用File类操作文件或目录的属性

    在学I/O流之前,我先总结一下使用File类操作文件或目录的属性. package com.File; import java.io.File; import java.io.IOException; ...

随机推荐

  1. linux之shell之if、while、for语句介绍

    一.基本判断条件 1)逻辑运算符 -a    expr1 -a expr2    逻辑与 -o    expr1 -o expr2    逻辑或 !     !expr1                ...

  2. Spring 中的 Resource和ResourceLoader

    Spring 内部框架使用org.springframework.core.io.Resource接口作为所有资源的抽象和访问接口.Resource接口可以根据资源的不同类型,或者资源所处的不同场合, ...

  3. JQUERY实现的小巧简洁的无限级树形菜单

    JQUERY实现的小巧简洁的无限级树形菜单,可用于后台或前台侧栏菜单!兼容性也比较好. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tra ...

  4. x+=y与x=x+y有什么区别?

    一般情况下,x+=y与x=x+y输出结果是等价的,因此两种写法是可以通用的,但是在某些临界值选用x+=y更加合适,比如: short n=3; n+=1;//编译通过 n=n+1;//编译失败 上述例 ...

  5. 封装AJax实现JSON前台与后台交互

    实践技术点:1.AJax自定义封装 2.后台序列化与反序列化JSON 3.客户端解析JSON字符串,处理DOM 实现代码如下: 1.JS脚本代码:   1 /*** NOTE:AJAX处理JS TIM ...

  6. extract

    w http://php.net/manual/en/function.extract.php <?php /* Suppose that $var_array is an array retu ...

  7. Python菜鸟之路:Jquery Ajax的使用

    Ajax概述 Ajax就是通过 HTTP 请求加载远程数据.通常用于定制一些http请求来灵活的完成前端与后端的数据交互需求. 注意,所有的选项都可以通过$.ajaxSetup()函数来全局设置. J ...

  8. JS添加标签

    <script>            function show(){                $('.add').unbind();                $('.low ...

  9. 读取用户家目录下的配置文件到properties

    String conf = System.getProperty("user.home") + File.separator + "a.properties"; ...

  10. Windows下比较小巧的c/c++ ide

    下载:codeblocks 只有几十兆. http://www.codeblocks.org/downloads/26#windows codeblocks-16.01mingw-nosetup.zi ...