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 > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use the Linux copy command cp command, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The Linux system cp command is mainly used to copy files. You can copy all files in a specified directory to another directory.
The simple syntax is as follows:
# cp [options... .] Source (s) destination alternatively, you can use the advanced copy command, which displays the progress bar when copying large files or folders.
Take a look at the following command, usually you will use two different commands to copy the same file to a different folder:
# cp-v / home/aaronkilik/bin/sys_info.sh / home/aaronkilik/test # cp-v / home/aaronkilik/bin/sys_info.sh / home/aaronkilik/tmp
Suppose you want to copy a specific file to five or more folders, does that mean you need to type five or more cp commands?
To get rid of this problem, you can use the cp command with the echo command, pipe, xargs command:
# echo / home/aaronkilik/test/ / home/aaronkilik/tmp | xargs-n 1 cp-v / home/aaronkilik/bin/sys_info.sh, the path to the directory (dir1, dir2, dir3... DirN) is piped into the xargs command, meaning:
1.Murn 1-tells the xargs command to use at most one argument per command line and sends it to the cp command. 2.cp-used to copy files. 3.Murv-enable detail mode to show more copy details.
Try reading the man pages of cp, echo, and xargs to find all useful and advanced usage information:
This is the case with $man cp $man echo $man xargs. You can send us questions or feedback related to the topic in the comments section below. You can also read about progress commands to help monitor the progress of running (cp, mv, dd, tar, etc.).
The above is all the contents of the article "how to use the Linux copy command cp command". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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.