In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
What is the linux move file command? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
Linux move File command
Mv command
Function: rename a file or directory or move a file from one directory to another. This command is like a combination of ren and move under DOS.
Syntax: mv [option] source file or directory destination file or directory
Description:
Depending on the type of the second parameter in the mv command (whether it is the target file or the target directory), the mv command renames the file or moves it to a new directory. When the second parameter type is a file, the mv command finishes renaming the file. At this point, there can be only one source file (or source directory name), which renames the given source file or directory to the given destination file name.
When the second parameter is an existing directory name, there can be multiple source files or directory parameters, and the mv command moves the source files specified by each parameter to the destination directory. When moving a file across a file system, mv copies and then deletes the original file, and the link to the file is lost.
Parameters:
-I operate interactively. If the mv operation will result in an overwrite of an existing target file, the system asks whether to rewrite and asks the user to answer y or n, which avoids mistakenly overwriting the file.
-f disables interoperability. No indication is given when the mv operation wants to overwrite an existing target file, and when this option is specified, the I option will no longer work.
If the given target file (not a directory) already exists, the contents of the file will be overwritten by the new file. To prevent users from inadvertently destroying another file with the mv command, it is recommended that users use the I option when moving files using the mv command.
It is important to note that the results of mv and cp are different. Mv is like a file "moving", and the number of files does not increase, while cp copies files, and the number of files increases.
Example 1: move all files in / usr/xu to the current directory (with "." Represents):
$mv / usr/xu/ *.
Example 2: rename the file wch.txt to wjz.doc
$mv wch.txt wjz.doc Thank you for your reading! After reading the above, do you have a general idea of what the linux move file command is? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.