zoukankan      html  css  js  c++  java
  • UNIX Renaming a File

    Unix does not have a command specifically for renaming files. Instead, the mv command is used both to change the name of a file and to move a file into a different directory.

    To change the name of a file, use the following command format (where thirdfile and file3 are sample file names):

    mv thirdfile file3

    This command results in the complete removal of thirdfile, but a new file called file3 contains the previous contents of thirdfile.

    Like cp, the mv command also overwrites existing files. For example, if you have two files, fourthfile and secondfile, and you type the command

    mv fourthfile secondfile

    mv will remove the original contents of secondfile and replace them with the contents of fourthfile. As a result, fourthfile is renamed secondfile, but in the process secondfile is deleted.

  • 相关阅读:
    文件系统
    用户
    Kali Linux命令(3)
    Kali Linux命令(2)
    Kali Linux命令(1)
    文件上传测试 bugku
    Seay源代码审计系统
    实验吧 BrainFuck
    zigbee学习之路(十一):看门狗
    zigbee学习之路(十):串口(接收)
  • 原文地址:https://www.cnblogs.com/JasperZhao/p/12892822.html
Copyright © 2011-2022 走看看