首页 > 编程知识 正文

文件夹中的片如何快速重新命名,linux如何重命名目录

时间:2023-05-06 07:38:21 阅读:228671 作者:394

linux 文件夹重命名

Renaming or moving directories and folder can be tricky if those directories and folders have some subfolders. Or the destination may have all ready same name folder which will create some error. In this tutorial we will look how to rename and move directories and folders in Linux.

如果目录和文件夹具有某些子文件夹,则重命名或移动目录和文件夹可能会比较棘手。 否则目标可能已经准备好同一个名称文件夹,这将产生一些错误。 在本教程中,我们将研究如何在Linux中重命名和移动目录和文件夹。

使用Mv命令重命名 (Rename Using Mv Command)

The defacto command for rename directories and folders is mv . mv is the short form for the move . We can simply rename by providing the current directory and folder name and destination directory or folder name. Syntax is like below. If the source or current directory folder have content we need to rename by using recursive move. This will only change given directory or folder name but move all sub files and folder.

用于重命名目录和文件夹的defacto命令是mv 。 mv是move的简称。 我们可以简单地通过提供当前目录和文件夹名称以及目标目录或文件夹名称来重命名。 语法如下。 如果源或当前目录文件夹中包含内容,则需要使用递归移动来重命名。 这只会更改给定的目录或文件夹名称,但会移动所有子文件和文件夹。

mv CURRENT_FOLDER   NEW_FOLDER

In this example we will rename directory named backup  into old_backup .

在此示例中,我们将名为backup目录重命名为old_backup 。

$ mv backup old_backup 详细 (Verbose)

While renaming or moving files and folders we may need to get verbose information. Verbose mode will print every move or rename. This will be helpful for recursive option. We will provide -v to enable verbose.

重命名或移动文件和文件夹时,我们可能需要获取详细信息。 详细模式将打印所有动作或重命名。 这将有助于递归选项。 我们将提供-v以启用详细信息。

$ mv -v backup old_backup Verbose 详细 如果存在,则强制覆盖(Overwrite Forcibly If Exists)

In some cases there may be existing folder or directory with the new name. We need to confirm the overwrite. But this can be daunting task if there is a lot of them. We can overwrite existing files and folder with -f option automatically. -f means forcibly.

在某些情况下,可能存在具有新名称的现有文件夹或目录。 我们需要确认覆盖。 但是,如果有很多的话,这可能是艰巨的任务。 我们可以使用-f选项自动覆盖现有文件和文件夹。 -f强制。

$ mv -f backup old_backup 覆盖前提示确认 (Prompt For Confirmation Before Overwriting)

If we do not want to write existing file forcibly we can confirm for each file rename. In this case we have to use -i like below.

如果我们不想强行写入现有文件,则可以为每个文件重命名进行确认。 在这种情况下,我们必须像下面那样使用-i 。

$ mv -i backup old_backup .u67737ba117e3fb7af8add986cb0e00ab , .u67737ba117e3fb7af8add986cb0e00ab .postImageUrl , .u67737ba117e3fb7af8add986cb0e00ab .centered-text-area { min-height: 80px; position: relative; } .u67737ba117e3fb7af8add986cb0e00ab , .u67737ba117e3fb7af8add986cb0e00ab:hover , .u67737ba117e3fb7af8add986cb0e00ab:visited , .u67737ba117e3fb7af8add986cb0e00ab:active { border:0!important; } .u67737ba117e3fb7af8add986cb0e00ab .clearfix:after { content: ""; display: table; clear: both; } .u67737ba117e3fb7af8add986cb0e00ab { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u67737ba117e3fb7af8add986cb0e00ab:active , .u67737ba117e3fb7af8add986cb0e00ab:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u67737ba117e3fb7af8add986cb0e00ab .centered-text-area { width: 100%; position: relative; } .u67737ba117e3fb7af8add986cb0e00ab .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u67737ba117e3fb7af8add986cb0e00ab .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u67737ba117e3fb7af8add986cb0e00ab .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u67737ba117e3fb7af8add986cb0e00ab:hover .ctaButton { background-color: #E67E22!important; } .u67737ba117e3fb7af8add986cb0e00ab .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u67737ba117e3fb7af8add986cb0e00ab .u67737ba117e3fb7af8add986cb0e00ab-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u67737ba117e3fb7af8add986cb0e00ab:after { content: ""; display: block; clear: both; } LEARN MORE  How To Rename Multiple Files In Linux? .u67737ba117e3fb7af8add986cb0e00ab , .u67737ba117e3fb7af8add986cb0e00ab .postImageUrl , .u67737ba117e3fb7af8add986cb0e00ab .centered-text-area { min-height: 80px; position: relative; } .u67737ba117e3fb7af8add986cb0e00ab , .u67737ba117e3fb7af8add986cb0e00ab:hover , .u67737ba117e3fb7af8add986cb0e00ab:visited , .u67737ba117e3fb7af8add986cb0e00ab:active { border:0!important; } .u67737ba117e3fb7af8add986cb0e00ab .clearfix:after { content: ""; display: table; clear: both; } .u67737ba117e3fb7af8add986cb0e00ab { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u67737ba117e3fb7af8add986cb0e00ab:active , .u67737ba117e3fb7af8add986cb0e00ab:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u67737ba117e3fb7af8add986cb0e00ab .centered-text-area { width: 100%; position: relative; } .u67737ba117e3fb7af8add986cb0e00ab .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u67737ba117e3fb7af8add986cb0e00ab .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u67737ba117e3fb7af8add986cb0e00ab .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u67737ba117e3fb7af8add986cb0e00ab:hover .ctaButton { background-color: #E67E22!important; } .u67737ba117e3fb7af8add986cb0e00ab .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u67737ba117e3fb7af8add986cb0e00ab .u67737ba117e3fb7af8add986cb0e00ab-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u67737ba117e3fb7af8add986cb0e00ab:after { content: ""; display: block; clear: both; } 了解更多如何在Linux中重命名多个文件?

翻译自: https://www.poftut.com/how-to-rename-directories-and-folders-in-linux/

linux 文件夹重命名

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。