mv命令详解_mv命令

mv命令详解

Once you have a file, you can move it around using the mv command. You specify the file current path, and its new path:

有了文件后,可以使用mv命令在文件中移动。 您指定文件的当前路径及其新路径:

touch test
mv pear new_pear

The pear file is now moved to new_pear. This is how you rename files and folders.

pear文件现在移至new_pear 。 这是重命名文件和文件夹的方式。

If the last parameter is a folder, the file located at the first parameter path is going to be moved into that folder. In this case, you can specify a list of files and they will all be moved in the folder path identified by the last parameter:

如果最后一个参数是文件夹,则位于第一个参数路径的文件将被移动到该文件夹​​中。 在这种情况下,您可以指定文件列表,所有文件都将移至最后一个参数标识的文件夹路径中:

touch pear
touch apple
mkdir fruits
mv pear apple fruits #pear and apple moved to the fruits folder

This command works on Linux, macOS, WSL, and anywhere you have a UNIX environment

此命令可在Linux,macOS,WSL以及您拥有UNIX环境的任何地方使用

翻译自: https://flaviocopes.com/unix-command-mv/

mv命令详解

你可能感兴趣的:(java,linux,python,ubuntu,windows)