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 copy files in a linux system

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

Share

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

File copy command cp

Command format:

Cp [- adfilprsu] Source file (source) destination file (destination) cp [option] source1 source2 source3... Directory

Parameter description:

-a: it means archive, and it also means copying all the directories.

-d: if the source file is a connection file (link file), copy the properties of the connection file instead of the file itself

-f: force (force), if there is repetition or other questions, the user will not be asked, but will be forced to copy

-I: if the target file (destination) already exists, it will first ask whether the operation is true when overwriting.

-l: establish a hard connection file (hard link) instead of copying the file itself

-p: copied with the properties of the file instead of using the default properties

-r: recursive replication for directory replication operations

-s: copy into a symbolic link file (symbolic link), that is, a "shortcut" file

-u: if the target file is older than the source file, update the target file

For example:

Copy the file1 from the / test1 directory to the / test3 directory and change the file name to file2, enter the following command:

Cp / test1/file1 / test3/file2

These are the details of how to copy files in linux. Please pay more attention to other related articles!

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