<commit_before>.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "KDB\-CP" "1" "April 2019" "" ""
.
.SH "NAME"
\fBkdb\-cp\fR \- Copy keys within the key database
.
.SH "SYNOPSIS"
\fBkdb cp <source> <dest>\fR
.
.SH "DESCRIPTION"
This command copies key(s) in the Key database\. You can copy keys to another directory within the database or even below another key\. Note that you cannot copy a key below itself\.
.
.P
Where \fBsource\fR is the path of the key(s) you want to copy and \fBdest\fR is the path where you would like to copy the key(s) to\. Note that when using the \fB\-r\fR flag, \fBsource\fR as well as all of the keys below it will be copied\.
.
.SH "LIMITATIONS"
Neither \fBsource\fR nor \fBdest\fR can be a cascading key\. (Start with \fB/\fR)\. Make sure to select a namespace\.
.
.SH "RETURN VALUES"
This command will return the following values as an exit status:
.
.TP
0
No errors\.
.
.TP
1\-10
standard exit codes, see kdb(1) \fIkdb\.md\fR
.
.TP
11
No key to copy found\.
.
.SH "OPTIONS"
.
.TP
\fB\-H\fR, \fB\-\-help\fR
Show the man page\.
.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print version info\.
.
.TP
\fB\-p\fR, \fB\-\-profile <profile>\fR
Use a different kdb profile\.
.
.TP
\fB\-C\fR, \fB\-\-color <when>\fR
Print never/auto(default)/always colored output\.
.
.TP
\fB\-r\fR, \fB\-\-recursive\fR
Recursively copy keys\.
.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Explain what is happening\.
.
.TP
\fB\-f\fR, \fB\-\-force\fR
Force overwriting the keys\.
.
.SH "EXAMPLES"
.
.nf

# Backup\-and\-Restore: user/tests/cp/examples

# Create the keys we use for the examples
kdb set user/tests/cp/examples/kdb\-cp/key key1
kdb set user/tests/cp/examples/kdb\-cp/key/first key
kdb set user/tests/cp/examples/kdb\-cp/key/second key
kdb set user/tests/cp/examples/kdb\-cp/cpkey key1
kdb set user/tests/cp/examples/kdb\-cp/cpkey/first key
kdb set user/tests/cp/examples/kdb\-cp/cpkey/second key
kdb set user/tests/cp/examples/kdb\-cp/cpkeyerror/first key
kdb set user/tests/cp/examples/kdb\-cp/cpkeyerror/second anotherValue
kdb set user/tests/cp/examples/kdb\-cp/another/key one
kdb set user/tests/cp/examples/kdb\-cp/another/value two

# To copy a single key:
kdb cp user/tests/cp/examples/kdb\-cp/key user/tests/cp/examples/kdb\-cp/key2
#>

# To copy multiple keys:
kdb cp \-r user/tests/cp/examples/kdb\-cp/key user/tests/cp/examples/kdb\-cp/copied
#>

# If the target\-key already exists and has a different value, cp fails:
kdb cp \-r user/tests/cp/examples/kdb\-cp/key user/tests/cp/examples/kdb\-cp/cpkeyerror
# RET: 11

# If the target\-key already exists and has the same value as the source, everything is fine:
kdb cp \-r user/tests/cp/examples/kdb\-cp/key user/tests/cp/examples/kdb\-cp/cpkey
#>

# To copy keys below an existing key:
kdb cp \-r user/tests/cp/examples/kdb\-cp/another user/tests/cp/examples/kdb\-cp/another/key
#>

kdb rm \-r user/tests/cp/examples/kdb\-cp/
.
.fi
<commit_msg>KDB CP: Update man page<commit_after>.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "KDB\-CP" "1" "April 2019" "" ""
.
.SH "NAME"
\fBkdb\-cp\fR \- Copy keys within the key database
.
.SH "SYNOPSIS"
\fBkdb cp <source> <dest>\fR
.
.SH "DESCRIPTION"
This command copies key(s) in the Key database\. You can copy keys to another directory within the database or even below another key\. Note that you cannot copy a key below itself\.
.
.P
Where \fBsource\fR is the path of the key(s) you want to copy and \fBdest\fR is the path where you would like to copy the key(s) to\. Note that when using the \fB\-r\fR flag, \fBsource\fR as well as all of the keys below it will be copied\.
.
.SH "LIMITATIONS"
Neither \fBsource\fR nor \fBdest\fR can be a cascading key\. (Start with \fB/\fR)\. Make sure to select a namespace\.
.
.SH "RETURN VALUES"
This command will return the following values as an exit status:
.
.TP
0
No errors\.
.
.TP
1\-10
standard exit codes, see kdb(1) \fIkdb\.md\fR
.
.TP
11
No key to copy found\.
.
.SH "OPTIONS"
.
.TP
\fB\-H\fR, \fB\-\-help\fR
Show the man page\.
.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print version info\.
.
.TP
\fB\-p\fR, \fB\-\-profile <profile>\fR
Use a different kdb profile\.
.
.TP
\fB\-C\fR, \fB\-\-color <when>\fR
Print never/auto(default)/always colored output\.
.
.TP
\fB\-r\fR, \fB\-\-recursive\fR
Recursively copy keys\.
.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Explain what is happening\.
.
.TP
\fB\-f\fR, \fB\-\-force\fR
Force overwriting the keys\.
.
.SH "EXAMPLES"
.
.nf

# Backup\-and\-Restore: user/tests/cp/examples

# Create the keys we use for the examples
kdb set user/tests/cp/examples/kdb\-cp/key key1
kdb set user/tests/cp/examples/kdb\-cp/key/first key
kdb set user/tests/cp/examples/kdb\-cp/key/second key
kdb set user/tests/cp/examples/kdb\-cp/cpkey key1
kdb set user/tests/cp/examples/kdb\-cp/cpkey/first key
kdb set user/tests/cp/examples/kdb\-cp/cpkey/second key
kdb set user/tests/cp/examples/kdb\-cp/cpkeyerror/first key
kdb set user/tests/cp/examples/kdb\-cp/cpkeyerror/second anotherValue
kdb set user/tests/cp/examples/kdb\-cp/another/key one
kdb set user/tests/cp/examples/kdb\-cp/another/value two

# To copy a single key:
kdb cp user/tests/cp/examples/kdb\-cp/key user/tests/cp/examples/kdb\-cp/key2
#>

# To copy multiple keys:
kdb cp \-r user/tests/cp/examples/kdb\-cp/key user/tests/cp/examples/kdb\-cp/copied
#>

# If the target\-key already exists and has a different value, cp fails:
kdb cp \-r user/tests/cp/examples/kdb\-cp/key user/tests/cp/examples/kdb\-cp/cpkeyerror
# RET: 11

# If the target\-key already exists and has the same value as the source, everything is fine:
kdb cp \-r user/tests/cp/examples/kdb\-cp/key user/tests/cp/examples/kdb\-cp/cpkey
#>

# To force the copy of keys:
kdb cp \-rf user/tests/cp/examples/kdb\-cp/key user/tests/cp/examples/kdb\-cp/cpkeyerror
#>

# Now the key\-values of /cpkeyerror are overwritten:
kdb export user/tests/cp/examples/kdb\-cp/cpkeyerror mini
#> =key1
#> first=key
#> second=key

# To copy keys below an existing key:
kdb cp \-r user/tests/cp/examples/kdb\-cp/another user/tests/cp/examples/kdb\-cp/another/key
#>

kdb rm \-r user/tests/cp/examples/kdb\-cp/
.
.fi

{'fraction_non_alphanumeric': 0.15571776155717762, 'fraction_numerical': 0.00762368207623682, 'mean_word_length': 2.90253164556962, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '730014', 'n_tokens_mistral': 2576, 'n_tokens_neox': 2397, 'n_words': 709}