Linux,一起学习进步~

   mkdir

  

  The mkdir command is used to create directories.It works like this:

  mkdir命令是用来创建目录的,这样使用:

mkdir directory…

  A note on notation: When three periods follow an argument in the description of a command(as above),it means that the argument can be repeated,thus:

  注意表示法:当遇见一个后面有三个圆点的命令(如上所示),这表示那个参数可以重复:

tmp mkdir max
➜ tmp ls
a.json max server.js ➜ tmp mkdir max1 max2 max3
➜ tmp ls
a.json max1 reade_file.js
clone_obj.js max2 server.js
getIp.js max3
   cp

  

  The cp command copies files or directories. It can be used two different ways:

  cp命令,复制文件或目录,它有两种使用方法:

cp file1 file2

  to copy the single file or directory “file1” to file or directory “file2” and :

  复制单个文件或目录,和:

cp file… directory

  to copy multiple files(either files or directories)into a direcotory.

  复制多个文件或目录到一个目录下。

   mv

  

  The mv command performs both file moving and file renaming, depending on how it is used. In erther case,the original filename no longer exists after the operation. mv is used in much the same way as cp:

  mv命令可执行文件移动以及文件重命名两种任务,这依赖于如何使用它。任何一种情况下,在此操作之下原始文件都将不再存在。mv命令使用方法同cp一样:

mv file1 file2

mv file1 file2 file3 code
   rm

  

  The rm command is used to remove(delete) files and directories:

  rm命令用来删除文件或者目录:

rm file…
   ln

  

  The ln command is used to create either hard or symbolic links. It is used in one of two ways:

  ln命令用来创建硬链接,也可以创建符号链接。可以用其中一种方法使用它:

ln file link

  to create a hard link, and:

  创建硬链接,和:

ln -s item link

  to create a aymbolic link “item” is erther a file or a directory.

  创建符号链接,“item”可以是一个文件或是一个目录。

   hard link

  

  Hard links are the original Unix way of creating links, compared to symbolic links, which are more modern. By default, every file has a single hard link that gives the file its name. When we create a hard link, we create an additional directory entry for a file. Hard links have two important limitations:

  硬链接最初是Unix创建的一种链接方式,和符号链接比起来,而符号链接更加现代.在默认方式下,每个文件有一个硬链接,这个硬链接就是文件的别名。当我们创建一个硬链接时,我们也就为这个文件创建一个额外的入口。硬链接有两个重要的局限性:

  1. A hard link cannot reference a file outside its own file system. This means a link may not reference a file that is not on the same dis partition as the link itself.
  2. A hard link may not reference a directory.

  3. 一个硬链接不能关联一个它所在文件系统之外的文件。这是说一个链接不能关联与链接本身不再同一个磁盘分区上的文件。

  4. 一个硬链接不能关联一个目录。
   symbolic link

  

  Symbolic links were created to overcome the limitations of hard links. Symbolic links work by creating a special type of file that contains a text pointer to the referenced file or directory.In this regard, they operate in much the same way as a Windows shortcut though of course, they predate the Windows feature by many years.

符号链接的创建是为了克服硬链接的局限性。符号链接通过创建一个包含指向关联的文件或目录的文本指针的特别的文件类型来工作。在这一方面,他们和Windows的快捷方式差不多,当然,符号链接早于Windows的快捷方式很多年。

  A file pointed to by a symbolic link, and the symbolic link itself are largely indistinguishable from one another. For example, if you write some something to symbolic link, the referenced file is also written to. However when you delete a symbolic link, only the link is deleted, not the file itself. If the file is deleted before the symbolic link, the link will continue to exist, but will point to nothing. In this case, the link is said to be broken. In many implementations, the ls command will display broken links in a distinguishing color, such as red, to reveal their presence.

  一个符号链接指向一个文件,而这个符号链接本身与其他的符号链接几乎没有区别。比如,如果你向一个符号链接里写入一些东西,那么关联的文件也会被写入。然而当你删除一个符号链接时,仅仅这个链接被删除,不会影响到文件本身。如果这个文件在符号链接之前被删除了,这个链接将会继续存在,但不会指向任何东西。这种情况下,这个链接被称为坏链接。在许多实现中,ls命令会以可区分的颜色来显示这些坏链接,比如红色,来显示他们的存在。

  如想了解更多,请移步我的博客

Linux学习之文件操作的更多相关文章

  1. Linux学习-基本命令文件操作

    终端 1.多个终端 连接linux的客户端可以理解为终端. 命令:tty查看终端 2.不同终端之间的通讯 [root@wyx wyx]# echo 123 > /dev/pts/1 把123发给 ...

  2. 3)Linux程序设计入门--文件操作

    )Linux程序设计入门--文件操作 Linux下文件的操作 前言: 我们在这一节将要讨论linux下文件操作的各个函数. 文件的创建和读写 文件的各个属性 目录文件的操作 管道文件 .文件的创建和读 ...

  3. Linux学习之文件特殊权限详解(SetUID、SetGID、Sticky BIT)(十一)

    Linux学习之文件特殊权限详解(SetUID.SetGID.Sticky BIT) 目录 SetUID SetGID Sticky BIT SetUID SetUID简介 只有可以执行的二进制程序和 ...

  4. python学习笔记:文件操作和集合(转)

    转自:http://www.nnzhp.cn/article/16/ 这篇博客来说一下python对文件的操作. 对文件的操作分三步: 1.打开文件获取文件的句柄,句柄就理解为这个文件 2.通过文件句 ...

  5. HTML5学习之文件操作(九)

    之前我们操作本地文件都是使用flash.silverlight或者第三方的activeX插件等技术,由于使用了这些技术后就很进行跨平台的处理,另外就是让我们的web应用依赖了第三方的插件,而不是很独立 ...

  6. Smart210学习记录-------文件操作

    一.linux文件操作(只能在linux系统上用) 创建:int creat(const char* filename, mode_t mode) filename 表示要创建的文件名,mode表示对 ...

  7. Linux系统编程@文件操作(一)

    只总结了部分常用的内容,详细内容参考<UNIX环境高级编程>及相关书籍. Linux中文件编程可以使用两种方法 Linux系统调用(依赖于系统) C语言库函数(不依赖于系统) Linux系 ...

  8. linux下的文件操作——批量重命名

    概述:在日常工作中,我们经常需要对一批文件进行重命名操作,例如将所有的jpg文件改成bnp,将名字中的1改成one,等等.文本主要为你讲解如何实现这些操作 1.删除所有的 .bak 后缀: renam ...

  9. NodeJS学习之文件操作

    NodeJS -- 文件操作 Buffer(数据块) JS语言自身只有字符串数据类型,没有二进制数据类型,因此NodeJS提供了一个与String对等的全局构造函数Buffer来提供对二进制数据的操作 ...

随机推荐

  1. 浅谈 jQuery 核心架构设计

    jQuery对于大家而言并不陌生,因此关于它是什么以及它的作用,在这里我就不多言了,而本篇文章的目的是想通过对源码简单的分析来讨论 jQuery 的核心架构设计,以及jQuery 是如何利用javas ...

  2. .NetCore MVC中的路由(1)路由配置基础

    .NetCore MVC中的路由(1)路由配置基础 0x00 路由在MVC中起到的作用 前段时间一直忙于别的事情,终于搞定了继续学习.NetCore.这次学习的主题是MVC中的路由.路由是所有MVC框 ...

  3. 【腾讯bugly干货分享】HTML 5 视频直播一站式扫盲

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://bugly.qq.com/bbs/forum.php?mod=viewthread&tid=1277 视频直 ...

  4. web前端基础知识

    #HTML    什么是HTML,和他ML...    网页可以比作一个装修好了的,可以娶媳妇的房子.    房子分为:毛坯房,精装修    毛坯房的修建: 砖,瓦,水泥,石头,石子....    精 ...

  5. jq跑马灯效果

    这几天公司产品有个无缝循环滚动的广告跑马灯要做,最开始想到的是<marquee>标签,但在PC端正常,在安卓广告屏上却怎么都跑不动,后来用的css3的animation,结果也是PC端及其 ...

  6. 将 instance 部署到 OVS Local Network - 每天5分钟玩转 OpenStack(130)

    上一节创建了 OVS 本地网络 first_local_net,今天我们会部署一个 instance 到该网络并分析网络结构.launch 一个 instance,选择 first_local_net ...

  7. android 两种实现计时器时分秒的实现,把时间放在你的手中~

    可能我们在开发中会时常用到计时器这玩意儿,比如在录像的时候,我们可能需要在右上角显示一个计时器.这个东西其实实现起来非常简单. 只需要用一个控件Chronometer,是的,就这么简单,我都不好意思讲 ...

  8. [数据结构]——链表(list)、队列(queue)和栈(stack)

    在前面几篇博文中曾经提到链表(list).队列(queue)和(stack),为了更加系统化,这里统一介绍着三种数据结构及相应实现. 1)链表 首先回想一下基本的数据类型,当需要存储多个相同类型的数据 ...

  9. linux服务器开发一 基础

    注:本文仅限交流使用,请务用于商业用途,否则后果自负! Linux 1.Linux介绍 Linux是类Unix计算机操作系统的统称. Linux操作系统的内核的名字也是“Linux”. Linux这个 ...

  10. 基于NPOI的Excel数据导入

    从Excel导入数据最令人头疼的是数据格式的兼容性,特别是日期类型的兼容性.为了能够无脑导入日期,折腾了一天的NPOI.在经过测试确实可以导入任意格式的合法日期后,写下这篇小文,与大家共享.完整代码请 ...