In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how Linux moves files". The editor shows you the operation process through actual cases. The operation method is simple, fast and practical. I hope this article "how to move files in Linux" can help you solve the problem.
You can use the mv command to move a file or directory to another file or directory, or you can rename a directory or file. If you move a file to an existing target file, the contents of the target file will be overwritten. When the mv command receives two parameters, the first parameter represents the source file or directory, and the second parameter represents the target file or directory. When receiving multiple parameters, if the last parameter corresponds to a directory and the directory exists, mv will move the file or directory specified by each parameter to this directory, and if the target file exists, it will be overwritten.
Command format: mv [options] [parameters]
Options:
-I if the target file exists, the user will be asked if it is overwritten.
-f does not give any prompt when overwriting an existing target file.
-b if you need to overwrite the file, make a backup before overwriting.
The-S parameter is used in conjunction with the-b parameter to specify the suffix to be appended to the backup file.
-help displays help.
-version displays version information.
Example:
Mv b.txt c.bak renamed the file b.txt to c.bak
Mv-I 456.txt / home/hk/cpdir/copy/abc moves 456.txt to / home/hk/cpdir/copy/ and names it abc. If the file abc already exists, it will ask if you want to overwrite it.
Mv-f 456.txt / home/hk/cpdir/copy/abc moves 456.txt to / home/hk/cpdir/copy/ and names it abc without prompting if a file abc overwrite already exists.
Mv-b 123.txt 345.txt renames 123.txt to 345.txt and backs up 345.txt first.
This is the end of the introduction to "how Linux moves files". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.