mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-28 23:20:10 +08:00
Merge pull request #774 from Linchenguang/master
【翻译完成】Moving or Rename File / Directory in Linux .... 相亲相爱一家人~~
This commit is contained in:
commit
edca8b7986
@ -1,45 +0,0 @@
|
||||
翻译中 by tomatoKiller
|
||||
|
||||
Here are Facebook’s 9 top open-source projects from 2013
|
||||
================================================================================
|
||||
Facebook and open-source software go together like Jay-Z and Beyoncé — you just can’t have one without the other.
|
||||
|
||||
And if Blue Ivy is the product of the latter union, then we must draw parallels between that royal child and Facebook’s React, Rebound, HipHop, and other open-source babies.
|
||||
|
||||
As Facebook open-source lead James Pearce writes on the company blog, “Since Facebook’s first line of PHP, and its first MySQL INSERT statement, open source has been a huge part of our engineering philosophy.”
|
||||
|
||||
Here’s a quick recap of what Facebook birthed into the open-source community in 2013. (Fair warning: Abandon hope, all ye who are non-technical and enter here.)
|
||||
|
||||
1. [xctool][1]: a replacement for Apple’s xcodebuild that makes it easier to build and test iOS and Mac projects.
|
||||
1. [Buck][2]: an Android/Java build tool for faster, better Android builds.
|
||||
1. [Rebound][3]: a Java library for animations. [Read our full coverage][4].
|
||||
1. [React][5]: a JavaScript library for building new user interfaces.
|
||||
1. [Regenerator][6]: a Node.js tool to replace generator functions with efficient JavaScript-of-today (ECMAScript 5 or ES5 for short) that behaves the same way.
|
||||
1. [Huxley][7]: a test-like system for catching visual regressions in Web applications. It watches you browse, takes screenshots, and tells you when they change.
|
||||
1. [Presto][8]: a distributed SQL engine for running interactive analytic queries against data sources of all sizes ranging from gigabytes to petabytes.
|
||||
1. [RocksDB][9]: an embeddable persistent key-value store for fast storage. RocksDB can also be the foundation for a client-server database, but our current focus is on embedded workloads.
|
||||
1. And released just today, [Origami][10]: a free design prototyping kit for Quartz composer. You simply must read our [full story][11] on this too-cool tool!
|
||||
|
||||
“As the famous Facebook maxim goes, our open source program is still only 1 percent finished,” Pearce concluded.
|
||||
|
||||
“We know there is still a huge amount to work on, across each of the major themes above. We’re very lucky to have strong and enthusiastic communities on our projects, and with that comes great responsibility.”
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://venturebeat.com/2013/12/20/here-are-facebooks-9-top-open-source-projects-from-2013/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://github.com/facebook/xctool
|
||||
[2]:http://facebook.github.io/buck/
|
||||
[3]:http://facebook.github.io/rebound/
|
||||
[4]:http://venturebeat.com/2013/12/10/how-facebook-could-save-the-mobile-web-starting-with-open-sourcing-its-secret-tools/
|
||||
[5]:http://facebook.github.io/regenerator/
|
||||
[6]:http://facebook.github.io/regenerator/
|
||||
[7]:https://github.com/facebook/huxley
|
||||
[8]:http://prestodb.io/
|
||||
[9]:http://rocksdb.org/
|
||||
[10]:http://facebook.github.io/origami/
|
||||
[11]:http://venturebeat.com/2013/12/20/you-can-now-build-an-interactive-mobile-app-no-code-required-thanks-to-facebook/
|
@ -1,139 +0,0 @@
|
||||
##<<Linchenguang翻译中
|
||||
|
||||
Moving or Rename File / Directory in Linux - 10 Practical mv Command Examples
|
||||
================================================================================
|
||||
After knowing about [copy command][1], the next command which is related is mv command. When you want to move files from one place to another and you don’t want to duplicate it, then **mv command** is absolutely right for this task.
|
||||
|
||||
### What is mv command ###
|
||||
|
||||
mv command is a command that similar with **cp**, but it **does not** create a copy / duplicate of files or directories. This command is installed by default on your Linux system, in any kind of Linux you are using. Please take a look of some examples using mv command in day-to-day operation.
|
||||
|
||||
### 1. Moving files ###
|
||||
|
||||
The requirement of moving file is the file source location **must be different** with the files destination location. Here’s an example. To move **file_1.txt** from current directory to another directory , for example **/home/pungki/office**, here’s the syntax :
|
||||
|
||||
$ mv file_1.txt /home/pungki/office
|
||||
|
||||
![mv command](http://linoxide.com/wp-content/uploads/2014/01/mv.png)
|
||||
|
||||
As we can see, when we move the file_1.txt, the file_1.txt from previous directory **is deleted**.
|
||||
|
||||
### 2. Moving multiple files ###
|
||||
|
||||
If we want to move multiple files, we put them in one line separated by space.
|
||||
|
||||
$ mv file_2.txt file_3.txt file_4.txt /home/pungki/office
|
||||
|
||||
![Move multiple files](http://linoxide.com/wp-content/uploads/2014/01/mv_multiple.png)
|
||||
|
||||
You can also use pattern if your files have it. For example, to move all files which have **.txt** extension, we can use this command :
|
||||
|
||||
$ mv *.txt /home/pungki/office
|
||||
|
||||
![Move using pattern](http://linoxide.com/wp-content/uploads/2014/01/mv_pattern.png)
|
||||
|
||||
### 3. Moving directory ###
|
||||
|
||||
Different from the copy command, moving directory using mv command is pretty straight forward. To move a directory, you can just to use mv command without any options. Please take a look screenshot below.
|
||||
|
||||
![Moving directory](http://linoxide.com/wp-content/uploads/2014/01/mv_directory.png)
|
||||
|
||||
### 4. Renaming files or directory ###
|
||||
|
||||
We also use mv command to rename files and directory. But in order to do so, the destination location **must be the same** with the source location. Then the file name must be different.
|
||||
|
||||
Let say we are inside **/home/pungki/Documents** folder and we want to **rename file_1.txt into file_2.txt**. Then the command will be like :
|
||||
|
||||
$ mv file_1.txt file_2.txt
|
||||
|
||||
If we mention the absolute path, then it will look like this :
|
||||
|
||||
$ mv /home/pungki/Documents/file_1.txt /home/pungki/Documents/file_2.txt
|
||||
|
||||
![Renaming file](http://linoxide.com/wp-content/uploads/2014/01/ren_file.png)
|
||||
|
||||
### 5. Renaming directory ###
|
||||
|
||||
The above rule is also applied to directory. Take a look this example :
|
||||
|
||||
$ mv directory_1/ directory_2/
|
||||
|
||||
![Renaming directory](http://linoxide.com/wp-content/uploads/2014/01/ren_directory.png)
|
||||
|
||||
### 6. Print what happen ###
|
||||
|
||||
When you are moving or renaming a large number of file / directory, you may want to know does your command works successfully or not without seeing to the destination location. To do this, we can use **-v** option.
|
||||
For example we want to move all txt files and want to check it. Then the command will be like this.
|
||||
|
||||
$ mv -v *.txt /home/pungki/office
|
||||
|
||||
![mv with verbose mode](http://linoxide.com/wp-content/uploads/2014/01/mv_v.png)
|
||||
|
||||
The same way is applied to directory.
|
||||
|
||||
![mv directory with verbose mode](http://linoxide.com/wp-content/uploads/2014/01/mv_v_directory.png)
|
||||
|
||||
### 7. Using interactive mode ###
|
||||
|
||||
When you are moving file into another location, and there is already exist the same file, then by default mv will overwrite it. No pop-up notification for this. To make a notification for overwriting file, we can use **-i** option.
|
||||
|
||||
Let say we want to move file_1.txt to /home/pungki/office. Meanwhile, file_1.txt is already exist in /home/pungki/office directory.
|
||||
|
||||
$ mv -i file_1.txt /home/pungki/office
|
||||
|
||||
![mv with interactive mode](http://linoxide.com/wp-content/uploads/2014/01/mv_interactive.png)
|
||||
|
||||
This notification will aware us about the existence of file_1.txt in the destination location. If we press “**y**” then the file will be moved, otherwise, it will not.
|
||||
|
||||
### 8. Using update option ###
|
||||
|
||||
While -i are notify us about overwriting files, then -u option will perform update **only if the source is newer than destination file**. Let’s take a look example below.
|
||||
|
||||
![Update only newer](http://linoxide.com/wp-content/uploads/2014/01/mv_u.png)
|
||||
|
||||
We have file_1.txt and file_2.txt with this attributes :
|
||||
|
||||
File_1.txt has 84 bytes file size and it last modified time is 12:00
|
||||
File_2.txt has 0 bytes file size and it last modified time is 11:59
|
||||
|
||||
We want to move them into /home/pungki/office directory. **But in the destination location**, we already have file_1.txt and file_2.txt.
|
||||
|
||||
We move file_1.txt and file_2.txt from current directory into /home/pungki/office using command :
|
||||
|
||||
$ mv -uv *.txt /home/pungki/office
|
||||
|
||||
As the result, we see those files are moved. Those file is moved because their last modified time stamp is newer than the files in /home/pungki/office directory.
|
||||
|
||||
### 9. Do not overwrite any existing file ###
|
||||
|
||||
If **-i** options is asking us about overwriting files, than -n option will not allow us to overwrite any existing files.
|
||||
|
||||
Using example on point 8, if we change the option from **-u to -n**, combine with **-v** option, then we will see that there are no files moved into /home/pungki/office directory.
|
||||
|
||||
$ mv -vn *.txt /home/pungki/office
|
||||
|
||||
![No overwrite](http://linoxide.com/wp-content/uploads/2014/01/mv_n.png)
|
||||
|
||||
### 10. Create backup when copying ###
|
||||
|
||||
By default, moving files will overwrite the destination files if there are already exist before. But what happen if you are moving wrong files, and the destination files are already overwritten by the new ones? **Is there a way to retrieve the old one? Yes there is**. We can use **-b** option. **-b** option will make a backup of destination file before it overwritten by the new one. Once again, we will use scenario from point 8 above.
|
||||
|
||||
$ mv -bv *.txt /home/pungki/office
|
||||
|
||||
![Backup option](http://linoxide.com/wp-content/uploads/2014/01/mv_b.png)
|
||||
|
||||
As you can see on the screenshot, on the /home/pungki/office directory, we have a file named **file_1.txt~ and file_2.txt~ . The tilde sign (~) means** that those files are backup. We can see the attribute of them is older than file_1.txt and file_2.txt.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
Moving file or directory also one of the basic command in Linux system. As usual you can type **man mv** or **mv --help** to display its manual page to explore more detail.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-command/mv-command-linux/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://linoxide.com/linux-command/linux-cp-command/
|
@ -0,0 +1,43 @@
|
||||
2013年Facebook排名前9位的开源项目
|
||||
================================================================================
|
||||
Facebook和开源项目之间的关系就像Jay-Z和碧昂丝一样 — 二者缺一不可
|
||||
|
||||
如果把Blue Ivy看作是后两者结合的产物的话,那么这个孩子就相当于Facebook的React, Rebound, HipHop, 以及其他的一些开源项目.
|
||||
|
||||
正如Facebook的开源项目领导者詹姆斯·皮尔斯在公司博客上面所写的那样:“从Facebook的第一行PHP代码以及它的第一个MySQL插入语句开始,开源就已经成为其工程哲学的一部分了。
|
||||
|
||||
下面提供了一个在2003年中,Facebook在开源社区中的贡献。(警告:放弃希望吧,走进来的那些非技术人员。)
|
||||
|
||||
1. [xctool][1]: 一个苹果xcodebuild的替代品,它使得创建和测试IOS和MAC工程更加容易
|
||||
1. [Buck][2]: 一个Android/Java的构建工具,用来更好更快的构建安卓APP
|
||||
1. [Rebound][3]: 一个JAVA动画库 [查看更详细的解释][4]
|
||||
1. [React][5]: 一个用来建立全新用户接口的JavaScript库
|
||||
1. [Regenerator][6]: 一个Node.js工具,用以相同方式工作的JavaScript-of-today(简称为ECMAScript 5 或 ES5)来替代generator functions。
|
||||
1. [Huxley][7]: 一个测试系统,用来捕捉Web应用程序的可视变化。它查看你的浏览器,进行屏幕截图,并在它们发生变化的时候告知你。
|
||||
1. [Presto][8]: 一个分布式的SQL引擎,用来对从gigabytes到petabytes范围内的数据源进行交互式的分析查询
|
||||
1. [RocksDB][9]: 一个用来进行快速存储的持久键值存储器。 RocksDB也可以作为客户端服务器数据库的基础,但我们现阶段关注的是嵌入式工作负载。
|
||||
1. 以及今天刚发布的 [Origami][10]: 面向quartz composer的一个免费的原型设计工具。你只需要阅读我们的 [全文][11] 即可!
|
||||
|
||||
”正如著名的Facebook座右铭所说,我们的开源工程仍然只完成了百分之一“,皮尔斯总结道。
|
||||
|
||||
“我们知道,在上面的任何一个主题上,我们仍然有大量的工作要做。 我们很幸运我们的工程能有如此热情的社区支持,而随之而来的,我们也肩负这巨大的责任。”
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://venturebeat.com/2013/12/20/here-are-facebooks-9-top-open-source-projects-from-2013/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://github.com/facebook/xctool
|
||||
[2]:http://facebook.github.io/buck/
|
||||
[3]:http://facebook.github.io/rebound/
|
||||
[4]:http://venturebeat.com/2013/12/10/how-facebook-could-save-the-mobile-web-starting-with-open-sourcing-its-secret-tools/
|
||||
[5]:http://facebook.github.io/regenerator/
|
||||
[6]:http://facebook.github.io/regenerator/
|
||||
[7]:https://github.com/facebook/huxley
|
||||
[8]:http://prestodb.io/
|
||||
[9]:http://rocksdb.org/
|
||||
[10]:http://facebook.github.io/origami/
|
||||
[11]:http://venturebeat.com/2013/12/20/you-can-now-build-an-interactive-mobile-app-no-code-required-thanks-to-facebook/
|
@ -0,0 +1,150 @@
|
||||
Linux 移动或重命名文件/目录-mv 的10个实用例子
|
||||
================================================================================
|
||||
|
||||
熟悉了 [复制命令][1],下一个相关的命令就是 mv 命令。当你想要将文件从一个位置移动到另一个地方并且不想复制它,那么**mv 命令**是完成这个任务的首选。
|
||||
|
||||
### 初识 mv 命令 ###
|
||||
|
||||
mv 命令是一个与**cp**类似的命令,但是它**并非**创建文件或目录的复制品/副本。不管你在使用什么版本的Linux系统,mv 都默认安装在你的Linux系统上了。来看一下 mv 命令在日常操作中的一些例子。
|
||||
|
||||
### 1.移动文件 ###
|
||||
|
||||
移动文件时需要注意的是文件的源地址和目标地址**必须不同**。这里有个例子。想要将**file_1.txt**文件从当前目录移动到其它目录,以**/home/pungki/**为例,语法应该如下:
|
||||
|
||||
$ mv file_1.txt /home/pungki/office
|
||||
|
||||
![mv command](http://linoxide.com/wp-content/uploads/2014/01/mv.png)
|
||||
|
||||
|
||||
如我们所见,当我们移动 file_txt 文件时,先前目录的 file_1.txt 就**被删除了**。
|
||||
|
||||
### 2.移动多个文件 ###
|
||||
|
||||
|
||||
如果想一次移动多个文件,我们可以将他们放在一行并用空格分开。
|
||||
|
||||
$ mv file_2.txt file_3.txt file_4.txt /home/pungki/office
|
||||
|
||||
![Move multiple files](http://linoxide.com/wp-content/uploads/2014/01/mv_multiple.png)
|
||||
|
||||
如果你的文件有规律可循的话那么你就可以利用它。比如,为了移除所有以**.txt**为扩展名的文件,我们可以用下面的命令:
|
||||
|
||||
$ mv *.txt /home/pungki/office
|
||||
|
||||
![Move using pattern](http://linoxide.com/wp-content/uploads/2014/01/mv_pattern.png)
|
||||
|
||||
### 3.移动目录 ###
|
||||
|
||||
不同于复制命令,用 mv 命令移动目录相当直接。移动目录你可以使用不带选项的 mv 命令。看下面的截图就一目了然了。
|
||||
|
||||
![Moving directory](http://linoxide.com/wp-content/uploads/2014/01/mv_directory.png)
|
||||
|
||||
### 4.重命名文件或目录 ###
|
||||
|
||||
|
||||
我们也用 mv 命令来重命名文件或目录。不过目标位置和源位置必须相同才可以。然后文件名必须不同。
|
||||
|
||||
|
||||
假定我们当前所在目录为**/home/pungki/Documents**,而我们想将**file_1.txt重命名为file_2.txt**。那么命令应该如下:
|
||||
|
||||
$ mv file_1.txt file_2.txt
|
||||
|
||||
如果是绝对路径,它应该像下面这样:
|
||||
|
||||
$ mv /home/pungki/Documents/file_1.txt /home/pungki/Documents/file_2.txt
|
||||
|
||||
![Renaming file](http://linoxide.com/wp-content/uploads/2014/01/ren_file.png)
|
||||
|
||||
|
||||
### 5. 重命名目录 ###
|
||||
|
||||
上一段的规则同样适用于目录。请看这个例子:
|
||||
|
||||
$ mv directory_1/ directory_2/
|
||||
|
||||
![Renaming directory](http://linoxide.com/wp-content/uploads/2014/01/ren_directory.png)
|
||||
|
||||
### 6. 打印移动信息 ###
|
||||
|
||||
|
||||
当你移动或重命名一大堆文件或目录时,你可能会想在不去目标位置去查看的情况下知道你自己的命令是否成功地执行了。这就要用到**-v**选项了。
|
||||
|
||||
$ mv -v *.txt /home/pungki/office
|
||||
|
||||
![mv with verbose mode](http://linoxide.com/wp-content/uploads/2014/01/mv_v.png)
|
||||
|
||||
该方法同样适用于目录。
|
||||
|
||||
![mv directory with verbose mode](http://linoxide.com/wp-content/uploads/2014/01/mv_v_directory.png)
|
||||
|
||||
### 使用交互模式 ###
|
||||
|
||||
当你将文件移动到其它位置,而那个位置恰好有同样的文件,这时 mv 命令会覆盖掉原来的文件。对于mv的这一行为一般不会有什么提示。如果想产生一个关于覆盖文件的提示,我们可以使用**-i**选项。
|
||||
|
||||
|
||||
假设我们想将 file_1.txt 移动到 /home/pungki/office。同时,/home/pungki/office 目录下已经有file_1.txt文件了。
|
||||
|
||||
$ mv -i file_1.txt /home/pungki/office
|
||||
|
||||
![mv with interactive mode](http://linoxide.com/wp-content/uploads/2014/01/mv_interactive.png)
|
||||
|
||||
|
||||
这个提示会让我们知道目标位置处file_1.txt的存在。如果我们按**y**键,那么那个文件将会被删除,否则不会。
|
||||
|
||||
### 8. 使用更新选项 ###
|
||||
|
||||
-i 选项会提示我们关于覆盖文件的提示,而 -u 则只在源文件比目标文件新时才执行更新。让我们看一看下面的例子:
|
||||
|
||||
![Update only newer](http://linoxide.com/wp-content/uploads/2014/01/mv_u.png)
|
||||
|
||||
|
||||
假如 file_1.txt 和 file_2.txt有如下特点:
|
||||
|
||||
File_1.txt has 84 bytes file size and it last modified time is 12:00
|
||||
File_2.txt has 0 bytes file size and it last modified time is 11:59
|
||||
|
||||
|
||||
我们想将它们移动到 /home/pungki/office 目录下。***但是目标地址**已经有file_1.txt和file_2.txt了。
|
||||
|
||||
我们用下面的命令将file_1.txt 和file_2.txt从当前目录移动到/home/pungki/office
|
||||
|
||||
$ mv -uv *.txt /home/pungki/office
|
||||
|
||||
|
||||
可以看到这些文件被移动了。能移动这些文件是因为它们最近的修改时间戳比 /home/pungki/office 目录中的文件新。
|
||||
|
||||
### 9.不要覆盖任何已存在的文件 ###
|
||||
|
||||
如果**-i**选项询问我们是否要覆盖文件,那么 -n 选项将不会允许我们覆盖任何已存在的文件。
|
||||
|
||||
继续使用第8点中的例子,如果我们将**-u 换成 -n**同时加上**-v**选项,那么我们会看到没有任何文件移动到了 /home/pungki/office 目录下。
|
||||
|
||||
$ mv -vn *.txt /home/pungki/office
|
||||
|
||||
![No overwrite](http://linoxide.com/wp-content/uploads/2014/01/mv_n.png)
|
||||
|
||||
|
||||
### 10. 复制时创建备份 ###
|
||||
|
||||
|
||||
默认情况下,移动文件将会覆盖已存在的目标文件。但是如果我们移动错了文件而目标文件已经被新的文件覆盖了,这时应该怎么办才好呢?**有没有一种方法可以恢复之前的文件呢?答案是肯定的**。我们可以用**-b**选项。该选项会在新文件覆盖旧文件时将旧文件做备份。这里我们还以第8点为例。
|
||||
|
||||
$ mv -bv *.txt /home/pungki/office
|
||||
|
||||
![Backup option](http://linoxide.com/wp-content/uploads/2014/01/mv_b.png)
|
||||
|
||||
如截图中所见,在 /home/pungki/office 目录下出现了名为**file_1.txt~ and file_2.txt~ 的文件。那个波浪符号(~)意味着**这些文件是备份文件。从它们的属性中我们可以看到,这些文件比file_1.txt和file_2.txt要旧。
|
||||
|
||||
### 总结 ##
|
||||
|
||||
移动文件和目录命令是Linux系统的基本命令。通常你可以通过**man mv** 或者 **mv --help**显示mv的手册页以了解更多详细信息。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-command/mv-command-linux/
|
||||
|
||||
译者:[Linchenguang](https://github.com/Linchenguang) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://linoxide.com/linux-command/linux-cp-command/
|
Loading…
Reference in New Issue
Block a user