• 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. [转]Excel关闭进程

    原文地址:http://www.cnblogs.com/feishu/archive/2010/05/08/1730797.html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ...

  2. ubuntu虚拟化平台libvrit-bin

    http://download.cirros-cloud.net/0.3.5/ 下载 cirros-0.3.5-x86_64-disk.img 因为 KVM(准确说是 Libvirt)默认不接受远程管 ...

  3. 《从零开始学Swift》学习笔记(Day 32)——计算属性

    原创文章,欢迎转载.转载请注明:关东升的博客 计算属性本身不存储数据,而是从其他存储属性中计算得到数据. 计算属性概念: 计算属性提供了一个getter(取值访问器)来获取值,以及一个可选的sette ...

  4. 借助EasyNTS云组网,无需拉专线,也能解决设备现场无公网固定IP的问题

    一.产品背景 为了帮助企业和个人用户解决网络访问和设备控制的问题,我们研发了一款创新型产品:EasyNTS云组网系统.什么是EasyNTS,什么是云组网呢? 在解释之前,我们先来了解几个在凡是涉及网络 ...

  5. 对django模型中的objects的理解

    object是模型属性,用于模型对象和数据库交互. object=Manager()是管理器类型的对象,是model和数据库进行查询的接口 可以自定义管理对象 books=models.Manager ...

  6. java爬虫-简单爬取网页图片

    刚刚接触到“爬虫”这个词的时候是在大一,那时候什么都不明白,但知道了百度.谷歌他们的搜索引擎就是个爬虫. 现在大二.再次燃起对爬虫的热爱,查阅资料,知道常用java.python语言编程,这次我选择了 ...

  7. Django的admin定制

    1,models编写 #encoding=utf-8 from django.db import models # Create your models here. class BookInfo(mo ...

  8. javafx 普通弹框提示

    new Alert(Alert.AlertType.NONE, "xxx不存在", new ButtonType[]{ButtonType.CLOSE}).show();

  9. Python电影投票系统

    电影投票:程序先给出几个目前正在上映的电影列表. 由用户给每个电影投票.最终将该用户投票信息公布出来 lst = ['北京遇上西雅图', '解救吴先生', '美国往事', '西西里的美丽传说']结果: ...

  10. 进程、数据共享、进程锁、进程池、requests模块和bs4(beautifulsoup)模块

    一.进程 1.进程间数据不共享,如下示例: import multiprocessing data_list = [] def task(arg): data_list.append(arg) pri ...