Difference between revisions of "Cp"

From Linuxintro
imported>ThorstenStaerk
(New page: The command cp is used to copy files. The following options are described here: * cp -pr - copies a file preserving its attributes)
 
imported>ThorstenStaerk
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
The command [[cp]] is used to copy files. The following options are described here:
+
The [[command]] [[cp]] is used to copy files. The following options are described here:
* [[cp -pr]] - copies a file preserving its attributes
+
 
 +
== copy a file preserving its attributes ==
 +
See [[cp -pr]]
 +
 
 +
== copy all *.txt file to *.txt.bak ==
 +
Most Linux distros use the [[bash]] [[shell]], here the command is:
 +
for i in *.txt; do cp $i $i.bak; done
 +
 
 +
= See also =
 +
* [http://unixhelp.ed.ac.uk/CGI/man-cgi?cp cp's man page]

Latest revision as of 06:46, 19 April 2014

The command cp is used to copy files. The following options are described here:

copy a file preserving its attributes

See cp -pr

copy all *.txt file to *.txt.bak

Most Linux distros use the bash shell, here the command is:

for i in *.txt; do cp $i $i.bak; done

See also