In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to copy CentOS files and operate on the computer, in view of this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.
I personally think that CentOS copy files work well in the CentOS series of file systems, I would like to recommend to you. CentOS copies a file or directory. CentOS Linux and its corresponding version number RHEL distribution have package-level binary compatibility, that is, if a RPM package can be installed and run in a RHEL product, it can be installed and run normally in the corresponding version of CentOS Linux.
Syntax: cp [- abdfilpPrRsuvx] [- S] [- V] [--help] [--spares=] [--version] [source file or directory] [target file or directory] [destination directory] additional note: the cp instruction is used to copy files or directories in CentOS, as when specifying more than two files or directories, and the destination of * is an existing directory. Then it copies all the files or directories previously specified CentOS to that directory. If you specify multiple files or directories at the same time, and the destination of * * is not an existing directory, an error message will appear.
Parameters:
-an or-- archive is equivalent to the "- dpR" parameter, and CentOS copies the file status, permissions and other information as far as possible.
-b or-- backup is deleted, overwriting the backup before the target file, and the backup file will be suffixed with a backup string.
-d or-- no-dereference when CentOS copies a symbolic connection to a file, establishes the destination file or directory as a symbolic connection and points to the original file or directory connected to the source file or directory.
-f or-- force forces CentOS to copy a file or directory, regardless of whether the target file or directory already exists.
-I or-- interactive asks the user before overwriting existing files.
-l or-- link establishes a hard connection to the source file instead of CentOS copying the file.
-p or-- preserve retains the properties of the source file or directory.
-P or-- parents retains the path to the source file or directory.
-r Recursive processing, which processes the files in the specified directory with the subdirectories.
-R or-- recursive recursive processing that processes all files in the specified directory with subdirectories.
-s or-- symbolic-link establishes a symbolic connection to the source file instead of CentOS copying the file.
After-S or-- suffix= backs up the target file with the "- b" parameter, the backup file suffix is appended with a backup string, and the default backup suffix string is the symbol "~".
When-u or-- update uses this parameter, CentOS copies the file only when the change time of the source file is newer than that of the target file, or if the target file with corresponding names does not exist.
-v or-- verbose shows the instruction execution process.
After-V or-- version-control= backs up the target file with the "- b" parameter, the backup file suffixes are appended with a backup string, which can not only be changed with the "- S" parameter, but also generate backup strings with different suffixes when the "- V" parameter is used to specify different backup methods.
-x or-- one-file-system replicated files or directories must be stored in the same file system as when the cp instruction was executed, otherwise CentOS will not copy files.
Operation on the computer:
[OK_008@CentOS4 OK008Filed] $lsmytxt.txt untar
[OK_008@CentOS4 OK008Filed] $cp mytxt.txt mytxt1.txt-copy the file mytxt.txt and name it mytxt1.txt
[OK_008@CentOS4 OK008Filed] $lsmytxt1.txt mytxt.txt untar
-- CentOS copies files to a directory.
[OK_008@CentOS4 OK008Filed] $mkdir mydir-- create a new directory mydir first
[OK_008@CentOS4 OK008Filed] $lsmydir mytxt1.txt mytxt.txt untar
[OK_008@CentOS4 OK008Filed] $cd mydir
[OK_008@CentOS4 mydir] $cd..
[OK_008@CentOS4 OK008Filed] $cp * .txt mydir
-- CentOS copies files with the suffix txt to the mydir directory
[OK_008@CentOS4 OK008Filed] $cd mydir
[OK_008@CentOS4 mydir] $lsmytxt1.txt mytxt.txt
[OK_008@CentOS4 mydir] $
[OK_008@CentOS4 mydir] $rm * .txt-- Delete all .txt files in the mydir directory
[OK_008@CentOS4 mydir] $ls
[OK_008@CentOS4 mydir] $cp ~ / OK008Filed/*.txt.
-- CentOS copies all .txt files under the current user directory OK008Filed to the current mydir directory. Be careful not to forget the following ".", "." Represents the current directory in Linux
[OK_008@CentOS4 mydir] $lsmytxt1.txt mytxt.txt
[OK_008@CentOS4 mydir] $
-- CentOS copies files from the OK008Filed directory to the user directory.
[OK_008@CentOS4 OK008Filed] $lsmydir mytxt1.txt mytxt.txt untar
[OK_008@CentOS4 OK008Filed] $cd ~ /-- returns the user directory
[OK_008@CentOS4 ~] $lsOK008Filed TestFile-there are only OK008Filed and TestFile in the user directory
[OK_008@CentOS4 ~] $cd OK008Filed
[OK_008@CentOS4 OK008Filed] $cp * .txt untar ~ /-- copy * .txt and untar files to the user directory.
[OK_008@CentOS4 OK008Filed] $cd..
[OK_008@CentOS4 ~] $lsmytxt1.txt mytxt.txt OK008Filed TestFile untar-indicates that the copy is successful.
[OK_008@CentOS4 ~] $
Today's learning content is not much, the important thing is to adhere to and find the problem and solve the problem, and then summarize the problem, the remaining time to study abroad point Oracle database.
This is the answer to the question about how to copy CentOS files and operate on the computer. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
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.