
Just like a Windows or Linux operating system, the Cisco IOS has its own list of commands to manipulate files, very similar to DOS/Windows commands. These files could be your IOS router operating system, configuration file, or other type of IOS file. Knowing these file commands is a critical requirement for any Cisco admin.

Let’s look at 10 Cisco IOS file management commands you must know.
#1 dir
This shows a directory list of files on a filesystem. To see the options, type dir ?
Router#dir ?
/all List all files
/recursive List files recursively
all-filesystems List files on all filesystems
archive: Directory or file name
cns: Directory or file name
flash: Directory or file name
null: Directory or file name
nvram: Directory or file name
system: Directory or file name
tar: Directory or file name
tmpsys: Directory or file name
xmodem: Directory or file name
ymodem: Directory or file name
<cr>
Router#
You can think of each of these filesystems almost like disk drives in DOS, where you have to put a colon after the name. So, the nvram is called nvram:. The default is to show a directory of the router’s flash as your default current directory is flash:
Router# dir
Directory of flash:/
2 -rwx 18929780 Aug 29 2006 15:49:57 +00:00 c870-advipservicesk9-mz.124-15.T5.bin
3 -rwx 2143 Aug 29 2006 16:42:14 +00:00 running-config
23482368 bytes total (4544512 bytes free)
Router#
Every router will have at least flash memory and nvram (non-volatile random access memory).
#2 cd
Change directory: Use cd to change your current directory to a different device or subdirectory on that device. In the following, when I change my directory to the nvram: filesystem and do a dir, I get a list of nvram. I could also cd to a subdirectory after I have created a directory with mkdir.
Router#cd nvram:
Router#dir
Directory of nvram:/
126 -rw- 2143 <no date> startup-config
127 ---- 5 <no date> private-config
128 -rw- 2143 <no date> underlying-config
1 ---- 49 <no date> persistent-data
2 -rw- 0 <no date> ifIndex-table
131072 bytes total (116584 bytes free)
Router#
#3 copy
This is used to copy the IOS or a config file from and to somewhere. You would use this to copy the router’s configuration off the router to a TFTP server or just make a local backup of it on the router. You would also use the copy command to upgrade the router with a new IOS from a TFTP server.