• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6011
  • Last Modified:

Editing text files from Cisco IOS Command Line

Hello,

Is there any way to edit a configuration/text file on a Cisco network device from Command Line? i.e. to add a line in startup configuration file without adding the same line in running configuration first and without having to copy the complete file to/from a remote host using ftp, e.t.c. You can display the contents of a file using the "more" command, but what about changing the contents of a file?

Thanks.
0
Harrris
Asked:
Harrris
  • 2
  • 2
2 Solutions
 
Don JohnstonInstructorCommented:
In a word, No.
0
 
arnoldCommented:
To what end? If you make an error in a startup config that you previously did not test in the running config to make sure it is ok, on power failure/reboot the router device might not come up.

Why not copy running to tftp, modify it on the tftp server and load it back.

You could configure the router to load data from tftp.
0
 
MysidiaCommented:
In IOS, No.
In IOS-XR, Yes.

In IOS, to do what you suggest, you will need to copy the startup-config to a remote device,
in order to edit the file directly.

Direct editing is not recommended and should be done only with extreme care.
0
 
Don JohnstonInstructorCommented:
IIRC, The microemacs editor in IOS-XR can only be used to edit routing polices. And the edits can only be applied to the running-config.
0
 
MysidiaCommented:
In IOS-XR, you can get a ksh prompt by using the "run" command;
although it is not recommended or supported that you do this ,

it is then  possible to do things like
cd /
cd disk0:/config/admin

And the vim, emacs, or nano editors can be invoked on the various text files
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now