Hot Article
- Centos7 closes and restarts the system firewall and opens firewall ports
- How IID server uses Xshell to connect to Linux (centos) server
- BT panel forgets the background login URL, and the solution to the security entrance verification failure
- The php domain name points to ip, how to use the specified ip address to access a server in the url request domain name in curl mode
- How to purchase a dedicated server
- Error connecting to MySQL: Cant connect to MySQL server (10060)
What to do if a cp: omitting directory error occurs in Linux (detailed solution)
- Author:Sven
- Category:Server Maintain
- Release Time:2022-11-30
This article mainly talks about how to deal with the cp: omitting directory error in Linux (detailed solution), and presents it to you in the form of graphics and code. So let's learn it together with the IID editor!
Copying a directory to another directory in the Linux system will cause an error when using the cp command
1. Under the/home/directory, create a new directory, for example: 123
2. Copy directory 123 to the/tmp/directory, and use the cp command
3. System error, cp: omitting directory '123'
4. Use the cp - r command to copy (Note: the cp command cannot copy directories by default, and the - r parameter needs to be added).
5. View the copy result. Directory 123 has been copied successfully.
6. Remarks: parameters after cp
-A This option is usually used when copying directories. It retains link and file attributes, and copies directories recursively. Its role is equal to the combination of dpR options.
-D Keep the link when copying.
-F Delete the existing target file without prompting.
-On the contrary, the i and f options will prompt the user for confirmation before overwriting the target file. When you answer y, the target file will be overwritten, which is an interactive copy.
-PAt this time, in addition to copying the contents of the source file, cp will also copy its modification time and access permissions to the new file.
-R If the given source file is a directory file, then cp will recursively copy all subdirectories and files under the directory. The target file must be a directory name.
-L Do not copy, just link files.
matters needing attention:
1. The cp - a command can also complete directory replication.
2. Format cp - r directory name New directory name.
The above is all about how to deal with cp: omitting directory errors (detailed solutions) in Linux. After understanding, I believe you can find out the problem. If you want to know more about technology, please pay attention to INTERNET DATA.
related topic
- IID.HK shares some commonly used IT network online detection websites
- Expand the root directory space of the CentOS system, and expand the home directory space to the root directory
- IDGlobal teaches you how to set up root remote login in Ubuntu SSH
- What should I do if the proxy server link fails to respond?
- How to view user login logs in the IID server Linux system?
- How does CentOS7 open/view ports?