Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to merge directories under CentOS

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to merge catalogs under CentOS". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to merge catalogs under CentOS.

# mkdir tmp creates a tmp directory under the current directory

# cp-Rf wordpress tmp/ moves the wordpress directory under the current directory to the tmp directory

# cd tmp/ enter the tmp directory

# mv wordpress my_blog renames the wordpress directory under the tmp directory to bit my_blog

# cd.. Return to the parent directory

#\ cp-Rf tmp/my_blog. Merge the my_blog under the tmp directory with the directory with the same name under the current directory

You may find that the last command did not use cp-R-u. Why? Discard-u to ensure that all files are overwritten. The f parameter is added to avoid prompting whether to overwrite the file. If there are few files, you can manually hit y and enter. There are so many files. But why was there a "\" symbol before cp? Quite simply, after the cp command uses the-f parameter, it still prompts whether to overwrite the file, because the alias of the cp command is cp-I, and the-I parameter indicates that there is an interactive prompt, so typing cp-Rf directly cannot eliminate the prompt. Add "\" before the cp command, or use the absolute address of the cp command to ensure that there is no prompt.

Finally, we need to delete the original directory. Since there is only the original directory in the new tmp, we can delete the entire tmp directory:

# rm-rf tmp

So it's done!

Thank you for your reading, these are the contents of "how to merge directories under CentOS". After the study of this article, I believe you have a deeper understanding of how to merge directories under CentOS, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report