Hone

Lessons · Network switches · copy FROM TO, source first

copy FROM TO, with no exceptions

Every copy command on a switch is source first, destination second. Four commands you will use constantly are the same rule read left to right.

Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.

What it is for

Both directions are valid commands, so nothing stops you getting it backwards -- and backwards you overwrite either your only backup or the switch you came to fix.

How to think about it

Say the line out loud as a sentence: copy this, onto that. If the sentence is wrong, the command is.

Worked example

enable
In.
configure terminal
Configuring.
hostname CLOSET-3
Something to save.
end
Done.
copy running-config startup-config
Live, onto the one that boots. This saves.
copy running-config tftp://10.0.0.9/closet3.cfg
Live, onto a server. This backs up.
copy startup-config running-config
Saved, onto live. The same two files the other way, and it LOADS.
show running-config | include hostname
Still CLOSET-3, because that is what both files said.

Your turn

Save the configuration that is running right now.

 running-config startup-config

The trap

Reading the two arguments as a pair of names rather than as a direction. They are never interchangeable and both orders run.

Practise copy FROM TO, source first on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.