You can view the router’s directory structure as well as individual files by issuing the file command in operational mode.
- user@host> file ?
- Possible completions:
- compareCompare files (local)
- copyCopy files (local or remote)
- deleteDelete files from the system (local)
- listList file information (local)
- renameRename files (local)
- showDisplay file contents (local)
Help shows that the file command includes several options for manipulating files.
The default directory for the file list command is the home directory of the user logged in to the router. In fact, the user’s home directory is the default directory for most of the JUNOS software commands requiring a filename.
- user@host> file list /?
- Possible completions:
- <[Enter]> Execute this command
- <path> Path to list
- /COPYRIGHT Size: 4735, Last changed: Mar 31 2001
- /altconfig/ Last changed: Dec 11 2001
- /altroot/ Last changed: Dec 11 2001
- /bin/ Last changed: Aug 26 08:49:25
- /boot/ Last changed: Oct 03 16:27:55
- /config/ Last changed: Oct 03 16:27:56
- /dev/ Last changed: Sep 30 12:10:56
- /etc/ Last changed: Oct 03 16:27:56
- /kernel Size: 9302545, Last changed: Apr 30 02:00:21
- /mnt/ Last changed: Dec 11 2001
- /modules/ Last changed: Aug 26 08:43:17
- /packages/ Last changed: Aug 26 08:49:45
- /proc/ Last changed: Oct 04 10:20:32
- /root/ Last changed: Aug 26 08:47:33
- /sbin/ Last changed: Aug 26 08:49:45
- /tmp/ Last changed: Oct 03 16:27:55
- /usr/ Last changed: Dec 11 2001
- /var/ Last changed: Dec 27 2001
- user@host> file list /var/?
- Possible completions:
- <[Enter]> Execute this command
- <path> Path to list
- /var/crash/ Last changed: Sep 16 09:03:30
- /var/cron/ Last changed: Dec 27 2001
- /var/db/ Last changed: Oct 03 16:27:56
- /var/etc/ Last changed: Oct 03 16:27:56
- /var/home/ Last changed: Oct 03 15:07:40
- /var/log/ Last changed: Oct 03 16:27:56
- /var/run/ Last changed: Oct 04 10:07:53
- /var/sw/ Last changed: Dec 27 2001
- /var/tmp/ Last changed: Sep 30 12:11:28
- user@host> file show /var/log/inventory
- Jun 20 20:02:35 CHASSISD release 7.1I0 built by builder
on 2005-04-29 07:59:59 UTC
- Jun 20 20:02:57 CHASSISD release 7.1I0 built by builder
on 2005-04-29 07:59:59 UTC
- Jun 20 20:02:59 Routing Engine 0 - part number 740-003239,
serial number 9001017848
- Jun 20 20:04:00 SSB 0 - part number 710-001951, serial
number AG1024
- Jun 20 20:04:00 SSRAM bank 0 - part number 710-001385,
serial number 214095
- Jun 20 20:04:00 SSRAM bank 1 - part number 710-001385,
serial number 214241
- Jun 20 20:04:00 SSRAM bank 2 - part number 710-001385,
serial number 214192
- ...