• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6520
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

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