File management

The file system

The SR OS file system is used to store files used and generated by the system, for example, image files, configuration files, logging files and accounting files.

The file commands allow you to copy, create, move, and delete files and directories, navigate to a different directory, display file or directory contents and the image version.

Although some of the storage devices on routers are not actually compact flash devices (for example, cf1: on the 7950 XRS is an internal SSD), all storage devices are referred to as compact flash.

Storage devices

In the 7750 SR and 7450 ESS, each control processor can have up to three storage devices numbered one through three. In the 7950 XRS, each CCM has an SSD and up to two compact flash devices. The names for these devices are:

  • cf1:

  • cf2:

  • cf3:

The above device names are relative device names as they refer to the devices local to the control processor with the current console session. The colon (‟:”) at the end of the name indicates it is a device.

The three compact flash devices on the 7450 ESS and 7750 SR OS are removable and have an administrative state.

The cf2: and cf3: compact flash devices on the 7950 XRS routers are removable and have an administrative state. cf1: is an internal SSD.

Devices vary by platform as compact flash, SD card, USB, or embedded SSD.

Note:

To prevent corrupting open files in the file system, only remove a compact flash that is administratively shutdown. SR OS gracefully closes any open files on the device, so it can be safely removed.

URLs

The arguments for the SR OS file commands are modeled after standard universal resource locater (URL). A URL refers to a file (a file-url) or a directory (a directory-url).

SR OS supports operations on both the local file system and on remote files. For the purposes of categorizing the applicability of commands to local and remote file operations, URLs are divided into five types of URLs: local, ftp, tftp, http, and https. The syntax for each of the URL types are listed in URL types and syntax .

Table 1. URL types and syntax
URL type Syntax Notes

local-url

[cflash-id:\]path

cflash-id is the compact flash device name.

Values: cf1:, cf2:, cf3:

ftp-url

ftp://[username[:password]@]host/path

An absolute FTP path from the root of the remote file system.

username is the FTP username

password is the FTP user password

host is the remote host

path is the path to the directory or file

ftp://[username[:password]@]host/./path

A relative FTP path from the user’s home directory. Note the period and slash (‟./”) in this syntax compared to the absolute path.

tftp-url

tftp://host[/path]/filename

TFTP is only supported for operations on file-urls.

http-url

http://[username[:password]@]host[:port]/path

host is an HTTP server

port defaults to 80

https-url

https://[username[:password]@]host[:port]/path

host is an HTTPS server

port defaults to 443

If the host portion of the URL is an IPv6 address, then the address should be enclosed in square brackets. For example:

  • ftp://username:password@[3ffe::97]/./testfile.txt
  • tftp://[2001:db8:3333:4444:5555:6666:7777:8888]/./testfile.txt

The system accepts forward slash (/) or backslash (\) characters to delimit directory and/or filenames in URLs. Similarly, the SR OS SCP client application can use either slash or backslash characters, but not all SCP clients treat backslash characters as equivalent to slash characters. In particular, UNIX systems often interprets the backslash character as an escape character. This can cause problems when using an external SCP client application to send files to the SCP server. If the external system treats the backslash like an escape character, the backslash delimiter gets stripped by the parser and is not transmitted to the SCP server.

For example, a destination directory specified as ‟cf1:\dir1\file1” is transmitted to the SCP server as ‟cf1:dir1file1” where the backslash escape characters are stripped by the SCP client system before transmission. On systems where the client treats the backslash like an escape character, a double backslash (\\) or the forward slash (/) can typically be used to properly delimit directories and the filename.

When a special character is used in a password, it can cause issues when that password is encoded as part of a URL. To prevent this issue, percent encoding can be used. Percent encoding is a mechanism to encode 8-bit characters that have specific meaning in the context of URLs. The encoding consists of substitution of a percent character (%) followed by the hexadecimal representation of the ASCII value of the replaced character.

Some file manipulation commands such as copying, removing, or moving files, may request access to an HTTP or HTTPS server. If an HTTP or HTTPS server redirects the system to a different URL (from an "HTTP 301" error or similar response), the system prompts the user "y/n" to either repeat the operation with the new URL or terminate it. These file commands can be configured to force the HTTP redirects without prompting or they can be configured to refuse HTTP redirects. If a file command is redirected more than eight times, or if it queries an HTTPS URL and gets redirected to an HTTP URL, the command automatically terminates as a security measure.

Use the following command to refuse HTTP redirects:
  • MD-CLI
    copy source-url destination-url direct-http
  • classic CLI
    copy source-url dest-url no-redirect
Use the following command to force the HTTP redirects without prompting:
  • MD-CLI
    copy source-url destination-url force
  • classic CLI
    copy source-url dest-url force

When connecting to an HTTPS server, the system verifies the server's TLS certificate. For the certificate to pass verification, the system must have a CA profile already configured for the server's Certificate Authority (CA), which specifies up-to-date certificate and CRL files. HTTPS file commands do not use the Online Certificate Status Protocol (OCSP). If the certificate was issued by an intermediate CA, the system must have a CA profile for every CA tracing back to the root CA. If the server's certificate fails verification for any reason, the file command terminates. See the 7450 ESS, 7750 SR, and VSR Multiservice Integrated Service Adapter and Extended Services Appliance Guide for more information about CA profiles.

Use the following CLI command to configure the CA profile:
configure system security pki ca-profile

An HTTPS file command may also include a client-tls-profile configuration parameter, referring to a client TLS profile that provides the cipher list, client certificate, and trust anchor the system uses when communicating with the HTTPS server. See the 7450 ESS, 7750 SR, 7950 XRS, and VSR System Management Guide for more information about client TLS profiles.

A file command that connects to an HTTP or HTTPS server outside the local network may need to use an HTTP proxy. The user may specify a proxy server (which must be an HTTP URL).

HTTP digest authentication

For HTTP or HTTPS file commands only, the HTTP digest authentication scheme can be used with the HTTP authentication mechanism as described in RFC 7616 and RFC 2617. The following hash algorithms are supported:
  • MD5
  • SHA-256
  • SHA-512/256

Wildcards and special characters

SR OS supports the standard wildcard characters. The asterisk (*) can represent zero or more characters in a string of characters. The question mark (?) represents any one character and must be enclosed in quotation marks (" ").

MD-CLI

[/file "cf3:\"]
A:admin@node-2# copy bof.* testdir
11 file(s) copied.

[/file "cf3:\"]
A:admin@node-2# 

classic CLI

A:node-2>file cf3:\ # copy bof.* testdir
Copying file cf3:\bof.cfg-1 ... OK
Copying file cf3:\bof.cfg-2 ... OK
Copying file cf3:\bof.cfg-3 ... OK
Copying file cf3:\bof.cfg-4 ... OK
Copying file cf3:\bof.cfg-5 ... OK
Copying file cf3:\bof.cfg-6 ... OK
Copying file cf3:\bof.cfg-7 ... OK
Copying file cf3:\bof.cfg-8 ... OK
Copying file cf3:\bof.cfg-9 ... OK
Copying file cf3:\bof.cfg.1 ... OK
Copying file cf3:\bof.cfg ... OK
11 file(s) copied.
A:node-2>file cf3:\ #

Text editor

The text editor allows the user to edit an ASCII text file. When the user modifies the configuration using a configuration mode, the system validates whether the user is allowed to perform configuration changes. When the text editor is used to edit a configuration file, these validation checks do not occur. For this reason, administrator privileges are required to access the text editor, and the user profile must be modified to allow this access.

Access permission for the directory where the file resides must be granted before a user can open, read, or write a file. If the user does not have permission to access the directory, the operation is denied.

Summary of text editor commands

The text editor operates in the following modes:

  • command mode

    In this mode, every character entered is a command that causes an action to be taken on the text file. For example, the character “O” typed in command mode causes the text editor to enter insert mode.

  • insert mode

    In this mode, every character typed is added to the text in the file. Pressing Esc turns off insert mode.

Using text editor commands

Use the commands described in the tables in this section to do the following:

  • start and end text editor sessions
  • move within a file
  • enter new text
  • modify, move, and delete existing text
  • read from and write to other files

The following table describes the commands to cut, paste, and delete text.

Table 2. Cutting and pasting or deleting text
Text editor command Description
" Specify a buffer to be used with any of the commands using buffers. Follow the quotation mark (") character with a letter or a number that corresponds to a buffer.
d Delete text. The “dd” command deletes the current line. A count specifies the number of lines to delete. Deleted text is placed in the buffer specified with the " command. If no buffer is specified, the general buffer is used.
D Delete to the end of the line from the current cursor position.
p Paste the specified buffer after the current cursor position or line. If no buffer is specified using the " command, the general buffer is used.
P Paste the specified buffer before the current cursor position or line. If no buffer is specified using the " command, the general buffer is used.
x Delete the character under the cursor. A count specifies the number of characters to delete. The characters after the cursor are deleted.
X Delete the character before the cursor.
y Yank text and place the result into a buffer. The “yy” command yanks the current line. Entering a number yanks the specified number of lines. The buffer can be specified with the " command. If no buffer is specified, the general buffer is used.
Y Yank the current line into the specified buffer. If no buffer is specified, the general buffer is used.

The following table describes the commands to insert new text.

Table 3. Inserting new text
Text editor command Description
A Append text at the end of the current line.
I Insert text from the beginning of a line.
O Enter insert mode in a new line above the current cursor position.
a Enter insert mode and append text after the current cursor position. A preceding count inserts all the text that was inserted the specified number of times.
i Enter insert mode and insert typed text before the current cursor position. A preceding count inserts all the text that was inserted the specified number of times.
o Enter insert mode in a new line below the current cursor position.

The following table describes the commands used to move the cursor within the file.

Table 4. Moving the cursor within the file
Text editor command Description
^B Scroll backward one page. A count scrolls that many pages.
^D Scroll forward half a window. A count scrolls that many lines.
^F Scroll forward one page. A count scrolls that many pages.
^H Move the cursor one space to the left. A count moves that many spaces.
^J Move the cursor down one line in the same column. A count moves that many lines down.
^M Move to the first character on the next line.
^N Move the cursor down one line in the same column. A count moves that many lines down.
^P Move the cursor up one line in the same column. A count moves that many lines up.
^U Scroll backward half a window. A count scrolls that many lines.
$ Move the cursor to the end of the current line. A count moves to the end of the following lines.
% Move the cursor to the matching parenthesis or brace.
^ Move the cursor to the first non-whitespace character.
( Move the cursor to the beginning of a sentence.
) Move the cursor to the beginning of the next sentence.
{ Move the cursor to the preceding paragraph.
} Move the cursor to the next paragraph.
| Move the cursor to the column specified by the count.
+ Move the cursor to the first non-whitespace character in the next line.
- Move the cursor to the first non-whitespace character in the previous line.
_ Move the cursor to the first non-whitespace character in the current line.
0 Move the cursor to the first column of the current line.
B Move the cursor back one word, skipping over punctuation.
E Move the cursor forward to the end of a word, skipping over punctuation.
G Go to the line number specified as the count. If no count is specified, go to the end of the file.
H Move the cursor to the first non-whitespace character at the top of the screen.
L Move the cursor to the first non-whitespace character at the bottom of the screen.
M Move the cursor to the first non-whitespace character in the middle of the screen.
W Move forward to the beginning of a word, skipping over punctuation.
b Move the cursor back one word. If the cursor is in the middle of a word, move the cursor to the first character of that word.
e Move the cursor forward one word. If the cursor is in the middle of a word, move the cursor to the last character of that word.
h Move the cursor one character position to the left.
j Move the cursor down one line.
k Move the cursor up one line.
l Move the cursor one character position to the right.
w Move the cursor forward one word. If the cursor is in the middle of a word, move the cursor to the first character of the next word.

The following table describes the commands to move the cursor around the screen.

Table 5. Moving the cursor around the screen
Text editor command Description
^E Scroll forward one line. A count scrolls that many lines.
^Y Scroll backward one line. A count scrolls that many lines.
z

Redraw the screen with the following options:

  • z<return> puts the current line on the top of the screen.
  • z. puts the current line on the center of the screen.
  • z- puts the current line on the bottom of the screen.

If you specify a count before the z command, it changes the current line to the line specified. For example, 16z. puts line 16 on the center of the screen.

The following table describes the commands to replace text.

Table 6. Replacing text
Text editor command Description
C Change to the end of the line from the current cursor position.
R Replace characters on the screen with a set of characters entered, ending with Esc.
S Change an entire line.
c The cc command changes the current line. A count changes that many lines.
r Replace one character under the cursor. Specify a count to replace a number of characters.
s Substitute one character under the cursor, and enter insert mode. Specify a count to substitute a number of characters. A dollar sign ($) is placed at the last character to be substituted.

The following table describes the commands to search for text or characters in the file.

Table 7. Searching for text or characters
Text editor command Description
, Repeat the last f, F, t or T command in the reverse direction.
/ Search the file forward for the string specified after the forward slash (/).
; Repeat the last f, F, t or T command.
? Search the file backward for the string specified after the ?.
F Search the current line backward for the character specified after the F command. If found, move the cursor to the position.
N Repeat the last search done by forward slash (/) or question mark (?) in the backward direction.
T Search the current line backward for the character specified after the T command, and move to the column after the character, if it is found.
f Search the current line for the character specified after the f command. If found, move the cursor to the position.
n Repeat the last search done by forward slash (/) or question mark (?) in the forward direction
t Search the current line for the character specified after the t command, and move to the column before the character, if it is found.

The following table describes the commands to manipulate character and line formatting.

Table 8. Manipulating character and line formatting
Text editor command Description
~ Switch the case of the character under the cursor.
< Shift the lines up to the left by one shiftwidth. The << command shifts the current line to the left and can be specified with a count.
> Shift the lines up to the right by one shiftwidth. The >> command shifts the current line to the right and can be specified with a count.
J Join the current line with the next one. A count joins that many lines.

The following table describes miscellaneous commands.

Table 9. Miscellaneous commands
Text editor command Description
^G Show the current file name and the status.
^L Clear and redraw the screen.
^R Redraw the screen removing false lines.
^[ Cancel a partially formed command (Esc).
^^ Go back to the last file edited.
& Repeat the previous :s command.
. Repeat the last command that modified the file.
: Begin typing a line editing command. The command is executed when the user presses Enter.
@ Type the command stored in the specified buffer.
U Restore the current line to the previous state before the cursor entered the line.
m Mark the current position with the character specified after the m command.
u Undo the last change to the file. Typing u again will redo the change.
ZZ Exit the editor, saving if any changes were made.

From the text editor, use the : command to enter a line editing command. To modify more than one line using specific commands (such as :s and :w), the range must be specified before the command. For example, to substitute lines 3 through 15, the command is :3,15s/from/this/g.

The following table describes the commonly used line editing commands.

Table 10. Line editing commands
Text editor command Description
:ab string strings Abbreviation. If a word is typed in the text editor corresponding to string1, the editor automatically inserts the corresponding words. For example, the abbreviation ":ab vprn Virtual Private Network" inserts the words "Virtual Private Network" whenever the word "vprn" is typed.
:map keys new_seq Map a key or a sequence of keys to another key or sequence of keys.
:q Quit the text editor. If changes have been made, the editor issues a warning message.
:q! Quit the text editor without saving changes.
:s/pattern/to_pattern/options Substitute the specified pattern with the string in the to_pattern. Without options, only the first occurrence of the pattern is substituted. If a g is specified, all occurrences are substituted.
:set [all] Sets some customizing options. The :set all command displays all options.
:una string Removes the abbreviation previously defined by :ab.
:unm keys Removes the mapping defined by :map.
:vi filename Starts editing a new file. If changes have not been saved, the editor displays a warning message.
:w Write contents of the current file.
:w filename Write the contents of the buffer to the file name specified.
:w >> filename Append the contents of the buffer to the file name.
:wq Write the contents of the buffer and quit.

File management tasks in the classic CLI

The following sections are basic system tasks that can be performed in the classic CLI.

For more information about the supported classic CLI commands, see the 7450 ESS, 7750 SR, 7950 XRS, and VSR Classic CLI Command Reference Guide.

When a file system operation is performed that can potentially remove or overwrite a file system entry, a prompt appears to confirm the action. The force keyword performs the operation without displaying the confirmation prompt.

All the commands can operate on the local file system. The following table indicates the commands that also support remote file operations.

Table 11. File command local and remote file system support in the classic CLI
Command local-url ftp-url tftp-url http-url https-url

attrib

cd

copy

source only

copy (recursive)

checksum

delete

dir

md

move

move (recursive)

rd

scp

source only

type

unzip

source only

version

vi

Displaying directory and file information

Use the dir command to display a list of files on a file system, the type command to display the contents of a file, and the version command to display the version of an SR OS .tim image file.

The following example shows the usage of these commands.

A:node-2>file cf1:\ # dir
 Volume in drive cf1 on slot A has no label.
Directory of cf1:\
01/01/1980  12:00a                7597 test.cfg
01/01/1980  12:00a                 957 b.
08/19/2001  02:14p              230110 BOOTROM.SYS
01/01/1980  12:00a                 133 NVRAM.DAT
04/03/2003  05:32a                1709 103.ndx
01/28/2003  05:06a                1341 103.cftg.ndx
01/28/2003  05:06a               20754 103.cftg
04/05/2003  02:20a      <DIR>          test
              15 File(s)                 338240 bytes.
               3 Dir(s)                 1097728 bytes free.

A:node-2>file cf1:\ # type fred.cfg
# Saved to /cflash1/fred.cfg
# Generated THU FEB 21 01:30:09 2002 UTC
exit all
config
#------------------------------------------
# Chassis Commands
#------------------------------------------
card 2 card-type faste-tx-32
exit
#------------------------------------------
# Interface Commands
#------------------------------------------
# Physical port configuration
interface faste 2/1
    shutdown
    mode network
exit
interface faste 2/2
    shutdown
exit
interface faste 2/3
    shutdown
exit
interface faste 2/4
A:node-2>file cf1:\ # version boot.tim
TiMOS-L-1.0.B3-8
A:node-2>file cf1:\ #

Modifying file attributes

The system administrator can change the read-only attribute in the local file.

Enter the attrib command with no options to display the contents of the directory and the file attributes.

The following example shows the file configuration.

     A:node-2>file cf3:\ # attrib
     cf3:\bootlog.txt
     cf3:\bof.cfg
     cf3:\boot.ldr
     cf3:\bootlog_prev.txt
     cf3:\BOF.SAV
A:node-2>file cf3:\ # attrib +r BOF.SAV
A:node-2>file cf3:\ # attrib
     cf3:\bootlog.txt 
     cf3:\bof.cfg
     cf3:\boot.ldr
     cf3:\bootlog_prev.txt
R    cf3:\BOF.SAV

Creating directories

New directories can be created in the local file system, one level at a time. Use the md command to create a new directory. The cd command navigates to different directories. The following example shows the creation of three levels of directories.

A:node-2>file cf3:\ # md test1
A:node-2>file cf3:\ # cd test1
A:node-2>file cf3:\test1\ # md test2
A:node-2>file cf3:\test1\ # cd test2
A:node-2>file cf3:\test1\test2\ # md test3
A:node-2>file cf3:\test1\test2\ # cd test3
A:node-2>file cf3:\test1\test2\test3\ #

Copying files

Use the copy command to upload or download an image file, configuration file, or other file types to or from a flash device or an FTP/TFTP server. The copy command supports wildcards.

The scp command copies files between hosts on a network. It uses SSH for data transfer, and uses the same authentication and provides the same security as SSH. The source file for the scp command must be local. The file must reside on the router. The destination file has to be of the format: user@host:file-name. The destination does not need to be local.

The following example shows copy and scp command usage.

Image file and network host copy

A:node-2>file cf3:\ # copy 104.cfg cf1:\test1\test2\test3\test.cfg

A:node-2>file cf3:\ # scp file1 admin@192.168.0.1:cf1:\file1

A:node-2>file cf3:\ # scp file2 user2@192.168.0.1:/user2/file2

A:node-2>file cf3:\ # scp cf2:/file3 admin@192.168.0.1:cf1:\file3

Use the recursive keyword to recursively copy files and directories. If files or directories already exist, the operator is prompted to overwrite them. If the force keyword is specified, a positive response to the overwrite prompts is assumed. The operator is not prompted for confirmation and the existing files or directories are overwritten.

The following example shows a recursive directory copy.

Recursive directory copy

A:node-2# file dir
Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/19/2021 06:11p 196 BOF.CFG
09/19/2021 06:11p 0 CONFIG.CFG
09/19/2021 06:11p 101 NVRAM.DAT
09/19/2021 07:22p SUPPORT/
09/19/2021 06:11p SYSLINUX/
09/19/2021 06:11p TIMOS/
09/23/2021 09:03a 27459 bootlog.txt
09/20/2021 09:56a 27326 bootlog_prev.txt
09/23/2021 01:21p 319 nvsys.info
09/21/2021 07:19p recursive3/
09/23/2021 08:22a ssh/
7 File(s) 55402 bytes.
6 Dir(s) 612319232 bytes free.

A:node-2# file dir recursive3

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\recursive3

09/21/2021 07:18p ./
09/21/2021 07:18p ../
09/21/2021 07:19p 7 file1.txt
09/21/2021 07:19p recursive2/
1 File(s) 7 bytes.
3 Dir(s) 612319232 bytes free.

A:node-2# file copy recursive3 recursive1 recursive
Copying directory cf3:\recursive3
Copying directory cf3:\recursive3\recursive2
Copying file cf3:\recursive3\recursive2\file2.txt ... OK
Copying file cf3:\recursive3\recursive2\file3.txt ... OK
Copying file cf3:\recursive3\file1.txt ... OK
2 dir(s) and 3 file(s) copied.
A:sros# file dir
Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/19/2021 06:11p 196 BOF.CFG
09/19/2021 06:11p 0 CONFIG.CFG
09/19/2021 06:11p 101 NVRAM.DAT
09/19/2021 07:22p SUPPORT/
09/19/2021 06:11p SYSLINUX/
09/19/2021 06:11p TIMOS/
09/23/2021 09:03a 27459 bootlog.txt
09/20/2021 09:56a 27326 bootlog_prev.txt
09/23/2021 01:21p 319 nvsys.info
09/23/2021 02:42p recursive1/
09/21/2021 07:19p recursive3/
09/23/2021 08:22a ssh/
7 File(s) 55402 bytes.
7 Dir(s) 612298752 bytes free.

A:node-2# file dir recursive1

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\recursive1

09/23/2021 02:42p ./
09/23/2021 02:42p ../
09/23/2021 02:42p 7 file1.txt
09/23/2021 02:42p recursive2/
1 File(s) 7 bytes.
3 Dir(s) 612298752 bytes free.

Moving files

Files or directories can be moved from one location to another.

The move command supports wildcards, recursively moves files and directories, and overwrites existing content without prompting for confirmation.

The following example shows the usage of the file dir and move commands.

Moving files and directories

A:node-2>file cf3:\ # dir

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/28/2021  11:42a                 933 BOF.CFG
09/28/2021  11:42a                 166 NVRAM.DAT
09/29/2021  03:51p               12831 bootlog.txt
09/29/2021  03:46p               12828 bootlog_prev.txt
04/16/2014  10:15a                   0 config.cfg
09/29/2021  03:51p                 318 nvsys.info
04/16/2014  10:15a      <DIR>          syslinux/
09/29/2021  03:55p               12831 test.txt
09/29/2021  03:54p      <DIR>          test_dir1/
04/16/2014  10:15a      <DIR>          timos/
               7 File(s)                  39907 bytes.
               3 Dir(s)                14452736 bytes free.

A:node-2>file cf3:\ # move test.txt /test_dir1/test_dir2/test_dir3
Moving file cf3:\test.txt ... OK
cf3:\test.txt

A:node-2>file cf3:\ # dir

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/28/2021  11:42a                 933 BOF.CFG
09/28/2021  11:42a                 166 NVRAM.DAT
09/29/2021  03:51p               12831 bootlog.txt
09/29/2021  03:46p               12828 bootlog_prev.txt
04/16/2014  10:15a                   0 config.cfg
09/29/2021  03:51p                 318 nvsys.info
04/16/2014  10:15a      <DIR>          syslinux/
09/29/2021  03:54p      <DIR>          test_dir1/
04/16/2014  10:15a      <DIR>          timos/
               6 File(s)                  27076 bytes.
               3 Dir(s)                14452736 bytes free.

A:node-2>file cf3:\ # dir test_dir1/test_dir2/test_dir3

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\test_dir1\test_dir2\test_dir3

09/29/2021  03:54p      <DIR>          ./
09/29/2021  03:54p      <DIR>          ../
09/29/2021  03:55p               12831 test.txt
               1 File(s)                  12831 bytes.
               2 Dir(s)                14452736 bytes free.

The following example shows a recursive move of the recursive1 directory to recursive3.

Recursive directory move

A:node-2>file cf3:\ # dir

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/19/2021 06:11p 196 BOF.CFG
09/19/2021 06:11p 0 CONFIG.CFG
09/19/2021 06:11p 101 NVRAM.DAT
09/19/2021 07:22p SUPPORT/
09/19/2021 06:11p SYSLINUX/
09/19/2021 06:11p TIMOS/
09/23/2021 09:03a 27459 bootlog.txt
09/20/2021 09:56a 27326 bootlog_prev.txt
09/23/2021 01:21p 319 nvsys.info
09/23/2021 02:42p recursive1/
09/23/2021 08:22a ssh/
7 File(s) 55402 bytes.
7 Dir(s) 612311040 bytes free.

A:node-2>file cf3:\ # dir recursive1

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\recursive1

09/23/2021 02:42p ./
09/23/2021 02:42p ../
09/23/2021 02:42p 7 file1.txt
09/23/2021 02:42p recursive2/
1 File(s) 7 bytes.
3 Dir(s) 612311040 bytes free.

A:node-2>file cf3:\ # move recursive1 recursive4
Moving file cf3:\recursive1 ... OK
cf3:\recursive1
A:sros>file cf3:\ # dir

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/19/2021 06:11p 196 BOF.CFG
09/19/2021 06:11p 0 CONFIG.CFG
09/19/2021 06:11p 101 NVRAM.DAT
09/19/2021 07:22p SUPPORT/
09/19/2021 06:11p SYSLINUX/
09/19/2021 06:11p TIMOS/
09/23/2021 09:03a 27459 bootlog.txt
09/20/2021 09:56a 27326 bootlog_prev.txt
09/23/2021 01:21p 319 nvsys.info
09/23/2021 02:42p recursive4/
09/23/2021 08:22a ssh/
7 File(s) 55402 bytes.
7 Dir(s) 612311040 bytes free.

A:node-2>file cf3:\ # dir recursive4

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\recursive4

09/23/2021 02:42p ./
09/23/2021 02:42p ../
09/23/2021 02:42p 7 file1.txt
09/23/2021 02:42p recursive2/
1 File(s) 7 bytes.
3 Dir(s) 612311040 bytes free.

Deleting files and removing directories

Use the delete and rd commands to delete files and remove directories. Directories can be removed even if they contain files and subdirectories. To remove a directory that contains files and subdirectories, use the rd rf command. When files or directories are deleted, they cannot be recovered.

The force option deletes the file or directory without prompting the user to confirm.

The following example shows commands to delete files and remove directories.

A:node-2>file cf1:\test1\ # delete test.cfg
A:node-2>file cf1:\test1\ # delete abc.cfg
A:node-2>file cf1:\test1\test2\ # cd test3
A:node-2>file cf1:\test1\test2\test3\ # cd ..
A:node-2>file cf1:\test1\test2\ # rd test3
A:node-2>file cf1:\test1\test2\ # cd ..
A:node-2>file cf1:\test1\ # rd test2
A:node-2>file cf1:\test1\ # cd ..
A:node-2>file cf1:\ # rd test1
A:node-2>file cf1:\ #

Unzipping files

Use the unzip command to expand the contents of a ZIP file to the local file system. Any file that is zipped using the store, deflate, or zip64 compression methods can be unzipped. An example is the SR OS software image available from the Nokia customer support portal.

The source ZIP file location can be a locally installed solid-state storage device or a remote FTP or TFTP server.

The create-destination keyword ensures that any non-existent directory structure that is explicitly entered as the destination file URL is created as part of the unzip operation. This parameter is required to create new directories.

Note:
  • The destination for the unzipped files and directories must be a locally installed solid-state storage device in the active CPM.

  • ZIP filenames, or the filenames of any contained files, must not include special characters.

The following example shows the unzip command syntax.

A:test# file unzip demo.zip cf3:/mynewfolder/mynewsubfolder create-destination force
Verifying cf3:\demo.zip .. ... OK
Unzipping cf3:\demo.zip to cf3:\mynewfolder\mynewsubfolder\ .. .Processing demodir/
Processing demodir/myfile1.txt
Processing demodir/myfile2.txt
Processing demodir/demosubdir/
Processing demodir/demosubdir/myfile3.txt
Writing...OK

Repairing the file system

Use the repair command to check a compact flash device for errors and repair any errors found.

The following example shows the command syntax.

A:node-2>file cf3:\ # repair 
Checking drive cf3: on slot A for errors...
Drive cf31: on slot A is OK.

Displaying file checksums

The following example shows how to check the version of an SR OS .tim image file.

A:node-2>file cf3:\ # version cpm.tim
TiMOS-C-20.10.R1
Wed Nov 4 09:18:17 PST 2020 by builder in /builds/c/2010B/R1/panos/main/sros

A:node-2>file cf3:\ # version cpm.tim check
TiMOS-C-20.10.R1
Wed Nov 4 09:18:17 PST 2020 by builder in /builds/c/2010B/R1/panos/main/sros
Checking file ... OK

The following example shows the output of the checksum operation to compute and display a checksum based on the MD5 and SHA256 algorithms for the config.cfg file on cf3.

A:node-2# file checksum md5 cf3:config.cfg
Checking file cf3:config.cfg ...
c65699dc05e6e35a2172eaac80485aa2

A:node-2# file checksum sha256 cf3:config.cfg
Checking file cf3:config.cfg ...
a1a813a696be04906f9faf1df9db0f90a990ff51cb3383099ade21241203bc1c

File management tasks in the MD-CLI

The following sections are basic system tasks that can be performed in the MD-CLI.

For more information about the supported MD-CLI commands, see the 7450 ESS, 7750 SR, 7950 XRS, and VSR MD-CLI Command Reference Guide.

When a file system operation is performed that can potentially remove or overwrite a file system entry, a prompt appears to confirm the action. The force keyword performs the operation without displaying the confirmation prompt.

All the commands can operate on the local file system. The following table indicates the commands that also support remote file operations.

Table 12. File command local and remote file system support in the MD-CLI
Command local-url ftp-url tftp-url http-url https-url

change-directory

checksum

copy

source only

copy (recursive)

list

make-directory

move

move (recursive)

permission

remove

remove-directory

show

unzip

source only

version

Displaying directory and file information

Use the list command to list the files on a file system, with an option to indicate the list order based on the date, name, or size of the files. The show command displays the contents of a specified file or multiple files. The version command displays the version of an SR OS .tim image file.

The following example shows the command syntax.

[/file "cf3:\"]
A:admin@node-2# list

Volume in drive cf3 on slot A is .

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/01/2020  11:27p      <DIR>          .ssh/
01/01/1980  12:00a                 170 NVRAM.DAT
01/01/1980  12:00a                 679 bof.cfg
09/01/2020  11:27p                 319 nvsys.info
09/01/2020  11:27p                   1 restcntr.txt
09/02/2020  04:32p      <DIR>          tstdir/
               4 File(s)                   1169 bytes.
               2 Dir(s)                       0 bytes free.

[/file "cf3:\"]
A:admin@node-2# list size

Volume in drive cf3 on slot A is .

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/01/2020  11:27p      <DIR>          .ssh/
09/02/2020  04:32p      <DIR>          tstdir/
09/01/2020  11:27p                   1 restcntr.txt
01/01/1980  12:00a                 170 NVRAM.DAT
09/01/2020  11:27p                 319 nvsys.info
01/01/1980  12:00a                 679 bof.cfg
               4 File(s)                   1169 bytes.
               2 Dir(s)                       0 bytes free.

[/file "cf3:\"]
A:admin@node-2# show md-config.cfg
File: md-config.cfg
-------------------------------------------------------------------------------
configure {
    card 1 {
        mda 1 {
        }
    }
    log {
        filter 1001 {
            entry 10 {
                description "Collect only events of major severity or higher"
                action forward
                match {
                    severity {
                        gte major
                    }
                }
            }
        }
        log-id 99 {
            description "Default System Log"
            source {
                main true
Press Q to quit, Enter to print next line or any other key to print next page.

Modifying file attributes

The system administrator can change the attribute of a local file or files in a directory.

Enter the permission command with no options to display the contents of the directory and the file attributes.

A single local file can be specified or the wildcard character (*) can be used to indicate multiple files. If no URL is specified, the command applies to all files in the directory.

The following example shows the command syntax. A file with an ‟R” preceding the filename indicate the file is read-only; otherwise, the file is read-write.

[/file "cf3:\"]
A:admin@node-2# permission
            cf3:\NVRAM.DAT
            cf3:\bof.cfg
            cf3:\nvsys.info
            cf3:\restcntr.txt
            cf3:\.ssh
            cf3:\my.txt

[/file "cf3:\"]
A:admin@node-2# permission read-only my.txt

[/file "cf3:\"]
A:admin@node-2# permission
            cf3:\NVRAM.DAT
            cf3:\bof.cfg
            cf3:\nvsys.info
            cf3:\restcntr.txt
            cf3:\.ssh
 R          cf3:\my.txt
[/file "cf3:\"]
A:admin@node-2# permission read-only

[/file "cf3:\"]
A:admin@node-2# permission
 R          cf3:\NVRAM.DAT
 R          cf3:\bof.cfg
 R          cf3:\nvsys.info
 R          cf3:\restcntr.txt
 R          cf3:\.ssh
 R          cf3:\my.txt

Creating and navigating directories

New directories can be created in the local file system, one level at a time.

Use the make-directory command to create a new directory.

The change-directory command navigates to different directories.

The following example shows the creation of three levels of directories.

[/file "cf3:\"]
A:admin@node-2# make-directory test1

[/file "cf3:\"]
A:admin@node-2# change-directory test1

[/file "cf3:\test1"]
A:admin@node-2# make-directory test2

[/file "cf3:\test1"]
A:admin@node-2# change-directory test2

[/file "cf3:\test1\test2"]
A:admin@node-2# make-directory test3

[/file "cf3:\test1\test2"]
A:admin@node-2# change-directory test3

[/file "cf3:\test1\test2\test3"]
A:admin@node-2# change-directory ..

[/file "cf3:\test1\test2"]
A:admin@node-2#

Copying files

Use the copy command to upload or download an image file, configuration file, or other file types to or from a flash device or an FTP/TFTP server. Use the copy command to copy files. The copy command supports wildcards.

Use the recursive operation option to recursively copy files and directories. If files or directories already exist, the operator is prompted to overwrite them. Use the force operation option to automatically overwrite the existing files or directories, without being prompted for confirmation.

The following example shows how to copy the md-config.cfg file to the test_dir1 directory.

Configuration file copy

[/file "cf3:\"]
A:admin@node-2# list test_dir1

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\test_dir1

09/29/2021  05:07p      <DIR>          ./
09/29/2021  05:07p      <DIR>          ../
               0 File(s)                      0 bytes.
               2 Dir(s)                14458880 bytes free.


[/file "cf3:\"]
A:admin@node-2# list

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/28/2021  11:43a                 931 BOF.CFG
09/28/2021  11:43a                 165 NVRAM.DAT
09/28/2021  04:34p               11319 bootlog.txt
09/28/2021  03:50p               11259 bootlog_prev.txt
04/16/2014  10:15a                   0 config.cfg
09/29/2021  05:08p               11319 md-config.cfg
09/28/2021  04:34p                 319 nvsys.info
04/16/2014  10:15a      <DIR>          syslinux/
09/29/2021  05:08p      <DIR>          test_dir1/
04/16/2014  10:15a      <DIR>          timos/
               7 File(s)                  35312 bytes.
               3 Dir(s)                14458880 bytes free.


[/file "cf3:\"]
A:admin@node-2# copy md-config.cfg test_dir1
Copying file cf3:\md-config.cfg ... OK
1 file copied.

[/file "cf3:\"]
A:admin@node-2# list test_dir1

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\test_dir1

09/29/2021  05:07p      <DIR>          ./
09/29/2021  05:07p      <DIR>          ../
09/29/2021  05:09p               11319 md-config.cfg
               1 File(s)                  11319 bytes.
               2 Dir(s)                14447104 bytes free.

The following example shows a recursive move of the recursive4 directory to recursive5.

Recursive directory move

[/]
A:admin@node-2# file list

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/19/2021 06:11p 196 BOF.CFG
09/19/2021 06:11p 0 CONFIG.CFG
09/19/2021 06:11p 101 NVRAM.DAT
09/19/2021 07:22p SUPPORT/
09/19/2021 06:11p SYSLINUX/
09/19/2021 06:11p TIMOS/
09/23/2021 09:03a 27459 bootlog.txt
09/20/2021 09:56a 27326 bootlog_prev.txt
09/23/2021 01:21p 319 nvsys.info
09/23/2021 02:42p recursive4/
09/23/2021 08:22a ssh/
7 File(s) 55402 bytes.
7 Dir(s) 612311040 bytes free.

[/]
A:admin@node-2# file copy recursive4 recursive5 recursive
Copying directory cf3:\recursive4
Copying directory cf3:\recursive4\recursive2
Copying file cf3:\recursive4\recursive2\file2.txt ... OK
Copying file cf3:\recursive4\recursive2\file3.txt ... OK
Copying file cf3:\recursive4\file1.txt ... OK
2 dir(s) and 3 file(s) copied.

Moving files

Files or directories can be moved from one location to another. The move command recursively moves files and directories, and overwrites existing content without prompting for confirmation. The move command supports wildcards.

The following example moves the md-config.cfg file to the test_dir1 directory.

Moving files and directories

[/file "cf3:\"]
A:admin@node-2# list test_dir1

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\test_dir1

09/29/2021  05:07p      <DIR>          ./
09/29/2021  05:07p      <DIR>          ../
               0 File(s)                      0 bytes.
               2 Dir(s)                14458880 bytes free.


[/file "cf3:\"]
A:admin@node-2# list

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/28/2021  11:43a                 931 BOF.CFG
09/28/2021  11:43a                 165 NVRAM.DAT
09/28/2021  04:34p               11319 bootlog.txt
09/28/2021  03:50p               11259 bootlog_prev.txt
09/29/2021  05:08p               11319 md-config.cfg
09/28/2021  04:34p                 319 nvsys.info
04/16/2014  10:15a      <DIR>          syslinux/
09/29/2021  05:09p      <DIR>          test_dir1/
04/16/2014  10:15a      <DIR>          timos/
               7 File(s)                  35312 bytes.
               3 Dir(s)                14458880 bytes free.


[/file "cf3:\"]
A:admin@node-2# move md-config.cfg test_dir1
Moving file cf3:\md-config.cfg ... OK
cf3:\md-config.cfg

[/file "cf3:\"]
A:admin@node-2# list test_dir1

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\test_dir1

09/29/2021  05:07p      <DIR>          ./
09/29/2021  05:07p      <DIR>          ../
09/29/2021  05:08p               11319 md-config.cfg
               1 File(s)                  11319 bytes.
               2 Dir(s)                14458880 bytes free.


[/file "cf3:\"]
A:admin@node-2# list

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/28/2021  11:43a                 931 BOF.CFG
09/28/2021  11:43a                 165 NVRAM.DAT
09/28/2021  04:34p               11319 bootlog.txt
09/28/2021  03:50p               11259 bootlog_prev.txt
09/28/2021  04:34p                 319 nvsys.info
04/16/2014  10:15a      <DIR>          syslinux/
10/01/2021  04:17p      <DIR>          test_dir1/
04/16/2014  10:15a      <DIR>          timos/
               6 File(s)                  23993 bytes.
               3 Dir(s)                14458880 bytes free.

The following example shows a recursive move of the recursive1 directory to recursive3.

Recursive directory move

[/file "cf3:\"]
A:admin@node-2# list

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/19/2021 06:11p 196 BOF.CFG
09/19/2021 06:11p 0 CONFIG.CFG
09/19/2021 06:11p 101 NVRAM.DAT
09/19/2021 07:22p SUPPORT/
09/19/2021 06:11p SYSLINUX/
09/19/2021 06:11p TIMOS/
09/20/2021 09:56a 27326 bootlog.txt
09/20/2021 02:55p 319 nvsys.info
09/21/2021 07:19p recursive1/
09/20/2021 09:55a ssh/
6 File(s) 27943 bytes.
6 Dir(s) 612347904 bytes free.

[/file "cf3:\"]
A:admin@node-2# list recursive1

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\recursive1
09/21/2021 07:18p ./
09/21/2021 07:18p ../
09/21/2021 07:19p 7 file1.txt
09/21/2021 07:19p recursive2/
1 File(s) 7 bytes.
3 Dir(s) 612347904 bytes free.

[/file "cf3:\"]
A:admin@node-2# list recursive1/recursive2

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\recursive1\recursive2

09/21/2021 07:19p ./
09/21/2021 07:19p ../
09/21/2021 07:19p 7 file2.txt
09/21/2021 07:19p 7 file3.txt
2 File(s) 14 bytes.
2 Dir(s) 612347904 bytes free.

[/file "cf3:\"]
A:admin@sros# move recursive1 recursive3
Moving file cf3:\recursive1 ... OK
cf3:\recursive1

[/file "cf3:\"]
A:admin@node-2# list

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\

09/19/2021 06:11p 196 BOF.CFG
09/19/2021 06:11p 0 CONFIG.CFG
09/19/2021 06:11p 101 NVRAM.DAT
09/19/2021 07:22p SUPPORT/
09/19/2021 06:11p SYSLINUX/
09/19/2021 06:11p TIMOS/
09/20/2021 09:56a 27326 bootlog.txt
09/20/2021 02:55p 319 nvsys.info
09/21/2021 07:19p recursive3/
09/20/2021 09:55a ssh/
6 File(s) 27943 bytes.
6 Dir(s) 612347904 bytes free.

[/file "cf3:\"]
A:admin@node-2# list recursive3

Volume in drive cf3 on slot A is SROS VM.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\recursive3

09/21/2021 07:18p ./
09/21/2021 07:18p ../
09/21/2021 07:19p 7 file1.txt
09/21/2021 07:19p recursive2/
1 File(s) 7 bytes.
3 Dir(s) 612347904 bytes free.

Deleting files and removing directories

Use the remove and remove-directory commands to delete files and remove directories. Directories can be removed even if they contain files or subdirectories.

The following example shows removing the test1/test2/test3 directory.

[/file "cf3:\test1\test2"]
A:admin@node-2# list

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\test1\test2

09/01/2020  08:13p      <DIR>          ./
09/01/2020  08:13p      <DIR>          ../
09/04/2020  06:36p                 874 bof.cfg
04/28/2020  03:15p               11401 md-config.cfg
09/04/2020  06:43p      <DIR>          test3/
               2 File(s)                  12275 bytes.
               3 Dir(s)                10641920 bytes free.

[/file "cf3:\test1\test2"]
A:admin@node-2# list test3

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\test1\test2\test3

09/01/2020  08:13p      <DIR>          ./
09/01/2020  08:13p      <DIR>          ../
09/04/2020  06:43p               11788 conf3.cfg
09/04/2020  04:24p                6645 mybof.cfg
               2 File(s)                  18433 bytes.
               2 Dir(s)                10641920 bytes free.

[/file "cf3:\test1\test2"]
A:admin@node-2# remove-directory test3 ?

 remove-directory
 force                 - Force removal without prompting
 recursive             - Remove directory and its content recursively

[/file "cf3:\test1\test2"]
A:admin@node-2# remove-directory test3 recursive
Deleting all subdirectories and files in specified directory. y/n ?y
Deleting file cf3:\test1\test2\test3\mybof.cfg ... OK
Deleting file cf3:\test1\test2\test3\conf3.cfg ... OK
Deleting directory cf3:\test1\test2\test3 ... OK

[/file "cf3:\test1\test2"]
A:admin@node-2# list

Volume in drive cf3 on slot A is TIMOS_VM_CF.

Volume in drive cf3 on slot A is formatted as FAT32

Directory of cf3:\test1\test2

09/01/2020  08:13p      <DIR>          ./
09/01/2020  08:13p      <DIR>          ../
09/04/2020  06:36p                 874 bof.cfg
04/28/2020  03:15p               11401 md-config.cfg
               2 File(s)                  12275 bytes.
               2 Dir(s)                10661376 bytes free.

Unzipping files

Use the unzip command to expand the contents of a ZIP file to the local file system. Any file zipped using the store, deflate, or zip64 compression methods can be unzipped. An example is the SR OS software image available from the Nokia customer support portal.

The source ZIP file location can be a locally installed solid-state storage device or a remote FTP or TFTP server.

The create-destination configuration option ensures that any non-existent directory structure that is explicitly entered as the destination file URL is created as part of the unzip operation. This parameter is required to create new directories.

Note:

  • The destination for the unzipped files and directories must be a locally installed solid-state storage device in the active CPM.

  • ZIP filenames, or the filenames of any contained files, must not include special characters.

The following example shows a file being unzipped.

[/file "cf3:\"]
A:admin@node-2# unzip demo.zip cf3:/mynewfolder/mynewsubfolder create-destination
   force
Verifying cf3:\demo.zip .. ... OK
Unzipping cf3:\demo.zip to cf3:\mynewfolder\mynewsubfolder\ .. .Processing demodir/
Processing demodir/myfile1.txt
Processing demodir/myfile2.txt
Processing demodir/demosubdir/
Processing demodir/demosubdir/myfile3.txt
Writing...OK

Repairing the file system

Use the repair command to check a compact flash device for errors and repair any errors found.

The following example shows the command syntax.

[/file "cf3:\"]
A:admin@node-2# repair cflash-id cf3:
Checking drive cf3: on slot A for errors...
Drive cf3: on slot A is OK.

[/file "cf3:\"]
A:admin@node-2# repair
Checking drive cf3: on slot A for errors...
Drive cf3: on slot A is OK.

Displaying file checksums

Use the checksum command to display file checksums.

The following example shows the output of the operation to check an SR OS .tim image file checksum.

SR OS .tim image file checksum

[/file "cf3:\"]
A:admin@node-2# checksum image cpm.tim
TiMOS-C-20.10.R1
Wed Nov 4 09:18:17 PST 2020 by builder in /builds/c/2010B/R1/panos/main/sros
Checking file ... OK

The following example shows the output of the checksum operation to compute and display a checksum based on the MD5 and SHA256 algorithms for the config.cfg file on cf3.

Configure file checksum based on MD5 and SHA256 algorithms

[/]
A:admin@node2# file checksum md5 cf3:config.cfg
Checking file cf3:config.cfg
c65699dc05e6e35a2172eaac80485aa2

[/]
A:admin@node2# file checksum sha256 cf3:config.cfg
Checking file cf3:config.cfg
a1a813a696be04906f9faf1df9db0f90a990ff51cb3383099ade21241203bc1c