more [file]
Displays the contents of a file stored in the router's flash memory or other file systems, commonly used to view configuration files, logs, or text files.
Definition: more [file] is a Cisco IOS privileged exec command. Displays the contents of a file stored in the router's flash memory or other file systems, commonly used to view configuration files, logs, or text files.
Overview
The `more` command in Cisco IOS is used to display the contents of a file stored in the router's flash memory or other file systems. It is commonly employed to view configuration files, logs, or text files without entering configuration mode. This command is essential for network engineers who need to inspect startup configurations, backup files, or diagnostic logs directly from the device's storage.
Unlike `show running-config` or `show startup-config`, which display the current or saved configuration from NVRAM, `more` allows viewing arbitrary files, such as crashinfo files, syslog messages, or even text files uploaded to flash. It is particularly useful when troubleshooting boot issues, verifying file integrity, or extracting specific data from large log files. The command operates in privileged EXEC mode (enable mode) and requires privilege level 15.
Output is buffered, meaning it may be truncated if the file is large, but the `more` command paginates output by default, pausing after each screenful. It does not affect the running configuration or device performance. When used with the `|` (pipe) operator, output can be filtered using `include`, `exclude`, or `begin` keywords.
Alternatives include `dir` to list files, `copy` to transfer files, and `show` commands for specific configurations. The `more` command is a fundamental tool for file inspection in Cisco IOS, bridging the gap between simple file listing and advanced file manipulation.
more [file]When to Use This Command
- View the startup configuration file (startup-config) to verify saved settings.
- Inspect a log file (e.g., crashinfo) to troubleshoot router crashes.
- Read a text file (e.g., a script or notes) stored on flash.
- Verify the contents of a configuration file before copying it to another device.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| file-url | filesystem:/file-path/filename | Specifies the location and name of the file to display. The file URL includes the filesystem (e.g., flash:, nvram:, disk0:) and the full path. Common mistakes include omitting the filesystem prefix or using incorrect case for filenames (IOS is case-sensitive). Valid filesystems vary by platform; typical ones are flash: for internal flash, nvram: for NVRAM, and usbflash0: for USB storage. |
Command Examples
View startup configuration
more nvram:startup-configBuilding configuration... Current configuration : 1234 bytes ! version 15.2 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname Router1 ! interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.0 duplex auto speed auto ! interface GigabitEthernet0/1 ip address 10.0.0.1 255.255.255.0 duplex auto speed auto ! end
The output shows the startup configuration stored in NVRAM. 'Building configuration...' indicates the file is being read. Each line is a configuration command. Key fields: 'version' shows IOS version, 'hostname' is the device name, 'interface' sections show IP addresses and settings. The 'end' marks the end of the configuration.
View a text file on flash
more flash:backup-config.txt! Backup configuration taken on 2025-01-15 ! hostname Router1 ! interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.0 ! end
This displays the contents of a text file named 'backup-config.txt' on flash. The output shows the file's content line by line. Comments (lines starting with '!') are included. The file ends with 'end'.
Understanding the Output
The 'more' command outputs the file content line by line, pausing after each screenful (press Space to continue, Enter for next line, or Ctrl-C to quit). The output is plain text exactly as stored. For configuration files, each line is a Cisco IOS command.
Look for 'Building configuration...' at the start. Comments (lines starting with '!') are informational. The 'end' line marks the end of the configuration.
In log files, timestamps and severity levels are important. Good values: no error messages, correct syntax. Bad values: unexpected characters, truncated lines, or 'File not found' error.
Configuration Scenarios
View the startup configuration stored in NVRAM
A network engineer needs to verify the startup configuration before reloading a router. The `more` command allows inspection of the actual file in NVRAM, which may differ from the running config if changes were not saved.
Topology
Single router: R1Steps
- 1.Step 1: Enter privileged EXEC mode: R1> enable
- 2.Step 2: View the startup configuration: R1# more nvram:startup-config
! No configuration changes are made; this is a verification step. R1# more nvram:startup-config
Verify: The output displays the full startup configuration. Expected output begins with 'version 15.2' and includes all configured interfaces, routing protocols, and security settings.
Watch out: If the startup-config file is corrupted or missing, the command returns an error like '%Error opening nvram:/startup-config'. Always verify file existence with `dir nvram:` first.
Inspect a syslog file stored in flash for troubleshooting
A router is experiencing intermittent connectivity issues. The engineer wants to review the syslog messages that were logged to a file in flash memory to identify patterns or errors.
Topology
Single router: R1Steps
- 1.Step 1: Enter privileged EXEC mode: R1> enable
- 2.Step 2: List files in flash to confirm the log file exists: R1# dir flash:
- 3.Step 3: Display the syslog file: R1# more flash:syslog-1.log
! No configuration changes are made. R1# more flash:syslog-1.log
Verify: The output shows timestamped syslog messages. Look for entries with %LINEPROTO-5-UPDOWN or %LINK-3-UPDOWN to identify interface flapping.
Watch out: Syslog files can be large; use the `|` pipe to filter output, e.g., `more flash:syslog-1.log | include UPDOWN`. If the file is too large, the command may take time to display and could impact terminal performance.
Troubleshooting with This Command
The `more` command is invaluable for troubleshooting when you need to examine files that are not accessible via standard `show` commands. Healthy output from `more` displays the file contents without errors. If the file is empty, the command returns a blank line or a prompt.
Problem indicators include error messages such as '%Error opening' (file not found or filesystem unavailable) or '%Error reading' (file corruption). When viewing configuration files, pay attention to syntax errors or missing commands that could cause boot failures. For log files, focus on timestamps, severity levels, and repeated error messages.
A step-by-step diagnostic flow: 1) Use `dir` to list available files and check free space. 2) Use `more` to view the startup-config if the router fails to boot correctly; compare it with a known good backup. 3) For crashinfo files, use `more flash:crashinfo_YYYYMMDD-HHMMSS` to analyze the crash dump. 4) Correlate with `show logging` to see if logs are being written to a file. 5) Use `more` with `| begin` to skip to a specific section, e.g., `more nvram:startup-config | begin interface`. Common symptoms: 'Router boots to ROMmon' often indicates a corrupted startup-config; use `more nvram:startup-config` to verify. 'Missing routes' may be due to a deleted configuration file; check with `more`.
The `more` command complements `debug` commands by allowing offline analysis of log files without enabling debug output in real-time.
CCNA Exam Tips
CCNA exam may ask which command to use to view the startup configuration without entering config mode — 'more nvram:startup-config' is correct.
Remember that 'more' works with any file system (flash:, nvram:, etc.) and is case-sensitive for filenames.
The 'more' command pauses output; know that Space scrolls a page, Enter scrolls a line, and Ctrl-C aborts.
Be aware that 'more' can display binary files but output will be garbled; it's intended for text files.
Common Mistakes
Forgetting to specify the file system (e.g., 'more startup-config' instead of 'more nvram:startup-config') — results in '% Invalid input detected'.
Using 'more' on a directory instead of a file — outputs a list of files, not contents.
Typing the filename incorrectly (case-sensitive) — results in 'File not found' error.
more [file] vs dir
The 'more' and 'dir' commands both operate on the router's file system and are commonly confused because they are often used together when examining files. However, 'dir' lists the files present while 'more' displays the actual content of a specific file.
| Aspect | more [file] | dir |
|---|---|---|
| Output | File content (text) | Directory listing (names, sizes, dates) |
| Required argument | Filename (e.g., more flash:config.text) | Optional filesystem path (e.g., dir flash:) |
| Use case | Viewing configuration, logs, or text files | Listing files and checking disk space |
| Filesystem impact | Read-only access | Read-only access |
| Common companion | Often used after dir to examine a specific file | Often used before more to identify files |
Use more [file] when you need to read the contents of a configuration file, log, or other text file stored on the router.
Use dir when you need to see which files are available, their sizes, and how much free space remains in a filesystem.
Platform Notes
In IOS-XE, the `more` command syntax is identical, but filesystems may differ (e.g., 'flash:' is common, but 'bootflash:' is used on some platforms). Output format is consistent with classic IOS. On NX-OS, the equivalent command is `show file` or `cat` (in Bash shell).
For example, `show file bootflash:filename` displays file contents. NX-OS also supports `more` in the Bash shell. ASA uses `more` similarly, but filesystems include 'disk0:' and 'flash:'.
In IOS-XR, the command is `more` as well, but filesystems are like 'harddisk:' or 'disk0:'. Behavior differences: IOS 12.x and 15.x have identical `more` functionality; IOS 16.x (IOS-XE) may have enhanced pagination. The command exists in all major IOS versions, but always verify filesystem names with `dir` on the specific platform.
Related Commands
dir
Lists files in the specified filesystem (flash, NVRAM, USB, bootflash). Shows file names, sizes in bytes, dates, and total/free space available.
show running-config
Displays the current active configuration in DRAM, showing all non-default settings.
show startup-config
Displays the saved configuration stored in NVRAM that loads on next device boot.
Practice for the CCNA 200-301
Test your knowledge with practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions